GSOC 2011
Bruno Medeiros
brunodomedeiros+spam at com.gmail
Thu Mar 24 08:09:57 PDT 2011
On 24/03/2011 04:30, Andrei Alexandrescu wrote:
> On 3/23/11 11:42 AM, Luca Boasso wrote:
>> Sorry for the late reply,
>> even tough I'm not an ANTLR expert, given my previous experience with
>> the tool
>> and having read most of the official book, I could help more on this GSOC
>> idea.
>>
>> I have looked at http://www.antlr.org/grammar/list and on google and I
>> could not
>> find any recent ANTLR grammar for D.
>> In my opinion this project could be a good contribution for the D
>> community
>> while being practical and useful in the short term.
>
> There are two aspects: writing an ANTLR grammar that parses D (which you
> are referring to) and also adding to ANTLR the capability of generating
> D. The latter would allow D users to create and use parsers for various
> languages. It would also require close cooperation with the ANTLR people
> for acceptance etc.
>
> (Sticking with the former project for now.) This is a technically
> interesting project. I'd need to hear more about the high-level
> motivation. What is the "business" motivation? There is already a parser
> for D written in C++ (the open-source front-end of dmd), so the project
> would need to build a good case for the added value. Also there are
> other D parser projects that people work on (ddmd comes to mind), so I'd
> need to hear a lot more in the way of justifying the utility of such a
> project.
>
>
> Thanks,
>
> Andrei
There is a clear business motivation:
If the ANTLR grammar that parses D is then used to generate a Java-based
parser, this can be applied to the DDT IDE project and used instead of
the current parser. This issue has been discussed in more detail here:
http://www.digitalmars.com/d/archives/digitalmars/D/ide/Future_of_Descent_and_D_Eclipse_IDE_635.html
The summary of the situation is: DDT currently uses the same parser as
Descent, which is the parser of the Java port of the DMD frontend.
Descent is no longer maintained, and neither is the port, so it has
fallen behind D latest syntax, and it means certain syntaxes are not
recognized properly by either IDE:
http://code.google.com/a/eclipselabs.org/p/ddt/issues/detail?id=6
It may also be the case that the parser port has some performance issues
(namely with memory usage, a sensitive point with the JVM). This has not
been confirmed to be the case with the parser, but according to Ary B.
it happens at least with the DMD semantic engine than Descent uses.
Whereas DMD is a throwaway process and may not care much about certain
memory management, the parser in Eclipse keeps running repeatedly...
The alternative solution to this "business" issue is to keep doing
things with the DMD port, but I don't think that's the best idea (see
that discussion with Ary for more details). But it may as well be on the
table for consideration to potential students.
--
Bruno Medeiros - Software Engineer
More information about the Digitalmars-d
mailing list