Migrating dmd to D?

Maxim Fomin maxim at maxim-fomin.ru
Thu Feb 28 02:35:12 PST 2013


On Thursday, 28 February 2013 at 00:37:50 UTC, Andrei
Alexandrescu wrote:
> Hello,
>
>
> Walter and I have had a long conversation about the next 
> radical thing to do to improve D's standing. Like others in 
> this community, we believe it's a good time to consider 
> bootstrapping the compiler. Having the D compiler written in D 
> has quite a few advantages, among which taking advantages of 
> D's features and having a large codebase that would be its own 
> test harness.

D contains hundred of files, a "little" file can contain 5K of
good old buggy C++ code. A big "file" can contain up to 10K of
lines. I didn't collect statistics. How do you plan to convert it?

> By this we'd like to initiate a dialog about how this large 
> project can be initiated and driven through completion. Our 
> initial basic ideas are:
>
> 1. Implement the dtoh standalone program that takes a D module 
> and generates its corresponding C++ header.

With some kind of magical tool called 'dtoh'? Ok, it can
translate declarations. But what (maybe who) would rewrite code?

> 2. Use dtoh to initiate and conduct an incremental port of the 
> compiler. At given points throughout the code D code will 
> coexist and link with C++ code.

The fact that dmd outputs old object format at win32 would come
at help, wouldn't it? And how such code can coexists? From
straightforward POV, it is clear how D function can call C
function (forgetting about 64 C struct ABI problem), but how for
ex. D code can use C++ class and vice versa? And what about
runtime? Two runtimes: C++ and D? And how GC would treat C++
staff?

> 3. At a point in the future the last C++ module will be 
> replaced with a D module. Going forward there will be no more 
> need for a C++ compiler to build the compiler (except as a 
> bootstrapping test).
>
> It is essential that we get support from the larger community 
> for this. This is a large project that should enjoy strong 
> leadership apart from Walter himself (as he is busy with 
> dynamic library support which is strategic) and robust 
> participation from many of us.

So, you both are asking community help? It is nice to hear, but I
consider that community was in some kind of discrimination
against you in the past except in trivial cases like fixing bugs
and asking something which was badly needed. The very single
example of when you both agreed that you are wrong (after long
insisting that you are right because you are right) is bugzilla
issue on class inheritance and preconditions - whether base class
invariant should be respected or not.

So, I see this idea (and I can be rude and biased here) as "we
haven't treated you seriously in the past, please rewtite 100K
from C++ to D for us, we are to high to do the dirty job
ourselves".

> Please chime in with ideas on how to make this happen.
>
>
> Thanks,
>
> Andrei

P.S. Latest passage is a sum of each small disappointment of how
D project is governed.


More information about the Digitalmars-d mailing list