OCaml
Hacker ApprovedRanked 18 of 163 programming languages by recommenders
Recommended for its expressive, safe type system, fast compiler, readable syntax and pattern matching; the common caveat is a small ecosystem with thin libraries, stdlib and tooling.
Recommended for its expressive, safe type system, fast compiler, readable syntax and pattern matching; the common caveat is a small ecosystem with thin libraries, stdlib and tooling.
272 people gave an opinion
- recommend it
- 210
- criticize it
- 62
- approval share
- 77%
Recommended in 12 of 13 months
- November 2025: recommended
- December 2025: recommended
- January 2026: recommended
- February 2026: recommended
- March 2026: recommended
- April 2026: recommended
- May 2026: recommended
- June 2026: recommended
- July 2026: recommended
- August 2026: recommended
- September 2026: recommended
- October 2026: recommended
- November 2026: not recommended (month in progress)
Owned for 20 years
Median of the 11 owners who said how long they have had it.
Each square is one year.
Why it carries the badge
- 210 people recommend itNeeds 10 or more, met.
- 3.4 recommenders for every criticNeeds 2 to 1 or better, met.
- Recommended in 12 of 13 monthsNeeds 4 or more, met.
The same three rules apply to every product, and the badge can’t be bought. How the badge works
What people say about it
The reasons people give, with the number of comments that give each one. Open a reason to read what they said.
Why people recommend it
Each mark is one comment
Expressive, safe type system
“ocaml has excellent compilation speed, and in my experience the code is very maintainable due to the module and type systems”
Comment from 3 Aug 2026 in “Bonsai: Janestreet's UI Library” “it already had better static analysis and correctness on object oriented stuff than what Java struggles to approach today”
Comment from 25 Nov 2025 in “Fifty Shades of OOP” “the benefits of functional programming and the type guarantees that it's ilk provides cannot be understated”
Comment from 7 Nov 2025 in “Why I love OCaml (2023)” - Comment from 7 Nov 2025 in “We chose OCaml to write Stategraph”
- Comment from 12 May 2026 in “If AI Writes Your Code, Why Use Python?”
- Comment from 2 Mar 2026 in “Go is the best language for agents”
- Comment from 2 Mar 2026 in “Go is the best language for agents”
- Comment from 8 Dec 2025 in “The "confident idiot" problem: Why AI needs hard rules, not vibe checks”
Fast compilation
“ocaml has excellent compilation speed, and in my experience the code is very maintainable due to the module and type systems”
Comment from 3 Aug 2026 in “Bonsai: Janestreet's UI Library” “OCaml's only major advantage IMO is compile time. That doesn't seem compelling enough to put up with the downsides to me.”
Comment from 7 Nov 2025 in “We chose OCaml to write Stategraph” “got rid of its global lock, got a really fast-compiling native toolchain with stable and improving editor tooling”
Comment from 7 Nov 2025 in “Why I love OCaml (2023)” - Comment from 10 Nov 2025 in “We chose OCaml to write Stategraph”
- Comment from 8 Dec 2025 in “The "confident idiot" problem: Why AI needs hard rules, not vibe checks”
Clean, readable syntax
“For me, the match syntax, the function signatures, the |> operator, and OCaml’s approach to shadowing are all very readable”
Comment from 11 Dec 2025 in “Thoughts on Go vs. Rust vs. Zig” “I find its lack of syntax sugar makes it easy to read nearly any OCaml code I come across in the wild”
Comment from 22 Dec 2025 in “Ruby website redesigned” “ML syntax has been designed to teach programming to fresh students with just a background in math.”
Comment from 4 Nov 2025 in “Pain Points of OCaml” - Comment from 4 Nov 2025 in “Pain Points of OCaml”
Great for learning programming
“if your goal is to learn a language that will genuinely improve your programming skills, I'd say OCaml is one of the best options”
Comment from 11 Dec 2025 in “Thoughts on Go vs. Rust vs. Zig” “OCaml is easy and flexible which makes it good imo as a door towards the more formal part of comp sci”
Comment from 5 Sep 2026 in “Learn Programming with OCaml” “ML syntax has been designed to teach programming to fresh students with just a background in math.”
Comment from 4 Nov 2025 in “Pain Points of OCaml”
What people warn about
Each mark is one comment
Small ecosystem, few libraries
“Possibly the best language (alongside Haskell) if you need pattern-matching. Not quite as good if you need lots of libraries”
Comment from 16 Nov 2025 in “Linux mode setting, from the comfort of OCaml” “None of my day jobs have ever been a situation where the smaller ecosystem and community of ocaml was offset by anything ocaml did better”
Comment from 7 Nov 2025 in “Why I love OCaml (2023)” “anyone trying to learn Haskell, OCaml, or other language with minimal/"batteries depleted" stdlib will suffer.”
Comment from 30 Nov 2025 in “Advent of Code 2025” Build tooling problems
“opam doesn't produce proper lock files (only version numbers) and it seemed silly to not be able to even include another file”
Comment from 13 Dec 2025 in “I tried Gleam for Advent of Code” “Yes, the syntax is relatively easy to learn. But when I look at what Jane St etc have created for libs, the tooling, etc.”
Comment from 4 Nov 2025 in “Pain Points of OCaml” “ran into a bunch of problems with build tooling, standard library, syntax noise, ideological/unhelpful community”
Comment from 11 Sep 2026 in “Rust is tier-1 language at Microsoft” Clunky imperative code
“being constrained to pattern matching in places where imperative programming would be more natural”
Comment from 9 Nov 2025 in “Why I love OCaml (2023)” “writing imperative code in OCaml feels quite right. Maybe it's just me, but it always feels significantly clunkier than the functional equivalent”
Comment from 8 Nov 2025 in “Why I love OCaml (2023)” Risky multicore parallelism
“I do think maybe it should have stayed single threaded, or only allowed parallel iteration/loopsbfor fine grained parallelism.”
Comment from 4 Nov 2025 in “Pain Points of OCaml” “In ocaml5 if you use domain, it is down to experience skill, and some luck to be sure you used atomic when necessary.”
Comment from 7 Nov 2025 in “We chose OCaml to write Stategraph”
Other programming languages people recommend
The four most recommended other programming languages, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.
See all 163 programming languages, rankedWhat people said
40 of the 446 comments that mention it, newest first. Each links to the original comment.
“ran into a bunch of problems with build tooling, standard library, syntax noise, ideological/unhelpful community”
“OCaml is the LLM secret weapon right now. They are better at writing it than they are any other language.”
“OCaml is easy and flexible which makes it good imo as a door towards the more formal part of comp sci”
“ocaml has excellent compilation speed, and in my experience the code is very maintainable due to the module and type systems”
“I have never programmed Ocaml but my understanding is introspection is kind of a weak spot for the language.”
“Basically I liked Ocaml so I have huge appreciation for all that Rust tries to bring into the mainstream on that front.”
“Haskell and ocaml would definitely be next on my list, but they do take a very good hit in performance”
“it's always better to use the safest possible language so that the compiler can catch most of the errors”
“Can confirm that OCaml is a good language to work with. And it's not so difficult to get your head around, especially with LLMs to hold your hand.”
“hiring for OCaml developers was easier because the signal to noise ratio in the OCaml community is so much better”
“OCaml has an expressive type system that lets you build abstractions that just aren’t possible with Go”
“Strongly typed, including GADTs and various flavors of polymorphism, but not as inscrutable as Haskell”
“I find its lack of syntax sugar makes it easy to read nearly any OCaml code I come across in the wild”
“opam doesn't produce proper lock files (only version numbers) and it seemed silly to not be able to even include another file”
“if your goal is to learn a language that will genuinely improve your programming skills, I'd say OCaml is one of the best options”
“For me, the match syntax, the function signatures, the |> operator, and OCaml’s approach to shadowing are all very readable”
“Ocaml's type system is actually really simple, which is probably why the compiler can be so fast.”
“anyone trying to learn Haskell, OCaml, or other language with minimal/"batteries depleted" stdlib will suffer.”
“By that time it supported parametric generics, multiple inheritance, named parameters, optionals instead of nulls everywhere”
“it already had better static analysis and correctness on object oriented stuff than what Java struggles to approach today”
“Possibly the best language (alongside Haskell) if you need pattern-matching. Not quite as good if you need lots of libraries”
“I miss from OCaml: faster compile times, non-recursive `let` by default, polymorphic variants, labeled arguments”
“being constrained to pattern matching in places where imperative programming would be more natural”
“the OCaml compiler devs have made it very clear they are open to well-motivated extensions of the stdlib”
“writing imperative code in OCaml feels quite right. Maybe it's just me, but it always feels significantly clunkier than the functional equivalent”
“None of my day jobs have ever been a situation where the smaller ecosystem and community of ocaml was offset by anything ocaml did better”
“the benefits of functional programming and the type guarantees that it's ilk provides cannot be understated”
“people have been using OCaml software as parts of tech stacks in critical industries for around 20 years”
“got rid of its global lock, got a really fast-compiling native toolchain with stable and improving editor tooling”
“Bigger native ecosystem. C#/.net integration is a double edged sword: a lot of libraries, but the libraries are not written in canonical F#.”
“In ocaml5 if you use domain, it is down to experience skill, and some luck to be sure you used atomic when necessary.”
“they do not in any way give you the same level of guarantees that OCaml, Haskell, or Rust would give you.”
“OCaml's only major advantage IMO is compile time. That doesn't seem compelling enough to put up with the downsides to me.”
“Yes, the syntax is relatively easy to learn. But when I look at what Jane St etc have created for libs, the tooling, etc.”
“ML syntax has been designed to teach programming to fresh students with just a background in math.”
“I do think maybe it should have stayed single threaded, or only allowed parallel iteration/loopsbfor fine grained parallelism.”
“I've used OCaml for writing small compilers and it was really clean but that's a toy thing that will not see much real world usage.”
“I personally find OCaml's syntax to be great. Very easy to write and read once you're used to it.”
“That's one of the greatest strenght of ML actually and especially Ocaml where parametrised modules are everywhere and a required building block of generic code.”
“What I liked is that the OCaml ecosystem doen't look like it wants to control or ought to fear the next big thing.”
Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.