OxCaml Basics
A three-hour course for Jane Street interns and engineers about safe high-performance OxCaml: checked stack allocation, control over runtime representation, and parallelism.
Each section page starts with the lecture notes and ends with the exercises. If you attended the lecture, jump straight to the exercises at the end of each page.
-
00
Why OxCaml exists
Why ordinary OCaml is not always enough for high-performance code, and which OxCaml features this course will cover.
-
01
Locality and stack allocation
How local values,
stack_, andexclave_help control heap allocation and lifetime. -
02
Value layouts and unboxing
Uniform OCaml values first, then the costs of boxes and pointers, then layouts, unboxed values,
or_null, and a short note on templates. -
03
Parallelism: contention and portability
How to run callbacks in parallel without data races when they receive explicit arguments or close over mutable state.
-
deck
Lecture slides
Slides for teaching the course, with OxCaml examples, exercises, and speaker notes.