On Tue, Nov 08, 2022 at 08:18:15AM -0800, Eric Abrahamsen wrote: > Ihor Radchenko writes: > > > Eric Abrahamsen 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 different. 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 haven't). I think comparing them to treesitter is a category error. Cheers -- t