Ask HN: What makes OCaml so desired for writing compilers?
From what I understand, the original Rust compiler as well as Facebook's current Hack PHP compiler were written in OCaml. There are several static, functional languages out there, what makes OCaml more suited than other languages for compiler design and implementation? What are the features desired for writing a compiler?
4 comments
[ 3.5 ms ] story [ 23.1 ms ] threadMany school courses use ML/OCaml as well in their classes and as you do the course they explain why OCaml/ML is best suited for what's going on https://www.cs.cmu.edu/~fp/courses/15411-f13/schedule.html
Nowadays there are a lot of options that would be just as good, or better.
Would like to know what you think they are, because new efforts by major companies are still using OCaml for lots of things, including the design and and implementation of new languages.
One thing I didn't think about, though, was portability: https://ocaml.org/learn/portability.html
So I'm guessing Swift isn't there yet, and Scala has the ick of a JVM -- it looks like OCaml is easier to get going on a new platform if you have a C compiler.