I got lost when he showed his 21 pass sample compiler.
It’s not clear how he figured out what the passes should be, nor what order was best.
I don’t think he was trying to focus on which specific steps to do in which order, but more the whole idea of using little tiny (nano) passes to do compilation.
That said, I sure would like more details. I spent most of the day trying to find more lectures/books/courses on using scheme for building compilers. I’ve played around a little with trying to build toy language compilers in clojure (actually more like clojure data-structure compilers) using LLVM, but that’s not the same thing. I’d like to learn more about the types of optimizations he was talking about and how to use that toolkit.
I’ve only found a few good resources so far and no lectures:
I don’t think he was trying to focus on which specific steps to do in which order
I don’t either. But it seems (to me) to be a difficult area with this idea. Sure, if you can figure out a bunch of nano-passes, that probably is a good design. But what process do you use to identify each pass?
Good list of links.
I think each pass represented a small change in code, like adding a return statement to make it look more like C (i.e. (return foo) ). Then each pass would grow organically from what he needs, hence the order.
As to what exactly each pass should contain, that would be more specific to the compiler/optimizations you’d be building.