3 ms·
Yeah. The OCaml compiler is just crazy fast. It's like Go, but with a super nice functional language. The compiler seems to be doing a heck of a lot of heavy-li
by christophilus 8y ago
Yeah. The OCaml compiler is just crazy fast. It's like Go, but with a super nice functional language. The compiler seems to be doing a heck of a lot of heavy-lifting in such a small amount of time. I'd be interested in a talk about how it manages that, if anyone knows of one.
- Aeolus98 8y agoA lot of the tooling speed comes from a couple places: 1. The compiler optimizations being applied to code - Things like GADT's are able to be allocated very efficiently - Can generate code that doesn't box at runtime (smash it into a pointer is done as well) - Pointers are word-aligned 2. The OCaml runtime - No JIT - No warmup - Can emit native code 3. The HM type system - Typecheckers for HM are really simple [1] [1] https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system#Algorithm_W https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_sy... This simplicity + the features of the compiler combine to make the OCaml compiler very fast, and very easy to write one (some undergrad CS classes do), and developer-time tenable to make both happen.