November 4, 2025
Curried beef with extra Rust
Pain Points of OCaml
OCaml rant sparks love-or-loathe feud as Rust fans crash the party
TLDR: A student building a compiler vents about OCaml’s confusing syntax and type errors, pining for Rust. Comments split: veterans say OCaml is fine and simpler than Rust, others suggest plugins and starter guides; it’s a love-or-loathe debate that matters for picking languages in school and work.
An OCaml class project turned vent session: a student building a compiler says OCaml’s syntax feels like “where does this even end,” with let…in and match statements missing stop signs. Automatic “currying” (functions auto-splitting) keeps serving surprise bugs, and the type checker is “too clever,” throwing mystery errors. There’s grumbling about types that don’t hoist (you can’t use a type before it’s declared), and enum variants crashing the party without names. Tools like Dune impress, but Jane Street’s Core replacing the standard library raises eyebrows, while parser tools ocamllex and Menhir get called opaque mini-languages.
Then the comments set the room on fire. Defenders clap back: rwmj says there’s no pain point and even claims Rust’s types are more complicated, plus his teammate uses AI to survive the syntax. Tooling fans cheer ppx_deriving: “ppx made my OCaml life better.” Old-school ML folks shrug—pjmlp never saw a problem—while jpfromlondon calls OCaml a love-or-loathe language. anthk slides in with a friendly ladder: start with MLite.
The vibe? A spicy stew of curried beef, match made in chaos, and let…in therapy. Rust tourists clutch pearls; OCaml lifers say “just learn it.” And everyone agrees: the error messages could use less mystery and more manners.
Key Points
- •Author reports OCaml syntax challenges, including non-terminated match statements and minimal punctuation complicating nesting and readability.
- •Automatic currying and partial application can lead to hard-to-understand errors without explicit type annotations.
- •OCaml’s strong type inference can produce inscrutable error messages when it fails, prompting the author to annotate parameters and return types.
- •OCaml lacks type hoisting; enumerated type variants are not namespaced and may silently shadow others.
- •Tooling has improved with Dune; the ecosystem is influenced by Jane Street’s Core; compiler work uses ocamllex and Menhir (a drop-in replacement for ocamlyacc).