D, Java? To D or not to D?

Leandro Lucarella llucarella at integratech.com.ar
Fri Jan 5 06:44:41 PST 2007


TPJ escribió:
> d) Java programs run fast enough. Take a look at
> http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=all
> D got 67.6, and Java got 44.0. From MPOV this difference is not important. The
> difference between Java (44.0) and Python (10.1) is much more significant.
> 67.6 / 44.0 = 1.54
> 44.0 / 10.1 = 4.36
> 67.6 / 10.1 = 6.69

Have you tried psyco (a kid of JIT for Python)?

> Disadvantages:
> 
> 1) In order to run a program written in D I have to compile it on the target OS.

Gregor Richards managed to get Java Bytecode out of a D source[1] =)
So, that could change in the future if you prefer portability over speed.

[1] 
http://www.digitalmars.com/d/archives/digitalmars/D/announce/From_the_Department_of_Insane_Ideas_D_on_the_JVM_6264.html

> 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?

Since I doesn't have Sun or Microsoft on his back, it probably will take 
MUCH longer for D to popularize (like Python or Ruby, did, they both are 
from early '90 and got popular about 10 years later, even so, it happend 
almost the same to C++, which didn't had a real bit enterprise either).

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

Nokia 770 is not a mobile phone but is close enough (I think). As 
somebody says, Michael Dominic K.[2] apparently got D working on that 
internet tablet[3].

[2] http://www.mdk.org.pl/
[3] http://www.flickr.com/photo_zoom.gne?id=329290303&size=l

So, as you can see, or at least as I can see, D has a very prominent 
future (it's technically possible to make D do everything C/C++, Java 
and C# can do, picking the best features of each), but I think it would 
take about 10 to D to get really popular (as popular as C/C++, Java, C# 
or Python). Maybe a little less, because back when Python or C++ was 
created there were no so much fuzz about programming languages as there 
is now (I think), so the terrain is much more fertile for people to try 
new languages now.

> 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?

Less memory consumption, faster load times, and I think more 
responsiveness. When you use C/C++/D programs (native code programs) 
they fill lighter (at least I find them lighter).

> 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. But wrappers can make your live much easier.

> So I ask myself a question today: should I invest in learning D? Is it worth
> my efforts?

I think yes. D has everything to success, it just need time. What I 
found really great of the is how well both worlds (native compiled and 
higher level with-killer-runtime) are mixed. You have the best of the 2 
worlds.

-- 
Leandro Lucarella
Integratech S.A.
4571-5252



More information about the Digitalmars-d mailing list