AST in JSON format

Kevin Curtis kevinc1846 at googlemail.com
Sat Oct 17 06:47:27 PDT 2009


DSH - very interesting.

Is the idea eventually (for say ES6) to have something like like the
Python ast module, where the AST (in JsonML format) can be executed?
Or just js source to source roundtripping. e.g js -> JsonML AST -> js

I'm working on an experiment utilizing the V8 engine - using the JSON
object as a (temporary) namespace:

var source = "var x = 3; if (x > 2) print('hello world');";

var astStr = JSON.AST.parse(source); // returns the AST in a JsonML string

JSON.AST.execute(astStr);

> hello world


More information about the es-discuss mailing list