The OCaml system, release 5.4

The OCaml system
release 5.4
Documentation and user’s manual
Xavier Leroy,
Damien Doligez, Alain Frisch, Jacques Garrigue,
Didier Rémy, KC Sivaramakrishnan and Jérôme Vouillon
18thFebruary, 2026
Copyright © 2026 Institut National de Recherche en Informatique et en Automatique
This manual is also available in PDF, plain text, as a bundle of HTML files, and as a bundle of Emacs Info files.

- Contents
- Foreword

# Part I An introduction to OCaml

- Chapter 1 The core language
- Chapter 2 The module system
- Chapter 3 Objects in OCaml
- Chapter 4 Labeled arguments
- Chapter 5 Polymorphic variants
- Chapter 6 Polymorphism and its limitations
- Chapter 7 Generalized algebraic datatypes
- Chapter 8 Advanced examples with classes and modules
- Chapter 9 Parallel programming
- Chapter 10 Memory model: The hard bits

# Part II The OCaml language

- Chapter 11 The OCaml language
- Chapter 12 Language extensions

# Part III The OCaml tools

- Chapter 13 Batch compilation (ocamlc)
- Chapter 14 The toplevel system or REPL (ocaml)
- Chapter 15 The runtime system (ocamlrun)
- Chapter 16 Native-code compilation (ocamlopt)
- Chapter 17 Lexer and parser generators (ocamllex, ocamlyacc)
- Chapter 18 Dependency generator (ocamldep)
- Chapter 19 The documentation generator (ocamldoc)
- Chapter 20 The debugger (ocamldebug)
- Chapter 21 Native debugging (gdb, lldb)
- Chapter 22 Profiling (ocamlprof, perf)
- Chapter 23 Interfacing C with OCaml
- Chapter 24 Optimisation with Flambda
- Chapter 25 Fuzzing with afl-fuzz
- Chapter 26 Runtime tracing with runtime events
- Chapter 27 The “Tail Modulo Constructor” program transformation
- Chapter 28 Runtime detection of data races with ThreadSanitizer

# Part IV The OCaml library

- Chapter 29 The core library
- Chapter 30 The standard library
- Chapter 31 The compiler front-end
- Chapter 32 The unix library: Unix system calls
- Chapter 33 The str library: regular expressions and string processing
- Chapter 34 The runtime_events library
- Chapter 35 The threads library
- Chapter 36 The dynlink library: dynamic loading and linking of object files
- Chapter 37 Recently removed or moved libraries (Graphics, Bigarray, Num, LablTk)

# Part V Indexes

- Index of modules
- Index of module types
- Index of types
- Index of exceptions
- Index of values

- Index of keywords

> This document was translated from LATEX by HEVEA.