5 ms·
I take your point as well. I guess I'm coming at this as a novice with a recent interest in compilers. I was working through a tutorial series for writing a co
by dcw303 11y ago
I take your point as well.
I guess I'm coming at this as a novice with a recent interest in compilers. I was working through a tutorial series for writing a compiler in Go, but it got frustrating when I realized the author's example language wasn't going to output anything lower than C.
I've since found a series that does show how to output to assembly (68000 no less) and I'm finding it much more rewarding.
- majewsky 11y agoI see the educational value in building a compiler to C if you want to introduce people to parsing, AST transformations, visitor pattern etc. But a lot of interesting parts about a compiler are lost when you compile to a high-level language instead of machine code: code selection (to a large extent), register allocation, operation scheduling. Doing a compiler backend right is much more challenging than doing a compiler frontend right, which is why tutorials usually skip it, and also why people are so grateful for LLVM, which gives a common compiler backend for about every platform imaginable.
- chrisseaton 11y agoRight - all these compiler tutorials, and many compiler textbooks are about the front-end only. The back-end is where all the fun and magic is.
- doom2 11y agoDo you mind linking to the other resource you're using? The one outputting to assembly.