[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] lua-inih v0.1
- From: Miles Bader <miles@...>
- Date: Mon, 27 Sep 2010 15:46:52 +0900
On Mon, Sep 27, 2010 at 3:29 PM, steve donovan
> On Mon, Sep 27, 2010 at 8:10 AM, Miles Bader <email@example.com> wrote:
>> "LPeg solution" is usually shorter, much easier to write and
>> understand, more precise, and a lot faster.
> Well, there has been a posted solution, which is pretty nifty, but I
> remain unconvinced.
> Perhaps because I'm not 'thinking' lpeg yet, but throwing a grammar at
> such a simple file format seems like overkill. If one was living and
> breathing PEGs, then perhaps 'easier to write and understand' is a
> true statement.
Perhaps you're right -- LPeg is not always the right choice, even if
it's often a good one -- but often even "simple" formats are more
complex than they might appear at first, and the handling of the picky
details can run afoul of Lua weaknesses like efficient low-level
(character-level) string handling (which then leads to taking
shortcuts, and ...).
[I did look at some net description of the init format earlier in this
thread, and it does have the usual bunch of little corners ...
escapes, quoting, yadayada. Of course they make the LPeg parser more
Cat is power. Cat is peace.