D vs. C#

Roberto Mariottini rmariottini at mail.com
Tue Oct 23 00:11:04 PDT 2007


Walter Bright wrote:
> Roberto Mariottini wrote:
>> Walter Bright wrote:
>>> Javascript is distributed in source code, and executes on a variety 
>>> of machines. A VM is not necessary to achieve portability to machines 
>>> unknown. What is necessary is a portable language design.
>>
>> Obviously, this is valid only if you want to distribute the sources, 
>> and sometimes you can't (i.e. royalties, sublicensing and the like).
> 
> Distributing Java class files is not secure, as good decompilers exist 
> for them. Might as well distribute source.

This is something lawyers don't know. I have seen a couple of non-source 
Java library licensing.

>> We are still talking only of the implementation, not the language 
>> itself. I consider the Javascript environment as a high level VM, and 
>> I still think that a compiled Javascript would be unusable.
> 
> It's true that Javascript uses a VM, but it doesn't use a standardized 
> VM for which one distributes precompiled binaries too. Javascript is 
> always compiled/interpreted directly from source code, and source code 
> is how its distributed.

That's why I've said "High Level" VM. I see Javascript and Java as two 
equivalent VMs (+ standard libraries).

>> Even if technically the big difference between portable and 
>> non-portable resides on the language and the standard libraries, I 
>> think that not considering the hundreds of working VMs that exist 
>> today is narrow-thinking.
> 
> Considering that a C compiler exists for a far broader range of devices 
> than VMs do, all the motivation that is needed is the language needs to 
> be a) popular or b) have huge resources from a company like Sun to 
> finance development of all those VMs. Sun could just as easily have 
> provided a generic back end & library.

I've never said that VMs are better than C. I'm saying that VMs are 
there today, and they work, today.
They work the "Compile-Once-Run-Everywhere" way.

>> To force developers to distribute their sources excludes a big part of 
>> the software world as it is today.
> 
> Not the Java world - decompilers are common and effective.

Don't say it to your attorney.

>> Making D compilable for the Java VM today would make it immediately 
>> portable to tens of platforms (and hundreds of cell phones models), 
>> today.
> 
> The Java VM is insufficiently powerful to use as a back end for D. It 
> can't even do C.

I thought that the Java VM was Turing-complete :-)
I'm not an expert of compilers and VMs, so I believe you.
It's a pity that I can't use D on those cell phones :-(

Ciao



More information about the Digitalmars-d mailing list