Hacker News new | ask | show | jobs
by Peaker 3938 days ago
I think the greatest features of the ML family for compiler development are great AST representations (as algebraic data types) with pattern-matching. When you change the AST, it is very easy to go and fix all the AST transformations to handle less/more cases or fix the types.

There are other great features for compiler development in the ML family, but almost all of them revolve around static types.

Can you explain what you mean when you say Lisp is excellent for compiler development? When changing the AST, how would you go about changing all the code that needs to be changed?

1 comments

ML got ADTs and pattern matching out of the box. Fine. With Lisp you can quickly build your own ADTs, with some enhanced functionality which is not possible in *ML family.

See a couple of examples of this:

[1] http://www.cs.indiana.edu/~dyb/pubs/nano-jfp.pdf

[2] https://github.com/combinatorylogic/mbase

> > When changing the AST, how would you go about changing all the code that needs to be changed?

Is there an answer to this question?

Have you seen Nanopass or MBase? They address this very question.