Migrating dmd to D?

Michel Fortin michel.fortin at michelf.ca
Fri Mar 1 18:34:23 PST 2013


On 2013-02-28 00:37:50 +0000, Andrei Alexandrescu 
<SeeWebsiteForEmail at erdani.org> said:

> 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.
> 
> 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.
> 
> 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.
> 
> 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.
> 
> Please chime in with ideas on how to make this happen.

Actually, I think it'd be easier and faster to convert it all in one 
chunk. Perhaps I'm a little too optimistic, but I did port successfully 
a game from D to C++ once and it was not that difficult. I never 
bothered with having a half-translated version that'd work.

My impression is that trying to add some layer to make the intermediary 
state compile is more likely to introduce bugs than to help. The 
current architecture isn't modular enough to do that without many 
complications.

-- 
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca/



More information about the Digitalmars-d mailing list