A new C++ back end for ocamlc (github.com)
The ocaml/ocaml pull request proposes a new C++ backend for ocamlc, replacing the older non-incremental C++ generation used by the runtime/FFI. It demonstrates compiling a purely functional OCaml prime-sieve program into readable C++ templates via ocamlc -incr-c, and discusses how C++ template depth and interpreter choice affect build/run behavior. The author notes that larger computations can require special flags and improved algorithms, and suggests the approach could potentially be extended to other languages in future work.
April 02, 2026 00:11
Source: Hacker News