{
  "id": 16181864,
  "title": "How close can pure FP get to C?",
  "url": "https://urgent.news/2026/10/23/how-close-can-pure-fp-get-to-c",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-23T11:37:22.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://rtfeldman.com/fp-vs-c"
  },
  "original_language": "en",
  "account": "In Why Lean is Faster Than Rust, an astonishing feat is highlighted: a DEFLATE compression library, written in Lean 4, a functional programming language and proof assistant, outperforms a comparable Rust package with over a billion downloads on crates.io. According to the article, lean-zip matches or surpasses miniz_oxide's compression at higher speeds 15% quicker and with 8.8% smaller output. However, lean-zip falls short in comparison to libdeflate, the C-based reference implementation, which outperforms it by a significant margin. This disparity is attributed to libdeflate's meticulous optimization, leveraging architecture-specific SIMD instructions that are beyond the reach of Lean.\n\nEnter Roc, a functional programming language with a primary focus on runtime performance. Roc's motto is \"Fast, Friendly, Functional,\" emphasizing speed in both execution and compilation. Despite being in its infancy with only a preliminary release of 0.1.0, Roc's early compiler implementation and language design have paved the way for performance enhancements. I decided to leverage Roc to challenge libdeflate's supremacy in DEFLATE compression, focusing on non-streaming APIs, using the Silesia corpus for benchmarking and ensuring identical output. The benchmarks, conducted on a 2021 M1 MacBook Pro and an AMD Ryzen 9 3900X Ubuntu machine, reveal that roc-deflate, developed by Niclas Ahden, lags behind libdeflate in performance, being 8.9% slower on average on the Ryzen 3900X and 2.6% slower on the M1 MacBook Pro.",
  "summary": null,
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}