Spawn proposal strawman

Kris Kowal kris.kowal at cixar.com
Thu May 21 16:15:42 PDT 2009


>> kevin curtis wrote:
>>> Is a 'canonical' AST part of the plans for ecmascript 6/harmony.

> On May 9, 2009, at 9:19 AM, David-Sarah Hopwood wrote:
>> I hope so; that would be extremely useful. I would like to see an
>> ECMAScript source -> AST parser (as well as an AST evaluator) in the
>> Harmony standard library.

On Sat, May 9, 2009 at 11:57 AM, Brendan Eich <brendan at mozilla.com> wrote:
> We've wanted this since early in ES4 days. It would help many projects and
> experimental extensions (type checkers, template systems, macro processors,
> etc.) to have a standard AST, which could be serialized to JSON.

Other neat uses for the AST would potentially include comment scraping
for automated documentation tools and minification, which have their
own requirements beyond those for execution, optimization, and static
analysis.

Upon further reflection, I'm not sure that parse(program:String):AST
would serve the purpose of fast sandboxing.  The intent of splitting
parse and execute is to reduce the cost of execution, so that modules
can be reused in many small sandboxes.  Having parse produce a
(mutable) AST, and then leaving execute to translate the AST for the
interpreter might constrain our options for producing the desired
performance.  It might be better to have a compile() routine that
returns an opaque, engine-specific Program object that can in turn be
executed multiple times.

Kris Kowal


More information about the es-discuss mailing list