I recently spent three months at OCaml Labs in Cambridge, where I designed and implemented an ahead-of-time compiler from WebAssembly to native code by targeting the Cmm intermediate representation of the OCaml compiler. It was a really enjoyable project! In this post, I’ll give a brief introduction to WebAssembly and motivate the need for a native code compiler for WebAssembly in the first place,