iconAnil Madhavapeddy, Professor of Planetary Computing

Holding an OxCaml tutorial at ICFP/SPLASH 2025 / Oct 2025

(This is part 2 of my ICFP25 series: see also 1. Chairing PROPL25, 3. OCaml 5 with Jane Street and Docker, 4. post-POSIX IO, 5. What I learnt)

Several extensions to "oxidize" OCaml (Rust performancew with ML ergonomics!) have been developing rapidly in a fork called OxCaml. I helped an intrepid crew from Jane Street, IIT-M, Tarides, Brown and Cambridge pull together a really fun tutorial in ICFP 2025 that you can try out too! TL;DR: Work through the online slides, try the activities, and take the quiz to give us feedback.

Just click on the tutorial repo to get an online environment
Just click on the tutorial repo to get an online environment

Where OxCaml came from

If you watch Yaron Minsky's talk about moving to OCaml 5, towards the end he discusses the language extensions Jane Street needs to eke out every ounce of performance while writing code in a safe, functional OCaml style. These extensions currently materialise in a forked version of the mainline OCaml compiler. Earlier in the year, a bunch of us from Cambridge and Tarides helped Jane Street get the first public release out the door, and to setup opam repositories and tutorials for this fork to be developed in the open.

An unruly crowd shove an oxidising compiler out the door on a hot summer day
An unruly crowd shove an oxidising compiler out the door on a hot summer day

Yaron Minsky summarised the OxCaml release thusly:

OxCaml's extensions make OCaml a better language for performance engineering. It also supports data race free parallel programming, and a bunch of other goodies.

OxCaml is in an interesting spot. It's an experimental language, whose extensions will change quickly and mercilessly.

But it's also a production quality compiler. Indeed it's the compiler we use in production everyday.

So why are we doing this? Our primary hope is to use this to build awareness about our work, and to help pave the way for getting these extensions upstreamed to mainline OCaml.

But we're also interested in building adoption among enthusiasts and researchers who don't mind working with a language that is changing quickly under their feet. We think there's a ton to learn from the collaboration. -- Yaron Minsky on BlueSky, June 2025

So the status in the summer of 2025 was that there existed an open source code drop of OxCaml, but it had a lot of rough edges and it would take some effort to make it usable outside of the walls of Jane Street.

Creating an OxCaml tutorial from outside Jane Street

The language extensions in OxCaml fall into three broad categories of features that:

Right now, all of these are all developed in the OxCaml monorepo by a growing number of developers within Jane Street. Without access to the internal Jane Street developer resources, KC Sivaramakrishnan and I started to work with Richard Eisenberg and Chris Casinghino to submit a tutorial proposal to ICFP; there's no better way to learn something than a deadline looming over our heads!

Writing the tutorial proved much more difficult than I'd expected, as OxCaml has a very large number of extensions (such as modes and kinds) that are not only evolving fast, but also sometimes interact differently in combination. It not only requires learning the compiler extensions, but also keeping up with the OxBase libraries that compose them into usable interfaces. KC Sivaramakrishnan and I struggled to pack in all the different concepts; I spent a whole weekend just attempting to get a parallel quicksort compiling!

Luckily, Richard Eisenberg had the idea to bring in experts in programming language pedagogy in the form of Shriram Krishnamurthi, Will Crichton and Gavin Gray to save the day. Gavin completely redesigned our slides to radically simplify the examples (beginning with a gensym rather than a sorting algortithm), and also designed a quiz to test user knowledge before and after. Max Slater, Megan Del Vecchio and Nadia Razek from Jane Street also leapt in to give us the inside line on new developments.

This collaboration made for a nice split in efforts; KC Sivaramakrishnan, Patrick Ferris and I focussed on the longer handson activity examples, while Gavin finished the Slipshow-based slides to deliver the presentation itself. I got a OxCaml GitHub DevContainer working that allowed participants to spin up a full OxCaml environment in just a few minutes, to ensure that as many people could participate during the conference as possible.

