Let's stop parser Hell

Roman D. Boiko rb at d-coding.com
Thu Jul 5 11:31:02 PDT 2012


On Thursday, 5 July 2012 at 18:17:06 UTC, Philippe Sigaud wrote:
>>> On 2012-07-05 18:32, Roman D. Boiko wrote:
>>>
>>>> My vote would be for Pegged, I guess.
>
> 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.
>
> 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. 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.

I'm sure it can generate **much** faster code. I'm going to focus 
on its part that generates D parser (i.e., to make it 
significantly faster and able to efficiently parse-as-you-type). 
Actually, I'm sure it will be able to beat any other parser with 
respect to performance. :)

1. So my plan is the following: invite whoever would want to help.
2. Prove my claims above in practice. :-)))))


More information about the Digitalmars-d mailing list