JavaScript parser API

Brendan Eich brendan at mozilla.com
Tue Jul 5 22:45:53 PDT 2011


On Jul 5, 2011, at 10:35 PM, Brendan Eich wrote:

> On Jul 5, 2011, at 9:00 PM, David Herman wrote:
> 
>> Mainstream production JS engines have moved away from parser generators.
> 
> Right, indeed most (all but JavaScriptCore, IINM) never used a parser generator in the first place. A great many industrial language implementations do not use generated parsers.

Some of the reasons for this include

* Hand-crafted parsers can be significantly faster than Bison or the like. Yes, I'm generalizing.
* Lack of parameterized productions (e.g. for "NoIn" vs. unsuffixed ECMA-262 nonterminals) requires significant duplication of sub-grammar productions and their semantic actions.
* Error recovery is usually better in hand-crafted parsers.

Oliver may have more to say -- he got rid of JavaScriptCore's Bison grammar, which dates back to KJS.

/be


More information about the es-discuss mailing list