News for hackers. Stuff that matters.
Re:Show HN: Writing my first interpreter in C for fun by naveen99 on Wednesday June 22, 2016 @09:49AM (#11953851)
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.

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.

Re:Show HN: Writing my first interpreter in C for fun by Flow on Wednesday June 22, 2016 @04:11PM (#11956611)