Sugar

Yuh-Ruey Chen maian330 at gmail.com
Tue Sep 2 23:24:14 PDT 2008


Ok, it really does sound like a hygienic macro system for |x(y) {...}|
and |x {...}| statements and expressions. Call it what you want, those
are definitely a type of macro. Since I like hygienic macros, I'm pretty
sympathetic to them.

However, ES-Harmony shouldn't introduce anything either not tested in
other languages or extensively researched in academia. I would place
hygienic macros for procedural languages in that category. Maybe we
ought to look in existing research papers for some inspiration:
http://scholar.google.com/scholar?hl=en&lr=&safe=off&q=hygienic+macro+procedural&btnG=Search
<http://scholar.google.com/scholar?hl=en&lr=&safe=off&q=hygienic+macro+procedural&btnG=Search>

Some macros, like the until loop you've shown as an example, can create
new control abstractions, which in turn should generally satisfy
Tennent's correspondence. That is, the statements/blocks contained
within the control abstraction should inherit |this|, |arguments|, |var|
scope, return/continue/break continuations, etc. I've proposed a
Ruby-like block proposal for this, which I consider a bit less radical
because a similar language has them (Ruby), but I've already found a
couple flaws in that proposal, which I may or may not elaborate on if I
have the time.

My point is that I don't think these proposals are ready for ES-Harmony
yet. We don't want to implement a feature, and later realize that we
could've done it better but doing so would now be
backwards-incompatible. Let's defer them to a future ES version, once
they've been discussed, researched, and tested thoroughly. Or even
better, make your own language and interpreter to test your ideas out.
I'm already tempted to do so :)

-Yuh-Ruey


More information about the Es-discuss mailing list