5 ms·
My compilers course in college was taught in OCaml. The first semester of the course was spent on teaching functional programming and OCaml and the second semes
by therein 8y ago
My compilers course in college was taught in OCaml. The first semester of the course was spent on teaching functional programming and OCaml and the second semester was spent on implementing a compiler that compiled a restricted subset of OCaml.
It is a pleasure to write a tokenizer and a lexer in OCaml.
- howenterprisey 8y agoDid you use parser combinators or what?
- nv-vn 8y agoI assume OCamllex and OCamlyacc (or the various other alternatives like Sedlex and Menhir). The OCaml standard distribution is very compiler-writing-oriented, so to speak, and comes with tools for parsing out of the box. A lot of newer projects use parser combinators, but there are far fewer examples of how to use them (like the plZoo) and most people are already familiar with lex/yacc, so I imagine most courses would choose to use those.
- therein 8y agoCorrect, good guess. :)