Re: Efficient string parsing

  • From: rostislav.sacek@xxxxxxxxxxx
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 24 Oct 2012 20:54:16 +0200

> Perhaps porting LPeg to a pure Lua(JIT/FFI) implementation? It's one C
> file, 2000 loc but a lot of that is Lua/C API.
>
> I don't know if it will run faster or slower in LuaJIT, but it would
> remove the extra library dependency.
>
> LPeg is powerful and heavily used, so if a pure LuaJIT port is faster,
> this would be a great general purpose contribution.
>
> On Oct 23, 2012, at 3:15 PM, Wolfgang Pupp wrote:
>

I created LPeg port in pure Luajit. This version is rewrited from C
LPeg(v. 0.10.2).
For preparing patterns is needed original LPeg, but this patterns can
be saved or loaded and Luajit version can use them without original LPeg.
This version passes all LPeg standard tests (lpegtest.lua).
Version is slower than C  LPeg (depends on type of patterns), but I didn't
optimalize this version yet.
I have no capacity continue work on this now. If somebody want work with
this, I can send this version to him.
Version in luajit has 831 loc and implements all LPeg feature except
patern generation
and optimalization.

Rostislav Sacek


Other related posts: