lua-users home
lua-l archive

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

Apologies, I more meant that LPeg could be *shipped with* Lua, but as an external module. It's an incredibly useful module and shipping it along with Lua would make it more accessible (instead of requiring luarocks, a custom compilation, or otherwise).

On Sun, Oct 22, 2017, 1:08 PM Gavin Wraith <> wrote:
In message <>
          Dirk Laurie <> wrote:

> Put another way: the issue is not what can you do with LPeg, it is
> what can you do that you can't do with Lua patterns, and whether
> that extra is sufficiently common to justify adding LPeg to Lua.

That seems sensible to me. I have tried dipping my toe into Lpeg
but I have found it quite hard - particularly to incorporate
error handling. It reminded me of my superficial struggles with
Haskell. The abstractness of its approach is very appealing,
though. One cannot help feeling that there is something very
right and natural about it.

On a slightly different tack, what I would find useful is an
extension of the Lua string library to ropes, i.e. trees
whose leaves are strings. The implementation of strings in Lua
makes string comparison cheap and string manipulation
expensive. When results are written out to file, ropes have
an algorithmic advantage in this respect. A project for
somebody younger than me: to formulate good algorithms for
pattern matching and catching data in ropes?
Gavin Wraith (
Home page:

Ryan | Charles <>
Software Developer / System Administrator