[erlang-questions] JavaScript compiler for Erlang

Patrick D. Logan patrickdlogan@REDACTED
Tue Jul 17 04:36:09 CEST 2007


Douglas Crockford (original author of the JSON format) has a chapter in Beautiful Code (his chapter is online at http://javascript.crockford.com/tdop/tdop.html) which develops a simple Pratt parser for a reasonable subset of javascript.

Crawford writes about javascript generally... 

"We don't have time in this short chapter to deal with the whole JavaScript language, and perhaps we wouldn't want to because the language is a mess. But it has some brilliant stuff in it that is well worth consideration. We will build a parser that can process Simplified JavaScript. We will write the parser in Simplified JavaScript. Simplified JavaScript is just the good stuff..."

So perhaps a Pratt parser in Erlang would be useful, if one doesn't exist yet. And so developing a parser for Simplified Javascript would be a good starting point.

Perhaps the implementation should stop at this subset, and so encourage it's widespread adoption just as Crawford stopped with the subset of Javascript data and called that "JSON"?



More information about the erlang-questions mailing list