lua-users home
lua-l archive

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


On Thu, Jun 13, 2013 at 6:50 PM, Pierre-Yves Gérardy <pygy79@gmail.com> wrote:
On Thu, Jun 13, 2013 at 2:43 PM, Philippe Lhoste <PhiLho@gmx.net> wrote:
> lpegj seems interesting too (thanks!). LuLPeg might be more compatible and
> up-to-date.
> It can be fun to compare their respective speeds (if speed is a concern, of
> course).

LPegJ targets LPeg 0.10, while LuLPeg targets v0.12.


The changes in 0.11 and 0.12 were mostly in the new code generator, so most of the code that works with current LPEG should work with LPegJ. It has some of the same limitations of LuLPeg, though: it does not do most of the optimiations that LPEG does in its code generator.
 
The LuaJ metamethod limitation `p + 1` working, but `1 - p` not
working has been solved in the mean time, so I'd expect it to be,
compatible with the original.


This is great news!
 
It may be fun, for someone with the know-how, to write a backend for
LuLPeg that compiles patterns to Java bytecode.


In case anyone decides to do that, please use the LPEG VM instructions as the input, as a kind of JIT compiler for the LPEG VM, instead of compiling the patterns themselves. It should be easier, and allows reuse of the front-end and optimizer between the "jitted" and "non-jitted" version which is also useful for quick patterns that are run only once and in environments with restrictions on dynamic class loading. 

--
Fabio Mascarenhas