3 ms·
feature set looks very similar to https://github.com/SAP/chevrotain https://github.com/SAP/chevrotain would be good to have a comparison EDIT: actually there
by leeoniya 10y ago
feature set looks very similar to https://github.com/SAP/chevrotain https://github.com/SAP/chevrotain
would be good to have a comparison
EDIT: actually there is one [1], and it includes Nearley which does quite poorly.
[1] http://sap.github.io/chevrotain/performance/ http://sap.github.io/chevrotain/performance/
- FlorianRappl 10y agoThanks for the link! I am not sure though if performance should be the key metric here. Of course, it all depends on the details and use case, but in general correctness and extensibility should be more important in most scenarios.
- matheusmoreira 10y agoThe difference in performance is explained by the capabilities of the algorithms used by each parser library. The Earley algorithm can parse any context-free grammar while Chevrotain appears to be restricted to the LL(k) class of grammars. Earley is O(n³) in the worst case but it performs better with more restricted classes of context-free grammars. Even if given the same grammar, Earley will still incur the cost of generality, a cost which LL(k) parsers don't have to pay.
- leeoniya 10y agoOkay, do you have a non-contrived, practical example that can be handled by Nearley but not LL(k)? It also doesn't help that linear LL(k) performance/optimizations is the first feature listed.