Roc version 0.1.0, eight years in the making rtfeldman.com · 107 points · 12 com...

@best

Roc version 0.1.0, eight years in the making rtfeldman.com · 107 points · 12 comments · HN thread

TL;DR Roc, a functional language inspired by Elm, has reached its first numbered release, 0.1.0, after development began in 2018. The announcement post cites community benchmarks showing runtime near C and Rust (roc-deflate about 2.6% to 8.9% slower than libdeflate, roc-regex faster than Rust's regex on its inputs), measured build times for check, build and test, and a list of community projects built in Roc.

  • Roc aims for performance near Rust and C++ without matching it, because it uses automatic memory management and stricter memory safety; roc-deflate had a median slowdown of 2.6% on an M1 MacBook Pro and 8.9% on a Ryzen 3900X versus libdeflate.
  • roc-regex benchmarks faster than the Rust regex crate, but the author says the comparison is not apples-to-apples because its RE#-based algorithm favors these inputs.
  • Effectful functions must end in '!', the compiler forbids calling them from pure code, and pure functions are evaluated at compile time when they have no runtime inputs, so even roc check can report a bad regex literal.
  • Build-time charts cover cold, warm, root-changed and import-changed builds for roc check, roc build --opt=dev and roc test; one outlier project was excluded, and a compiler edge case it exposed is slated for 0.1.1.
  • The next release, 0.1.1, is expected around December 2026 with bugfixes and performance work; 2027 exploration includes concurrency primitives, better testing, a debugger and cold-build speed.

Discussion The thread is short and mostly positive, with congratulations for the 0.1 release and interest in trying Roc. The most substantive exchange is with the developer of the Bliss Writer screenwriting app, who says Roc's design lets naive code run fast and has made their beta reliable. Other comments praise Roc's error handling, compare it to Haskell for Advent of Code, and raise questions about async and effect typing. The author replied to two of those questions, but the replies were not included here. A side thread notes the name clash with the Rocq prover.

  • Positive about Roc's design and early results (many): Commenters praise the language's cleanliness and the 0.1.0 release, and the screenwriting developer reports stable, fast production software written in it. The tone is hopeful about its future.
  • Error handling is a standout feature (a few): One commenter likes how errors form a union that can be selectively handled and otherwise propagated, instead of forcing every error to be mapped into a single type.
  • Concern about function colouring and effect spread (some): A commenter asks how async fits in and whether effectful functions plus async could produce several colours that spread through most code. The author's reply was marked as delayed.
  • Question why effects are only a naming convention (a few): A commenter asks why effects are tracked by a naming convention and not by managed typed effects. The author's reply was marked as delayed.
  • Name clash with Rocq (formerly Coq) (a few): Commenters note that Roc and the Rocq prover share a name, and one says Rocq has the greater mindshare despite Roc being first.

Links from the comments

#Roc #programmingLanguages #functionalProgramming #compilers #release