[Top][All Lists]

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

Re: Make peg.el a built-in library?

From: tomas
Subject: Re: Make peg.el a built-in library?
Date: Tue, 8 Nov 2022 20:08:08 +0100

On Tue, Nov 08, 2022 at 08:18:15AM -0800, Eric Abrahamsen wrote:
> Ihor Radchenko <yantar92@posteo.net> writes:
> > Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> >
> >>> Is there any progress merging peg.el to Emacs?
> >>> I do not see any obvious blockers in the discussion, but the merge never
> >>> happened?


> > As the comment in peg.el states, the definitions are adapted from the
> > original PEG paper [...]

> This is what I was saying in my original message, though: if peg.el is
> going to go into core, it probably needs more/better docs than code
> comments and "read this paper". Its likely users will be Elisp library
> authors like me, who are just trying to free themselves from regexp hell
> and want a relatively straightforward alternative.

Yes. Coming from regexp they are deceivingly similar but frustratingly

The best way I found to wrap my head around them is that they are a
fancy notation for a recursive descent parser. Thus slightly more
powerful than regexps, but slightly less than a full YACC (i.e. LALR
or thereabouts).

What is attractive about them is that one can do "full" parsers
(as long as your grammar is roughly LL(k)) without having to build
two storey buildings. I guess it takes some practice, though (I

I think comparing them to treesitter is a category error.


Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]