lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Nice work.  I'm not sure where I'd use this, but I'm glad that hand-written parsers can be faster than jison generated parsers.  I'm considering writing a recursive descent parser *in* my new jack language so it can be self hosted and emit either lua or js during the code generation stage.


On Mon, Feb 25, 2013 at 10:32 AM, Oskar Schöldström <public@oxy.fi> wrote:
I've written a recursive descent Lua parser in _javascript_,
http://oxyc.github.com/luaparse/. This was done for my bachelor's thesis
and I'm planning to continue working on it to to add some missing
features.

The implementation has put a lot of focus on performance, currently it
parses 5000 syntax nodes (1200 SLOC) in ~2ms with Node.js. In contrast a
simple parser generated by Jison (http://zaach.github.com/jison/) parses
the same code in ~110ms. I also benchmarked the Jison parser using my
own lexer, putting it at ~50ms.

Essential features that are currently missing but hopefully coming soon:
- Tolerant error handling
- Location tracking

I hope someone can find use of this.

--
Oskar Schöldström