http://www.tedinski.com/2018/03/13/how-compilers-are-designed.html
https://news.ycombinator.com/item?id=16600486
blog-post-what-can-we-learn-from-compilers#pipeline-segmentation-by-data1 2We can completely segment one component of the compiler from another by having the right form of data structure in between them blog-post-what-can-we-learn-from-compilers#pipeline-segmentation-by-data1 2
blog-post-what-can-we-learn-from-compilers#what-the-data-means1 2To build that data structure, you don't need to know anything that happens to it afterwards, you just need to know what it means blog-post-what-can-we-learn-from-compilers#what-the-data-means1 2
blog-post-what-can-we-learn-from-compilers#associative-composition1One of the nice things about pipelines is the composition operator is associative: we can take a series of transformations and pretend they're just one big transformation blog-post-what-can-we-learn-from-compilers#associative-composition1
blog-post-what-can-we-learn-from-compilers#intermediate-representations1It doesn't explain why we're so incredibly enamored with creating more IRs. blog-post-what-can-we-learn-from-compilers#intermediate-representations1
blog-post-what-can-we-learn-from-compilers#loose-coupling-representational-details1 2we're achieving loose coupling between components by exposing a data schema, publicly committing to all its representational details. Nothing is encapsulated at all blog-post-what-can-we-learn-from-compilers#loose-coupling-representational-details1 2
blog-post-what-can-we-learn-from-compilers#why-separation-and-unidirectional1All that goes to hell as soon as you back-feed outputs of a later stage into inputs of an earlier stage. Now you have one monolithic block of code where you've semi-pointlessly drawn some boxes inside of it to pretend like it's modular like the rest of the pipeline, but it's not. You can't understand it without understanding the whole thing blog-post-what-can-we-learn-from-compilers#why-separation-and-unidirectional1
blog-post-what-can-we-learn-from-compilers#not-enough-context-propagated1If you've ever tried to use a lexer & parser generator, you've probably gotten an error message like Syntax error and marveled at how it manages to not even have any clue where the syntax error was, much less what the darned problem is. What we're suffering from here is over-abstraction making things harder for ourselves blog-post-what-can-we-learn-from-compilers#not-enough-context-propagated1
One of the hacker news comments points to blog-post-from-ast-to-lossless-syntax-tree
References paper-context-aware-scanning