Of course we had to release a new compiler the night before... right?

Some excitement ensued when we realised that there hadn't been a public release of the OxCaml packages since our first public release earlier in the year! Meanwhile, hundreds of improvements had accumulated upstream, including a number of significant interface and type system changes. It seemed a little regressive to present an out-of-date version of the tutorial to a demanding ICFP audience.

So, in a late night call after we arrived in Singapore, with Diana Kalichenko working tirelessly on compilation fixes from New York, we refreshed all the tutorial examples and released the latest minus19 compiler version of the compiler with four months of developments! We fixed the compilation problems that resulted in our slides, and the new Devcontainer images finally rebuilt around 10 seconds before the tutorial started. No sweat.

Gavin, KC and me look to the heavens for inspiration to get the tutorial working
Gavin, KC and me look to the heavens for inspiration to get the tutorial working

The tutorial day arrives

The tutorial itself held at NUS went fantastically! Both sessions were completely full, with participants online as well (Edwin Torok in particular gave all of it a thorough spin on Discord, thanks!).

The broad sweep of audience feedback centred around stuff like this:

  • The interaction between portable and non-portable functions, which stemmed from a confusion around the fact that Base functions are annotated with modes, but the OCaml stdlib is not. The answer right now is to always use Base with OxCaml.
  • Whether exclaves can be used to allocate in the caller caller's region or not. Exclaves are transitive, which lets you build this.
  • What stops the Capsule API from leaking the access keys to outside the interface? The answer is that other modes (like local) work together to give safety to this aspect of the interface. It's difficult to only use one of the modes axes in isolation in a real interface.
  • Are OxCaml annotations erasable so that the programs are runnable using OCaml? Answer is "mostly erasable".
  • Are local and stack_ inferred? The compiler does this analysis by default and will locally allocate when possible, but it wasn't clear to the tutorial attendees that this is the case.

Full tutorial room at the NUS computing department with an engaged audience!
Full tutorial room at the NUS computing department with an engaged audience!

Should you use OxCaml right now?

The answer depends on if you want to get into compiler and language design or not! The number of mode axes in the OxCaml compiler are growing rapidly as more usecases are covered, so we'll clearly need to develop this tutorial further, and the "final form" of OxCaml is by no means stable yet. Jane Street iterates quickly on language changes since they control all the code in their monorepo that uses it, and have extensive production engineering infrastructure. From the outside, it'll be hard to keep a large codebase in sync... for now.

My high-level takeaway from discussions with the developers is that there's another 12-24 months of active language evolution left, so it'll continue to be a moving target for a while. But some features like locals have been around for longer than others features and are more stable. Knowing this really helps to plan out how I'm going to use OxCaml "from the outside".

It's also reassuring to see that Jane Street is serious about investing in education resources for the language as well. Yaron Minsky posts:

We've had an exciting couple of weeks full of opportunities to teach people about the exciting (and mildly bewildering) features of OxCaml. And...we're looking to hire an experienced educator to help us in this work. Please share this with anyone you think might be a good fit! -- Yaron Minsky on Bluesky, Oct 2025

There were a healthy contingent of Jane Street OxCaml developers to answer questions as well.
There were a healthy contingent of Jane Street OxCaml developers to answer questions as well.

If you want to have a go at the tutorial and quiz yourself, then it's all still open for participation! Follow the slides and then take the quiz. And most importantly, share your improbable stunts online so we can see what's going on. I'm hacking on a io_uring oxhttpserver myself, and I heard rumours that KC Sivaramakrishnan has been peering into the eBPF sources...

(This is part 2 of my ICFP25 series: see also 1. Chairing PROPL25, 3. OCaml 5 with Jane Street and Docker, 4. post-POSIX IO, 5. What I learnt)

# 6th Oct 2025 iconnotes icfp ocaml oxcaml programming tutorial

Related News