<story><title>Resources for Amateur Compiler Writers</title><url>https://c9x.me/compile/bib/</url></story><parent_chain><item><author>hardwaregeek</author><text>This is definitely a backend, machine code focused list. If you&amp;#x27;re writing a compiler to WebAssembly or even the JVM you&amp;#x27;re probably not gonna need a lot of these resources.&lt;p&gt;Indeed I&amp;#x27;d argue that these lists are more for an intermediate compiler writer. Beginner compiler writers don&amp;#x27;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.&lt;p&gt;I&amp;#x27;ve been toying with the idea of writing a post that goes through the thought process of translation. Specifically, how you build states, and invariants. When I write code generation I spend time thinking about the different states the stack could be in, or what invariant I need to keep across this expression (do I need to save a register or global?).&lt;p&gt;One simple but important example of this is realizing that given a proper, sound type checker, your code generator should almost never give errors. By the time you reach code generation you should have proven enough invariants that code generation cannot fail. This isn&amp;#x27;t always true but I&amp;#x27;ve found it to be the case.</text></item></parent_chain><comment><author>jstanley</author><text>&amp;gt; Indeed I&amp;#x27;d argue that these lists are more for an intermediate compiler writer. Beginner compiler writers don&amp;#x27;t need to know register allocation.&lt;p&gt;I&amp;#x27;m not disagreeing with you, but note that the title does not say it&amp;#x27;s for beginners, it says it&amp;#x27;s for amateurs, which is just anyone who does it for fun rather than money.</text></comment>
<story><title>Resources for Amateur Compiler Writers</title><url>https://c9x.me/compile/bib/</url></story><parent_chain><item><author>hardwaregeek</author><text>This is definitely a backend, machine code focused list. If you&amp;#x27;re writing a compiler to WebAssembly or even the JVM you&amp;#x27;re probably not gonna need a lot of these resources.&lt;p&gt;Indeed I&amp;#x27;d argue that these lists are more for an intermediate compiler writer. Beginner compiler writers don&amp;#x27;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.&lt;p&gt;I&amp;#x27;ve been toying with the idea of writing a post that goes through the thought process of translation. Specifically, how you build states, and invariants. When I write code generation I spend time thinking about the different states the stack could be in, or what invariant I need to keep across this expression (do I need to save a register or global?).&lt;p&gt;One simple but important example of this is realizing that given a proper, sound type checker, your code generator should almost never give errors. By the time you reach code generation you should have proven enough invariants that code generation cannot fail. This isn&amp;#x27;t always true but I&amp;#x27;ve found it to be the case.</text></item></parent_chain><comment><author>orthoxerox</author><text>&amp;gt; Beginner compiler writers don&amp;#x27;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.&lt;p&gt;I don&amp;#x27;t think people that want to write a compiler want to end up with helloworld.c instead of helloword.exe. At least I don&amp;#x27;t.</text></comment>