DDMD and such.
Jacob Carlborg
doob at me.com
Wed Sep 28 12:55:13 PDT 2011
On 2011-09-28 15:48, Trass3r wrote:
> Am 28.09.2011, 15:09 Uhr, schrieb Gor Gyolchanyan
> <gor.f.gyolchanyan at gmail.com>:
>
>> I know, this has been discussed earlier, but i don't quite understand
>> the real reason why isn't DMD's front-end being written in D.
>> Existing DDMD is pointless (and i think abandoned), because it's just
>> a plain rewrite with the same C-style constructs and completely
>> rewriting it to be a correct D code would mean being unable to get the
>> bug-fixes on DMD.
>
> Yep, it's pointless cause it inherits all of dmd's quirks.
> Rewriting most of ddmd to overcome dmd's design flaws would be overkill.
> Also keeping in sync with dmd is hard since there is no way of
> auto-applying patches. Everything has to be done by hand and believe me,
> it's not fun.
>
> I think dmd should keep going its way and provide a base..
> (remember that it also provides a base for gdc/ldc. If dmd switched to D
> there would also be no updates for LDC and GDC anymore)
Why wouldn't it? LDC and GDC can use the frontend written in D.
> ..for a future new frontend written from scratch in D with a proper
> design that isn't restricted to a single application (i.e. compiler),
> similar to Clang but properly implemented. Clang drifted away from its
> goals, especially the "easily hackable" one.
I agree.
> Unfortunately there is no such project yet.
> Dil is quite nice, but it's D1 and GPL.
I think someone is slowly porting the lexer from DMD to D, which will be
included in Phobos. There where discussions about this some time ago.
I think that the right approach would be to have a modular frontend
written in D that can be used as a library, think Clang. Then DMD could
use this frontend and connect it with the DMC backend.
To get this frontend I think the DMD frontend needs to be ported to D
without much modification in the first step. DMD would then use the D
version of the frontend. When the complete frontend is ported and used
by DMD, then we could start refactoring the frontend to make it more
modular.
I think this is the most realistic approach. I don't think Walter would
just drop the DMD frontend and start with a new one, or use some other
frontend developed by someone else.
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list