3 ms·
Do you really need to cover everything in the first compiler you write from scratch or work on? Nothing stops you from starting with a language that makes some
by rdc12 10y ago
Do you really need to cover everything in the first compiler you write from scratch or work on?
Nothing stops you from starting with a language that makes some aspects simpler then average (such as Forth or Scheme), before working on a compiler for a language that does require such things.
Or the succinct version, learn to walk before you run.
- prestonbriggs 10y agoOf course not. But when you finish implementing Forth, you'll know how to implement forth, but not much else. But once you build a parser, you'll know how to build a parser for most any language. You don't have to learn every sort of parsing technique; I only use recursive descent. And once you learn for to do data-flow analysis, you'll find it applies whenever you want to write an optimizer. Same for various optimizations and code generation techniques. Indeed, I'd argue that Forth is best appreciated after you've worked on other compilers for a while. Then you have a basis to appreciate how clever it is.