3 ms·
I like these kind of fun projects! I wrote a very small but complete compiler and VM for a very simple language: boolean expressions. I use it as a "what to ex
by p4bl0 1y ago
I like these kind of fun projects!
I wrote a very small but complete compiler and VM for a very simple language: boolean expressions. I use it as a "what to expect" type of introduction during the first session of my compiler course.
The whole code is here, it is less than 150 lines of OCaml code (plus a few lines of C for the VM) and uses standard parsing tools:
https://gist.github.com/p4bl0-/9f4e950e6c06fbba7e168097d89b0e46 https://gist.github.com/p4bl0-/9f4e950e6c06fbba7e168097d89b0...