This is my favorite tweet about Real World OCaml.
Real World OCaml devotes an entire section of 5 chapters to the runtime system. That’s 5 chapters more than most language books. Refreshing
— keyist (@keyist)
It is indeed pretty rare for a language introduction to spend this much time on the runtime. One reason we included it in RWO is that OCaml’s simple and efficient runtime is one of its real strengths – it makes OCaml simple to reason about from a performance perspective, and simple to use in a wide variety of contexts. Also, critically, the runtime is also simple enough to explain! Even though it’s one of my favorite parts of the book, I had very little to do with it. Anil wrote most of it, with some critical help from Jeremy Yallop (who worked on the ctypes library featured in Chapter 22, and Stephen Weeks (whose notes formed the basis of Chapter 23 and Chapter 24).
In any case, if you’re interested in how OCaml represents values, how the C interface works, or how a simple generational GC works, you should check out Part III.