Let's stop parser Hell

David Piepgrass qwertie256 at gmail.com
Fri Jul 6 17:45:35 PDT 2012


>> Resume: everybody is welcome to join effort of translating DMD 
>> front end, and improving Pegged.
>>
>> Also I would like to invite those interested in DCT project to 
>> help me with it. Right now I'm trying to understand whether it 
>> is possible to incorporate Pegged inside without losing 
>> anything critical (and I think it is very likely possible), 
>> and how exactly to do that.
>>
>> Dmitry proposed to help improve Pegged (or some other 
>> compiler's) speed.
>>
>> Anyone else?
>
> I'd really want to create a task force on this, it is of 
> strategic importance to D. In Walter's own words, no new 
> feature is going to push us forward since we're not really 
> using the great goodies we've got, and CTFE technology is the 
> most important.

Hi everybody! My name's David and I've been dreaming since around 
1999 of making my own computer language, and never found the time 
for it. The first time I looked at D it was around 2004 or so, 
and it just looked like a "moderately better C++" which I forgot 
about, having more lofty ideas. When I found out about D2's 
metaprogramming facilities I instantly became much more 
interested, although I still wish to accomplish more than is 
possible ATM.

I've been talking to my boss about reducing my working hours, 
mainly in order to have time to work on something related to D. 
My goal is to popularize a language that is efficient (as in 
runtime speed and size), expressive, safe, concise, readable, 
well-documented, easy-to-use, and good at finding errors in your 
code.  In other words, I want a language that is literally all 
things to all people, a language that is effective for any task. 
I want to kill off this preconceived notion that most programmers 
seem to have, that fast code requires a language like C++ that is 
hard to use. The notion that Rapid Application Development is 
incompatible with an efficient executable is nonsense and I want 
to kill it :)

To be honest I have some reservations about D, but of all the 
languages I know, D is currently closest to my ideal.

This work on parsers might be a good place for me to dive in. I 
have an interest in parsers and familiarity with LL, LALR, PEGs, 
and even Pratt parsers (fun!), but I am still inexperienced.

I also like writing documentation and articles, but I always find 
it hard to figure out how other people's code works well enough 
to document it.

I'm having some trouble following this thread due to the 
acronyms: CTFE, DCT, AA. At least I managed to figure out that 
CTFE is Compile Time Function Execution. DCT and AA I already 
know as Discrete Cosine Transform and Anti-Aliasing, of 
course.... but what's it mean to you?

One thing that has always concerned me about PEGs is that they 
always say PEGs are slower than traditional two-phase LALR(1) or 
LL(k) parsers. However, I have never seen any benchmarks. Does 
anyone know exactly how much performance you lose in an 
(optimized) PEG compared to an (optimized) LALR/LL parser + 
LL/regex lexer?

Anyway, it's the weekend, during which I hope I can find a place 
to fit in with you guys.


More information about the Digitalmars-d mailing list