DMD 1.022 and 2.005 releases

Bill Baxter dnewsgroup at billbaxter.com
Tue Oct 9 18:40:46 PDT 2007


Walter Bright wrote:
> Jarrett Billingsley wrote:
>> "BLS" <nanali at nospam-wanadoo.fr> wrote in message 
>> news:fegotb$1l3e$1 at digitalmars.com...
>>
>>> Actually coding C++ code in D  means : rewrite it and make it D-ish, 
>>> instead of translate it.
>>> This is , simply said shit; and I guess you folks know it.
>>
>> Wow, harsh.  There are those of us who don't actually spend all of our 
>> time translating C++ into D, you know. 
> 
> I don't recommend anyone actually translate C++ code to D, or C code for 
> that matter. If it's a debugged, working code base, translating to 
> another language is usually a losing proposition.
> 
> What matters, though, is being able to interface to that existing code 
> base.

While that sounds like good advice in general, if the C++ library in 
question is mostly templates, there's not much hope of interfacing to it 
from D.  Porting is the only option I'm aware of.

Of course some parts don't translate well and should just be rewritten 
in a way that makes sense in D.   But once the scaffolding is in place, 
the core, tricky, algorithmic parts that are hardest to debug become 
easy to translate.  So in that way the D port benefits from the work 
that went into debugging the C++.  So it's a win over just writing from 
scratch.

OpenMesh/D is about 15-20K loc.  I ported that from C++ in about 10 
days.  No way I would have been able to write that from scratch in the 
same amount of time.


--bb



More information about the Digitalmars-d-announce mailing list