newsfilter
← Interviews
Jane Street15 min

Understanding OCaml Locals as a Mode (with Sub-Moding) | OCaml Unboxed

I

Tutorial

This presentation introduces local and global modes in OCaml as a type system extension that governs memory lifetime and escape properties rather than value structure. The speaker details how these modes enforce safety by preventing local values from escaping their declaration scope while establishing a sub-mode relationship where global values can safely be treated as local. Additionally, the talk outlines four distinct, incompatible function arrow types that strictly regulate argument and result modes to prevent unintended memory escapes, with future work proposed to automate these annotations.