Why did you learn OCaml?

So to also get back on the original topic:

After some Basic, Pascal, Maple, Mathematica, and 90’s Casio/TI calculator programming, my intro-CS class in Engineering School was using Caml-Light (which is very good for teaching but leaves students with the false impression that functional programming is just for didactic toy-languages).

After that came a ton of Java, C, C++, assemblers, Matlab, …

First job after school, I wanted to see how people make software that actually works, so went into “embedded/safety-critical avionics” → tiny subset of C with less than 1% of the time spent programming very dumbed-down algorithms (instead, by very far, the fun part is writing tests: very complicated scenarios that make many crazy situations happen).

Then got bored, started PhD in multimedia/distributed-systems (2006). Still interested in making things work instead of seg-faulting/CVE-ing, so I got interested again in OCaml, and because it was for my PhD I could just start just using it, nobody cared — first I wrote “first-person/walk-through” 3D engine with LablGL(UT) → my own horrible pile of java-like code with a ton of objects and Option.get_exn's (= “ocaml.lang.NonePointerException” :)).

Fun to be the only statically-typed-FP person in a community were most people believe that somewhere on Earth, there exist programmers capable of handling things like C++ or dynamic typing and that those hypothetical superhumans are actually among them!

But what I was making worked & had good performance for a tenth of the effort, so :man_shrugging:.

Then some security, some biology/biomedical research software, and now cryptocurrencies, all mostly in OCaml, with music software as hobby programming too.

Over the years, sometimes frustrated with some OCaml quirks, I’ve taken a hard look at, learned, or tried every language that has a type system, I always come back to OCaml as by far the best compromise (and yes I have quite a bit of Haskell experience and I think type-classes are a toxic anti-feature ;)). Moreover, things that were annoying me for years have been fixed now by the community: a fast & hackable build system and decent automatic code formatting :pray:.

This is all very nice and shiny but The Future is OCaml becoming just glue code around Coq-extracted/generated code; so I hope I’ll get to use & write more real-world Coq as soon as possible (sorry for those who know me and have heard this a 100 times: go read/make-the-exercises of Software Foundations IMHO best book ever written on all of computer science).

8 Likes