3 ms·
> Beginner compiler writers don't need to know register allocation. They need to understand how to think about language translation, how to write an intermediat
by orthoxerox 6y ago
> Beginner compiler writers don't need to know register allocation. They need to understand how to think about language translation, how to write an intermediate representation, how to learn a target language.
I don't think people that want to write a compiler want to end up with helloworld.c instead of helloword.exe. At least I don't.
- hardwaregeek 6y agoAt least for me, compiling to a simpler target made learning the ideas easier. Compiling to to raw assembly does give you more nerd credit but it also makes it harder to get started.
- ajkjk 6y agoThe opposite, really. I started learning about compilers because I wanted to implement my own syntactic ideas. Don't care at all how it runs.
- orthoxerox 6y agoThat's what interpreters are great for.
- fooker 6y agoIdeally, you'd emit LLVM IR or some similar bytecode or assembly. Then you'd use llc/opt or an appropriate assmebler to get an executable. Trying to emit machine code isn't too interesting when you're writing your first compiler.
- CalChris 6y agoSimilarly, trying to parse C++ isn't too interesting when you're writing your first backend.
- bootwoot 6y agoThe creator of C++ would disagree, as C++ was devised as a compile-to-c language.