ICFP 2024
Mon 2 - Sat 7 September 2024 Milan, Italy
Sat 7 Sep 2024 10:07 - 10:30 at Orange 2 - OCaml compiler features and optimizations Chair(s): Stephen Dolan

This presentation concerns extending OCaml’s uniform value representation to allow some fields of a heap object to not themselves have the uniform value representation. We call such heap objects mixed blocks. The “mixed” suggests that some fields have the uniform value representation and some do not. The garbage collector must not scan those fields that do not, as it has no way to distinguish them from pointers that it must dereference. Mixed blocks are a departure from the current OCaml, which supports only uniform blocks: either all of the fields are scanned or none of the fields are scanned.

The main motivation for mixed blocks is performance. They allow you to store opaque data directly in a heap block alongside other data. This enjoys less indirection than the approach OCaml presently takes, which is to wrap opaque data in a dedicated heap block.

Jane Street also uses mixed blocks as a compilation strategy for structures containing unboxed types, like 64-bit floats.

An implementation of mixed blocks is available in Jane Street’s flambda-backend branch of the OCaml compiler. The approach we take sacrifices generic operations such as comparison.

Paper (ocaml2024-final12.pdf)330KiB

Sat 7 Sep

Displayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change

09:00 - 10:30
OCaml compiler features and optimizationsOCaml at Orange 2
Chair(s): Stephen Dolan Jane Street

Live stream: https://www.youtube.com/watch?v=OuQqblCxJ2Y

09:00
22m
Talk
On the design and implementation of Modular Explicitsin-person
OCaml
Samuel Vivien INRIA & École Normale Supérieure | Université PSL, Didier Rémy Inria
File Attached
09:22
22m
Talk
Flambda2 Validatorin-person
OCaml
Irene Yoon Inria, Chris Casinghino Jane Street
File Attached
09:45
22m
Talk
A Non-allocating Optionin-person
OCaml
File Attached
10:07
22m
Talk
Mixed Blocks: Storing More Fields Flatin-person
OCaml
Nicholas Roberts Jane Street
File Attached