D vs Java

Walter Bright newshound at digitalmars.com
Tue Mar 21 02:02:44 PST 2006


"Roberto Mariottini" <Roberto_member at pathlink.com> wrote in message 
news:dvof2n$2i65$1 at digitaldaemon.com...
>>This portability isn't the result of a VM, it's the result of cleaning up
>>all the undefined and implementation defined behaviors in the language.
> I still think the VM has its own part. Think to having backends for IA32, 
> IA64,
> AMD64, PowerPC, SPARC, ARM and so on. They will have their bugs and 
> special
> cases acording to the underlying architecture.

So do the VMs. Write once, debug everywhere. <g>

> Sure, this will make D highly portable.
> But I think the VM will win anyway. Because I am lazy.
> I don't want to buy/download, install and test 4 different 
> (cross-)compilers for
> my 4 systems. And I don't want to compile my program 4 times.
> If one compiler can do it, with acceptable performance, I will use the
> one-compiler solution.

With VMs, you have a lot more platforms to test, because you cannot control 
which version of which VM your customers will be using.

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.

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





More information about the Digitalmars-d mailing list