3 ms·
http://t3x.org/subc/ http://t3x.org/subc/ is tiny and simple. But I'm supposed to say that!
by nils-m-holm 11y ago
http://t3x.org/subc/ http://t3x.org/subc/ is tiny and simple. But I'm supposed to say that!
- sitkack 11y agoIf you ported one of your excellent compiler books to Rust, I would buy it again, twice. Nils Holm, master compiler educator http://www.lulu.com/shop/search.ep?contributorId=740596 http://www.lulu.com/shop/search.ep?contributorId=740596
- sklogic 11y agoIt is nice and simple indeed but does not really show anything instructive in terms of backend, which is the focus of this thread. And once you go into SSA and proper isel, there is no way to do it both easily and compactly at the same time, passes must be split for simplicity or fused into a mess for a compactness. Of course, I am only talking about a number of lines of code, besides this you can keep your compiler totally trivial for any degree of optimisations complexity.
- nils-m-holm 11y agoIt does show you how to approach building a back-end in the first place, which I would consider to be quite instructive for someone who has never done it before. And it does separate the phases and still remains compact. Of course, once you have progressed to things like SSA, you might want to study something more complex. BTW, the current version of SubC has a much more interesting back-end and even uses AST-level optimization.