D vs Java

Roberto Mariottini Roberto_member at pathlink.com
Wed Mar 22 01:11:29 PST 2006


In article <dvpfa8$sq1$1 at digitaldaemon.com>, Walter Bright says...
>
>
[...]
>
>With VMs, you have a lot more platforms to test, because you cannot control 
>which version of which VM your customers will be using.

In theory, and in the general case, yes. 
In practice I never had a JVM bug reported in 10 years. In any JVM. In the end
the bug was in my code.

Also, in my particular case I can control the VM, because it's me that put the
VM in the machine I sell to customers.

>Back in the early days, Microsoft shipped a linker with MS-DOS. Great, I 
>didn't have to write a linker for my compiler, just use the MS one everyone 
>had. Unfortunately, MS shipped version after version of that linker. Some 
>worked, some didn't, and soon the number of different versions grew into the 
>scores. I had disks full of different versions, and started keeping logs of 
>which worked and which didn't. Even worse, when customer X had a non-working 
>linker, I couldn't ship him one that worked, as I had no license to. It was 
>so bad it became clear that I had to come up with our own linker.
>
>Essentially, I learned that if you are supporting an application, and you 
>need to be in control of your support costs, you have to be able to control 
>the generation of the executable. That's impossible with a VM.

This is something I was afraid of, at the beginnin of my work with Java. In the
end, after 10 years, I can say it never applied to Java.
I don't exclude that in the Java VM design there's something that ease the
verification of the VM correctness, giving always high quality VMs. And I don't
use only Sun's JVM. The fact that you have to pass a lot of test by Sun before
you can use the word "Java" for your VM maybe means something.

>But also, really, what is the difference between relying on a JIT compiler 
>for each platform, and a native compiler for each platform? Why should the 
>JIT compiler be more reliable? There's no technical reason it should be.

Maybe there's one: the JIT compiler task is much like the work of a macro
assembler than that of a HLL compiler.

>If 
>the language has portable semantics, and the compilers implement those 
>semantics correctly, it should be write once, run everywhere. There's no 
>technical reason a VM is required to make that happen. 

In theory you are right.
In practice a VM makes the task more easy and lead to more robust results.
Prove me wrong with D ;-).

Ciao

---
http://www.mariottini.net/roberto/



More information about the Digitalmars-d mailing list