Tarides Logo
A camel is lying down among some shrubs with its baby standing next to it. The baby is white with big brown spots, sort of like a cow.

Introducing Jane Street's OxCaml Branch!

Cuihtlauac Alvarado

Senior Software Engineer

Isabella Leandersson

Communications Officer

Posted on Wed, 09 Jul 2025

Jane Street is a well-known OCaml powerhouse. They have a reputation for expertise and a long history of supporting the open-source community. Jane Street have been developing experimental features on a branch of OCaml, using them in production internally, and preparing them to be shared with the rest of the ecosystem. These extensions are now bundled and distributed together under the name OxCaml.

We are always excited about projects that bring new features to OCaml and improve it for its users. This post will give you an overview of the different features being developed under the OxCaml umbrella and how Tarides is collaborating with Jane Street on the project.

What is OxCaml

OxCaml is an open-source branch of OCaml that incorporates several extensions designed to help write multicore and high-performance OCaml code.

Jane Street relies on OCaml’s sweet spot. OCaml lets you write code quickly, code that is performant, code that solves complex problems, and code that can be trusted, thanks to its strong focus on correctness-by-construction. However, like any language, OCaml has its limits. When writing low-latency code, you'd like the garbage collector not to kick in at inopportune moments. While this may seem like a niche use case, it is a niche that matters to Jane Street.

With OCaml 5, OCaml code can exploit shared-memory parallelism. Shared-memory parallel programming also leads to data races. Because noticing and debugging data races is difficult, code review isn’t sufficient to trust multicore code in mission-critical contexts. OxCaml extensions have three main goals:

  1. Enable writing correct-by-construction multicore code;
  2. Enable writing low-latency code in OCaml instead of a GC-free language;
  3. Raise the overall level of performance.

Last but not least, all those goals should be achieved without moving OCaml away from its sweet spot.

Furthermore, according to its website, OxCaml’s primary design goals are to be “safe, convenient, [and] predictable”. Safety makes developers more productive and ensures they ship correct code. Convenience means using OCaml’s type system and type inference to provide adequate choice and control without adding complexity. Predictability involves retaining the aspects of OCaml that make it easy for developers to understand how their code will perform simply by looking at it, which requires keeping performance details explicit at the type level.

The OxCaml branch is open-source and welcomes new users. However, the extensions are experimental and not guaranteed to be stable or backwards compatible. Your feedback is needed to fine-tune the experience and improve the various new features. You can provide feedback by making issues on the OxCaml GitHub repo or discuss it in the #oxcaml channel in the OCaml community discord server.

Open-source tools and libraries provided by Jane Street now come in two flavours. The default targets classic OCaml. The with-extensions branch targets OxCaml. For instance, Jane Street's successful Base library has a with-extensions branch. Jane Street also provides an opam repository with OxCaml compatibility patched versions of the packages.

How Tarides is Helping

Tarides takes part in the processes around OxCaml in two ways: by providing platform support for working with and distributing OxCaml code, and by helping to upstream some of its features into mainline OCaml.

Tarides has adapted OxCaml features to the official compiler codebase and taken part in design discussions with the OCaml maintainers to ensure that the features integrate well into the existing compiler. Sometimes, the upstream compiler will have features that OxCaml doesn’t have yet, which overlap with OxCaml’s extensions, so care is needed to handle everything as seamlessly as possible and in a backwards-compatible way.

The OCaml 5.4 features labelled tuples and immutable arrays are two recent examples which have been upstreamed from OxCaml with Tarides’s assistance. For future releases, Tarides will be part of the design discussions for upstreaming new features, like "include functor", polymorphic parameters, module strengthening, and possibly more.

Experimental Extensions

Let’s take a look at the different extensions that are part of OxCaml:

  • Modes: Modes are deep properties of values that are tracked by the OxCaml compiler. They are similar but distinct from types. While types describe what a value is, modes describe how they can be used. Each value in OxCaml has a mode (plus its type). OxCaml permits type signatures to be decorated with modes, restricting how that value may be used. As an example, the linear modality on a function says that the function may be invoked at-most-once. This property is distinct from the type of the function.
  • Stack Allocations: With OxCaml, more values can be allocated on the stack instead of on the heap, which improves performance by reusing cache lines and reducing the cache footprint. The compiler uses a value’s locality to determine whether it is local and, therefore, can be allocated on the stack or global and needs to go on the heap.
  • Unboxed Types: This extension gives users more options on how their data is represented in memory and registers. Unboxed types introduce the concept of layouts. Every type has a layout, with a number of base layouts available to the type system.
  • Data-Race-Free Parallelism: There are a number of new features centred on OCaml’s support for multiple domains, including extending the mode system to track the concurrent use of values to improve safety during concurrency and introducing higher-level parallelism primitives.
  • Kinds: This adds a new system that extends the type system by adding “types” to types, that's what a kind is, a type's “type”. Two words are used to avoid confusion, as kinds don't have allocated values at runtime; only types do. Kinds have several components, among them layout, which describes the shape of the data at runtime and modal bounds, which assign limits on the mode's value may be assigned to.
  • Uniqueness: A mode that designates values that should only have a single reference pointing to them. By guaranteeing that only one reference will be consumed, the mode prevents bugs like the use-after-free segfault. There’s a Jane Street blog post, as well as a post by KC Sivaramakrishnan about using Uniqueness and its features.
  • Comprehensions: This extension introduces ‘comprehensions’, which is a syntactic form that uses mathematical set-builder notation to build lists and arrays.
  • Other Extensions: There are several more smaller extensions as part of OxCaml. These include immutable arrays, labelled tuples, polymorphic parameters, and more!

Looking to the Future

In light of the public release, we encourage OCaml users to try OxCaml and share their feedback. The best place to discuss OxCaml is the #oxcaml channel on the OCaml community discord server. Engineers from Jane Street and Tarides working on OxCaml regularly hang out in the channel and would be delighted to hear feedback.

The explicit goal of OxCaml is to iterate over these features and eventually upstream them to OCaml. Tarides has experience shepherding and successfully upstreaming Multicore OCaml, which was a multi-year effort to bring in native support for concurrency and parallelism to OCaml. Just as with Multicore OCaml, Tarides' goal is to make it easy for the community to work with OxCaml, gather feedback, iterate on the design with Jane Street engineers and help upstream the features to OCaml over the coming years. If we are successful with the upstreaming efforts, we believe that OCaml will fill an important gap in the design space for programming languages. We would like you to be part of this effort!

Stay in Touch

You can connect with us on Bluesky, Mastodon, Threads, and LinkedIn or sign up for our mailing list to stay updated on our latest projects. We look forward to hearing from you!

Open-Source Development

Tarides champions open-source development. We create and maintain key features of the OCaml language in collaboration with the OCaml community. To learn more about how you can support our open-source work, discover our page on GitHub.

Explore Commercial Opportunities

We are always happy to discuss commercial opportunities around OCaml. We provide core services, including training, tailor-made tools, and secure solutions. Tarides can help your teams realise their vision