9 comments

[ 0.15 ms ] story [ 28.9 ms ] thread
[flagged]
Could an OCaml expert give a quick take on the view that if FP, why not go all the way and do Haskell instead? I mean, if "correct, efficient, beautiful" are attributes of OCaml (and I know opinions differ, but let's assume for a moment..) then shouldn't they be attributes of Haskell too, maybe even more so in some ways?
The person to look to for explanations of why OCaml/SML and not Haskell is Bob Harper. For example, the module system vs ad hoc polymorphism: https://existentialtype.wordpress.com/2011/04/16/modules-mat... He also has in-depth critiques of laziness-by-default but the one link I found is a 404.
There's absolutely nothing efficient nor beautiful about programming in OCaml.
Apart from being tied with Jane Street's libraries, Real World OCaml is "deeper" in that it also talks about implementation details. This book has a more "introduction to functional programming via OCaml" vibe. Both are good textbooks with different emphases.

The main author Michael Clarkson also started a similar lecture series on Software Foundations using Rocq (Coq)[1]. Not sure if that's still updated though.

[1]: https://github.com/clarksmr/sf-lectures

I would take the FP zealots more seriously if they stopped asserting that FP makes things more correct.

Zero evidence that this is the case.

I can tell you that debugging a compiler written in ML is a dumpster fire compared to debugging a compiler written in C++. If take C++ over any FP language for compilers any day of the week.

I just want OCAML to have curly braces, please. And the variable scope thing in OCAML is extremely off putting.