4 ms·
Sometimes i wish for compiler tutorials that progress feature by feature, starting with simple features, rather than starting with complicated things like parsi
by naveen99 10y ago
Sometimes i wish for compiler tutorials that progress feature by feature, starting with simple features, rather than starting with complicated things like parsing expressions with multiple op codes (op codes being implemented as function calls, so it gets even more complicated)...
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.
- Flow 10y agoSomething like this? https://youtube.com/watch?v=CqhL-BDT8lg https://youtube.com/watch?v=CqhL-BDT8lg
- segmondy 10y agoYou are looking for this, "let's build a compiler" http://www.stack.nl/~marcov/compiler.pdf http://www.stack.nl/~marcov/compiler.pdf
- naveen99 10y agonot exactly. more like an expanded version of chapter 5 of sicp https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-31.html 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.