[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: yet another pattern-matching library for Lua
- From: roberto@... (Roberto Ierusalimschy)
- Date: Mon, 8 Jan 2007 16:35:56 -0200
> Using the Microsoft compiler I get a ton of size conversion warnings.
> Most 'size_t' to 'int' type warnings and a few 'lua_Integer' to 'int'.
> Nothing critical but the rest of the Lua code compiles clean in this
> respect.
Most sizes are limited by the maximum size of a pattern (SHRT_MAX), so
I guess these conversions are safe. But (later) I will try to avoid
these warnings anyway.
> Doing some testing with very simple grammers I found them to be about
> twice as slow as the equivalent regular expression in Perl. I know
> this is still very early, can we expect performance inprovements or is
> this about as fast as it gets?
I guess Mike already answered this. Just for emphasis: (1) I am not
worried about winning benchmarks (at least for now); now what I need
is "good enough" performance. (2) PEGs are very procedural, so it is
possible to do a lot of optimizations in the parse expression (if
really needed). (One thing Mike did not comment: if you really face
a performance problem in your application, it is easy to integrate
user-defined patterns written in C in LPeg. Maybe in the future we can
provide some proven useful primitives, such as Snobol's 'span' and
'break' [more or less C's 'strspn' and the like.)
> I think an interesting extra addition to this library would be a
> grammer that can parse "normal" PEG grammers from a string into a LPeg
> grammer.
Have you seen re.lua?
-- Roberto