3 ms·
This is a small nitpick but the line: "OCaml's compiler is pretty unique, it's a set of pluggable parts that can be replaced and used together." is inaccurate.
by RubenSandwich 9y ago
This is a small nitpick but the line: "OCaml's compiler is pretty unique, it's a set of pluggable parts that can be replaced and used together." is inaccurate. Most modern compilers are broken up into backends and frontends now, e.g. LLVM, JVM, .NET, etc.
- thangngoc89 9y agoHey author here, I'll look into this and update the post accordingly. Thank you
- RubenSandwich 9y agoNo problem. Thanks for documenting the ReasonML toolchain and how it relates to OCaml.
- pjmlp 9y agoAs an example of such architecture already in the 70's. PL/8, used by IBM for doing their RISC research. An Overview of the PL.8 Compiler (1982) http://rsim.cs.illinois.edu/arch/qual_papers/compilers/auslander82.pdf http://rsim.cs.illinois.edu/arch/qual_papers/compilers/ausla...
- nv-vn 9y agoIs the OCaml compiler really the same as those others though? I'd say it's more complex than that. It has a very large middle-end that most compilers don't. Things that are pluggable so far: - Lexing/Parsing (ReasonML) - Preprocessing (PPX) - Backend (BuckleScript/js_of_ocaml) Other parts of the compiler (not as pluggable?): - Typechecking (which is really what makes it OCaml; TyPpx allows some changes) - Semantics (can be overridden with PPX somewhat) - Optimizations/middle passes (things like Flambda)