OCaml — cover art: a wise camel in a deep-oxblood waistcoat and small wire-rim spectacles strides along a sunlit mountain pass, a brass instrument satchel over one shoulder and a small open notebook of mathematical glyphs in its forepaw. 🤓

2004 · Drunken Blog Rants · Note

“OCaml is a very high-level language, similar perhaps to Lisp or Prolog, but with strong type-checking that helps your programs run correctly the first time. However, it appears to be as fast or faster than C++, in any number of language shootouts.”
— From OCaml, June 2004
Read the essay

© 2004 Steve Yegge. Originally published at Drunken Blog Rants.

Author’s note

I believe this may have been my first-ever internal article inside Amazon, after having worked there for about 5 years. The company was coding primarily in Perl, C++, and Java, and I was unhappy with all of them. I felt like other languages held a lot of promise. OCaml I found to be particularly neat, because it took SML (a nifty pure-functional language) and made it practical with variable rebinding and such.

Ultimately I could not get other Amazon devs to take OCaml seriously. And back then it was so early for the language, almost no community, that I soon went back to Lisp.

Today, Jane Street, one of the world's first, largest, and most successful quant firms, uses OCaml extensively. They have taken it in-house and have been steadily advancing the language and compiler capabilities.

AI Notes

For something filed under the Drunken Blog Rants banner, this is an oddly sunny document: a programmer on day one of a language crush, writing down every reason the new one might finally work out. Steve arrived here off a year-long bender through eighteen languages (XSLT included), having hit his wall at 600,000 lines of Java, a language he pronounces "uncompressable": for X amount of functionality you get Y lines of code, no way around it. Most of the piece inventories what OCaml had in the box in mid-2004, from Emacs support to CORBA bindings, but the detours carry the flavor: the C++ compiler written off because it "doesn't really know what the hell you're doing," and a whole paragraph needling Gregor Kiczales for rebranding decades-old CLOS ideas as AspectJ. ("Kudos. But I'm not going to use it.")

As advocacy it's thin: the speed claim is verified only "for small programs," and anything past the nutshell explanation gets waved off with "that's complicated, and it involves a lot of proofs." The pleasure now is archaeological. F# appears in the opening lines as an obscure Microsoft Research download, years before it became a shipping .NET language, and the whole note catches a technology at the exact moment it looks perfect, before anyone has asked it to hold up a large system.

Related listings

  • 2004

    More OCaml

    A month later — the follow-up Steve wrote because he kept finding things to like, capped by the reversible replay debugger that he refused to stop talking about.

  • 2005

    Lisp Wins (I think)

    A year later — the same year-long language tour from which the OCaml note is one stop, ending at Lisp instead of OCaml.

  • 2004

    Tour de Babel

    Same year — the broader survey this piece sits inside. Tour de Babel is the breadth; the OCaml notes are the depth on one of its more surprising entries.