Re:Show HN: Writing my first interpreter in C for fun
by segmondy on Wednesday June 22, 2016 @05:06PM
(#11957031)
You are looking for this, "let's build a compiler" http://www.stack.nl/~marcov/compiler.pdf
Re:Show HN: Writing my first interpreter in C for fun
by naveen99 on Thursday June 23, 2016 @09:11AM
(#11960571)
not exactly. more like an expanded version of chapter 5 of sicp https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-31.htm...
I will put it on github if i ever get around to writing one myself.
I am thinking something targeting / including a toy version of qemu.
For example, a sequence like this:
1. variable assignment
2. commands of one parameter
3. if / branch statements
4. much later: nested expressions, function calls, multiple stacks, environments
basically, starting with an abstraction of 3 parameter opcodes, and then slowly building features up the abstraction layers, as well as slowly building down the optimization layers, step by step.