Java > Scala

Walter Bright newshound2 at digitalmars.com
Thu Dec 1 02:09:44 PST 2011


On 12/1/2011 1:26 AM, Russel Winder wrote:
> I think this thread has shown that D folk need to accept that Java is a
> critical platform out there and will be for many years to come.

I understand that. Java isn't going anywhere. I was only addressing the idea 
that the Java bytecode is a burden for compiler developers or not.


> D's fight is with C, C++, Go, not with Java.  D needs to make inroads
> into areas currently dominated by C and C++ and those being swept up in
> the tide of Go.

I suspect Go's market is more the Java market than the C/C++ one.


> So people doing the benchmarks you have seen are substandard and don't
> realize you are supposed to write the best idiomatic version of the
> algorithm in each of the languages under test.  This is not a stick to
> beat Java with.

It is when they are using a Java stick to beat D with :-)


> Fortran compiler writers have been doing this sort of thing very
> successfully for years:  1960s Fortran 4 serial code gets converted into
> parallel code by clever inferences and "reverse engineering.
>
> It has always amazed me that owners of these old Fortran codes think it
> is more important to expend resources on clever compiler trickery that
> just to rewrite the codes in a modern language, like Fortran 2009.
>
> Of course rewriting would give an opportunity to change language.  I bet
> they would go to C++ not D.  Though staying with Fortran 2009 may be
> even better.

The C++ folks do the same thing. Rather than add vector operations to the core 
language, they rely on "vectorizing" compilers that reverse engineer loops into 
a higher level construct.


> So the real question here is to get some benchmarks together to show
> that D outshines C, C++ and Fortran 2009 -- with of course the
> benchmarks being written properly in idiomatic language for each
> language not, as you noted earlier, transliterations from one language
> to all the others.

I've done a lot of benchmarks in the past. The universal reaction to them is one of:

1. There's a bug in my compiler that "deleted" the benchmark code (what actually 
happened is it was dead code, and the compiler deleted dead code).

2. I somehow cheated, because the results cannot possibly be true.

3. I used a sabotaged compiler for language X to compare against.

4. I didn't write the code correctly for language X. This charge is leveled at 
me even when I'm careful to use OTHER peoples' published X code, and provide 
links to the originals.


So color me a bit weary of the abuse. I tend to let people do their own 
benchmarks. It's also why I stopped publishing language comparison charts.


More information about the Digitalmars-d mailing list