Is ES3 good enough? Was incrementally strengthening ES3 paradigms considered?

Dave Herman dherman at ccs.neu.edu
Tue Nov 13 11:04:42 PST 2007


> Could the Scheme aspect of ES be strengthened? Tail recursion and let
> statements seem like good additions. What about macros? Please!

I can speak to the topic of macros. The group has been open to the 
possibility of macros for a future version of ES, but not Edition 4. 
There are not very many languages with non-Lisp syntax that have come 
close to the power of Lisp/Scheme macros. CPP is distinctly *not* an 
inspiration! :) Dylan may provide some inspiration, and possibly Boo and 
Nemerle, though I have to learn more about these languages.

JavaScript's complicated syntax makes macros very tricky. Contrary to 
the popular view that parsing is a wholly solved problem in CS, moving 
Lisp-style macros out of the domain of S-expressions and into 
token-based syntaxes is far trickier than you might first suspect.

Hygiene is another important desideratum; scaling up C macros to be 
closer to the power of Lisp macros means dealing with the kinds of bugs 
that arise from name clashes[*]. Automatically hygienic systems 
generally "do the right thing" but there are a number of different 
algorithms to choose from, and as Brendan says the last word about 
hygiene has not been written (this is in fact the topic of my 
dissertation work). However, the theory doesn't have to be set in stone 
for the practice to proceed, and there are plenty of excellent, working 
Scheme implementations with fantastic macro systems that have been 
around for many years. There's lots of good inspiration to draw from.

So the short answer to your question is: maybe, but not yet. :)

Dave

[*] These problems don't arise in standard C, but with e.g. the GCC 
extensions to CPP you can easily cause these kinds of name capture.



More information about the Es4-discuss mailing list