Anyone interested in a working grammar for D?
Brad Roberts
braddr at puremagic.com
Thu Feb 23 14:14:47 PST 2006
On Thu, 23 Feb 2006, Kelly Wilson wrote:
> Hey everyone,
>
> Great language Walter et al. I saw this language and the active group here when
> I was seeking a project to work on in my spare time. I decided to see if I could
> make a usable grammar for D and start building a new compiler (should only take
> a few weeks for a new optimizing compiler, I figured.......just kidding ;).
>
> Anyways, I have a mostly working GLR grammar that was originally based on Ivan
> Senji's Dgrammar(I hope that using your grammar was ok Ivan...if you don't want
> me to release this then let me know, as I have to release this under the license
> for Elkhound...I don't know if your license is compatible?? Or should I just
> include your license? ...I don't know how those things work).
Outside academic interest, have you considered using dmd's front end
directly? It is freely available (by several definitions). Since it's
the 'one true source' that defines the language in practice, re-use of it
would make for a much more accurate tool to build on top of.
I don't mean to downplay your effort. Rewriting something can often be
both fun and educational. Sometimes it even results in something truely
better. But it is, as you've found, a lot of effort to get to be perfect.
Walter releases the source to the front end in large part to help
eliminate the duplication of effort. It's what gdc uses to build the d
front end for gcc. The bulk of the now code in gdc is the glue layer
between dmd's frontend and gcc's IR. The rest is the runtime support to
work with gcc and linux's runtime (exceptions being a good example).
Later,
Brad
More information about the Digitalmars-d
mailing list