Let's stop parser Hell

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Jul 5 11:28:21 PDT 2012


On 7/5/12 2:16 PM, Philippe Sigaud wrote:
> As much as I'm flattered by that, my current impression is Pegged is
> very far from being performant.
>
> As a proof-of-concept that, in D,  it's possible to parse a string and
> create a parse tree at compile-time and then generate code from this,
> it's also successful. Go D!
>
> As a parser proper, Pegged is awful :-) Nothing I'm ashamed of, as I
> learn by coding. Hey, I just received the Dragon Book (International
> Edition), I'm sure I'll learn many things in there.

I'll be glad to buy for you any book you might feel you need for this. 
Again, there are few things more important for D right now than 
exploiting its unmatched-by-competition features to great ends. I don't 
want the lack of educational material to hold you down. Please continue 
working on this and let me know of what you need.

> So, if anyone is willing to change the code generated by Pegged, I'm
> game. The results you showed me on keyword parsing are very interesting!
>
> But, my impression is that the need for a 'D'-only parser and lexer is
> far greater and much more imediate that the need for a parser generator.

I very strongly disagree. This is our chance to get things right instead 
of having a limited product that destroys competition (much like lex and 
yacc have been for years in the parser generator field).

> All the reasons advanced upthread ask for a D parser, not a generic
> generator. Parser generators are for those of us interested in having
> DSLs or macros in D.
> So Pegged or any other generator should *not* get the community focus
> right now.

Pegged should be the focus.

> My plan would be as follow:
>
> 1- assemble a group of people knowing parsing. I don't think I'm exactly
> knowledgeable, but I'm ready to be part of such a group.
> 2- create a github process.
> 3- translate an existing parser / adapt a D parser for Phobos. I'm ready
> to be part of this (I'm sure I'll learn in the process)
> 4- spend 1-2 years fighting over LR parsing and such :) (Just kidding)
> 5- submit it to Phobos and have it adopted.

Sounds good. Replace 1-2 years with 1-2 months.



Andrei


More information about the Digitalmars-d mailing list