[Job] Build System Engineer at Jane Street

This does seem a little off-topic but I don’t mind =) I’m glad you loved our paper!

Indeed, Haskell was my first language of choice before joining Jane Street. After writing a lot of OCaml in the last two years, I’ll now choose OCaml for any non-toy project. It’s worth saying that I continue to maintain several Haskell projects, and I still enjoy writing some little experiments in Haskell (and also Agda).

Here are the OCaml features I love:

  • Modules. I define a lot of modules. It’s great to not be restricted by Haskell’s one-module-per-file rule. I also love not having to mess around with module import lists.
  • I got really addicted to named arguments. This feature makes it so much easier to read and write code. I hope Haskell gets named arguments too some day.
  • OCaml’s records… just work. Haskell is fixing records too – perhaps, the latest release (GHC 9.2.1) finally solves this long-standing problem but I haven’t tried yet.
  • I like let rec. I think it’s the right call to make let non-recursive by default.
  • Finally, I prefer strict evaluation by default. Pervasive laziness let’s you do some really cool things, no doubt, but… all my Haskell programs have memory leaks. I just know that. And when I try fixing them, I often have to turn an elegant Haskell program into some cryptic bang-annotated meh. I prefer my lazy bits to be inelegant in OCaml because, as it happens, I don’t need laziness as often as I thought.
  • I think OCaml’s build/compilation times are much better, which makes me more productive. (I’ve never done a proper comparison though.)

Of course, there are some things I don’t like about OCaml:

  • No type classes means I often need to be more explicit that I’d like. Being explicit is not always a bad thing, but this typically bites me during a long debugging session where I just can’t print out the thing I want, which slows me down. Fortunately, there is some work on fixing this.
  • This is a little thing but it bothered me since day 1 and still bothers me: writing the type parameter before the type name, as in string option list. I know this is never going to change, which makes me a little sad. But maybe I’ll get used to it eventually. Yoda become maybe I will!
  • There is no hoogle =(
  • The lack of higher-kinded types means that some abstractions that are easy in Haskell, like traversable containers, become harder/less elegant in OCaml. This paper does a good job describing the problem.
27 Likes