Incorporating D

Maxim Fomin maxim at maxim-fomin.ru
Fri Jan 25 13:27:25 PST 2013


On Friday, 25 January 2013 at 20:45:22 UTC, Szymon wrote:
> Hi,
>
> I would really like to start using D in our small company as a
> C++ replacement. With that in mind I do have few questions:
>
> 1) Is D2 really ready for production code? I often hear ppl
> complaining about compiler bugs or regressions causing them to
> drop D "for now". Is it true that D has GC problems?

No. D compiler(s) has plenty of bugs and the language is not 
stable yet. You may encounter compiler errors when update to new 
version. And there is significant incentive to update, because 
each version fixes many bugs.

Standard library is not stable yet. Firstly, strictly speaking, 
there is no standard library. Phobos is a one, but it is 
extremely eclectic (contains many features which are not 
structured and certainly one day would be fixed). Secondly, some 
modules are deprecated, some modules are marked as "one day it 
would be fixed and you will not recognize it". Thirdly, inside 
modules declarations may significantly change across different 
versions.

D also has poor toolchain support: IDEs, editors, debuggers, etc.

D's GC does not have serious problems. The only issue is 
controversial status of GC.

If you are aware of codegen quality, you should take look at gdc 
or ldc, because dmd backend has poor optimizer and in general is 
worse.

> 2) Is there a way to start adding D code to a C++ projects? For
> example build a dll in D that is loaded by C++ host app? I guess
> that is not possible because of GC not being there?

Probably, but there are some problems. For example, dmd generates 
old object format on win32 which is not incompatible with almost 
anything on win32. Dynamic linking works only on linux and 
dynamic loading does not work on all platforms. However it is 
possible to write part of the application in D and link code to 
C++. Preferably it should be statically linked, or dynamically 
but without exposing D features (using extern(C) like C).

> 3) Is it possible to use D on iOS?

Likely no.

> We will for sure switch to D eventually. Question is, when can 
> we
> start the transition so it would not fire back on us.

This will happen not soon.


More information about the Digitalmars-d mailing list