[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lpeg as a part of lua (was: An introduction to Lua)
- From: Charles Heywood <vandor2012@...>
- Date: Sun, 22 Oct 2017 18:10:30 +0000
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).
In message <CABcj=tnFooWJuyc2SpWsOHCf7Rp7exhf7UTDYri0Bk9WjVxfSw@mail.gmail.com>
Dirk Laurie <email@example.com> 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 (firstname.lastname@example.org)
Home page: http://www.wra1th.plus.com/