Learn Programming with OCaml
Questions about whether it’s still worth learning programming languages like OCaml in the age of large language models draw strong arguments that human understanding, mental models, and the joy of problem‑solving remain essential. Commenters highlight OCaml’s strengths as a simple yet powerful ML-family language—useful for teaching core CS concepts, influencing how developers think about system design, and working especially well with static types and LLM-assisted workflows—while also comparing it to Rust, Haskell and C as teaching or production tools. Others point to practical resources, GUI options, and the tension between learning for career utility versus personal intellectual growth.
Whether to learn OCaml (or anything) in the LLM era
- Many argue you should still learn languages like OCaml for intrinsic reasons: curiosity, enjoyment, mental exercise, and developing understanding, not just employability.
- Analogies: history vs books, baking by hand vs machines, playing an instrument vs pressing play, walking vs vehicles, doing sudoku vs computers solving it.
- Several warn that outsourcing thinking to LLMs erodes understanding and the ability to generate new ideas or even to prompt tools effectively.
- Others frame it pragmatically: even if LLMs help, you must understand programming to guide and verify their output.
Benefits and nature of OCaml / ML-family languages
- Learning OCaml or another functional language is said to fundamentally change how people think about programs and complex systems.
- OCaml is described as multi-paradigm (functional, imperative, OO) with simple semantics and powerful static types.
- Some claim it’s a good gateway to formal methods and that the coming decade may emphasize formal verification.
- There’s support for knowing at least one C-like, one Lisp, and one ML-like language.
OCaml as first teaching language
- Several advocate ML as the ideal “first language” for computer scientists due to clarity of abstractions.
- Others argue C (or similar) is best for understanding how programs run on hardware, though there’s pushback that modern C is far from actual machines.
- Experiences differ: learning OCaml or Haskell first can be hard initially but is credited with long-term benefits; some find being the only functional programmer in an imperative team unpleasant.
OCaml + LLM synergy (“secret weapon”)
- Strong claims that LLMs write OCaml unusually well, particularly compared to more complex type systems.
- Reasons given: Hindley–Milner types, global inference, fast compilation, and interface files provide tight feedback loops for the model.
- Rust and Haskell are seen as more complex or slower for this purpose; details are said to be under active study, but evidence remains unpublished and somewhat unclear.
Resources, tooling, and ecosystem
- The Cornell CS3110 OCaml course and its textbook are repeatedly recommended; the featured book is praised but considered too hard for absolute beginners.
- REPL-based learning is encouraged for novices.
- GUI options mentioned include GTK-based bindings and some macOS/Linux toolkits, but no clear consensus “best” cross-platform framework emerges.
Skepticism and alternatives
- A minority dismiss OCaml as strange or not worth learning compared to Python, JS/Go, Lean, Rust, or focusing on “AI-maxing” and broader engineering skills.
- Others counter that once OCaml clicks, it can replace many scripting and application languages in daily use.