2005-06-19 · in Ideas · 129 words

(This was originally Peter Welch's idea.)

When building a nanopass compiler, you're applying many transformation steps to an abstract syntax tree. If we were doing this in occam, the approach looks fairly straightforward: just have our nanopasses be processes, and connect them together in a chain. However, representing the AST would be interesting: you could do it as a conventional data structure (using nested mobiles), but it'd be far more interesting to have the AST elements be active processes, connected to each other in a way mimicing the tree structure. You could then manipulate the tree by sending commands to processes, search the tree by sending a request in at the root and having it pass you back mobile channels connected to processes inside the tree, and so on.