D, Java? To D or not to D?

Sean Kelly sean at f4.ca
Fri Jan 5 08:43:38 PST 2007


TPJ wrote:
> 
> And now I have found D. What can I say about it?
> 
> Disadvantages:
> 
> 1) In order to run a program written in D I have to compile it on the target OS.

Yup.  Though there was one project in the past to compile D to CLI and 
have it run on .NET.  Things were pretty far along when the author's 
hard drive crashed and the data was lost.  So in terms of VM 
portability, this is possible if someone is willing to put in the time.

> 2) D might be perceived as an alternative to Java or C# (I don't count C/C++).
> But it is really the case? Java was born in 1995, today it's a very known
> language. C# was born in 1999, today it's popularity is still rising. And D?
> Mars was born in 1988, D in 1999. How many people have heard about D? In
> comparison, say, to C#? How many apps and libraries are written in Java, in
> C#, and in D?

D was developed by one man, not a huge team.  And I think the real 
comparison for D should be to C/C++, which you discount.  What D really 
has going for it is that it's a systems programming language with a lot 
of the features of a high-level language (garbage collection, decent 
RTTI, etc).  This combination, along with its elegant design, is what 
makes it an appealing language to me personally.

> 3) There is no D for mobile phones (AFAIK).

Only for the moment.  I know of someone who is in the process of making 
GDC work for ARM.

> Advantages:
> 
> 1) It's said to be faster than Java. But is it really an advantage? I find
> Java fast enough for my needs, so why should I bother myself with D?

Speed simply isn't a selling point for Java programmers, for the reasons 
you state.

> 2) From FAQ: Since D can call C functions, any GUI library with a C interface
> is accessible from D.
> Does it mean that I can access *any* C library from D? If so, it a great feature!

Yes.  C interoperability was a major design goal of D.

> So I ask myself a question today: should I invest in learning D? Is it worth
> my efforts?
> 
> To be honest, I still think that C# has better future than D.

I think it depends on the target market.  C# has a huge future in the 
Windows world for everyday applications, but Mono still isn't a 
fantastic solution for other OSes.  Were I looking for true binary 
portability I'd choose Java, RAD development on Windows I'd choose C# or 
C++/CLI, systems programming anywhere I'd choose D if possible, but 
realistically I'd probably still use C++ at least professionally.  I 
think D is a wonderful language, but it will take a while for it to gain 
traction in the commercial sector.


Sean



More information about the Digitalmars-d mailing list