GSOC 2011

Luca Boasso luke.boasso at gmail.com
Thu Mar 24 12:18:48 PDT 2011


Hello,

I'm new in the D community so I don't have a fully understanding of the short
term needs of the community itself. After reading the posts at
[http://www.digitalmars.com/d/archives/digitalmars/D/ide/Future_of_Descent_and_D_Eclipse_IDE_635.html]
I agree with Bruno that an ANTLR parser could be useful.

With the help of a parser generator it's also possible to experiment with the
syntax of the language since potential future changes of D grammar are (almost)
handled by a tool instead of a manual modification of the hand written parser.
On the other hand the D language v2, as far as I know, is quite stable, so there
is no a strong need to experiment.

I think that adding to ANTLR the capability of generating D would be a complex
task that cannot be accomplished in the time frame of GSOC, considering that I
will not be able to work full time.

Thanks,

Luca Boasso

On 3/24/11, Bruno Medeiros <brunodomedeiros+spam at com.gmail> wrote:
> 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