[Mono-list] When someone asks about java...
Fergus Henderson
fjh@cs.mu.oz.au
Sat, 14 Jul 2001 15:58:58 +1000
On 13-Jul-2001, Tom <tom7ca@yahoo.com> wrote:
> > Just found this article about the reality of Java's
> > language neutrality.
> > It does not point to any technical reason why
> > language neutrality is not
> > possible in java, but rather attempts to analyseS
> > real-world
> > non-java-the-language java bytecode compiler
> > implementations.
>
> Sessions's research can only be described as shoddy,
> since he missed several major, mature, and widely used
> languages with JVM backends.
Agreed.
> In any case, a more serious flaw with Sessions's
> analysis is the implicit assumption that CLR is any
> better. CLR has a few more bytecodes, but neither
> its object model nor its execution model are
> significantly different from the JVM.
Here I disagree. The differences are relatively small but significant.
For example, emulating tail call on the JVM can cost a factor of two
or three in performance.
> There is no
> support for actors, nondeterminism, metaobjects,
> (non-OO) polymorphism, categories, logical variables,
> efficient functional data structures, or a host
> of other features many modern languages use.
Many of those features don't need to be supported directly,
but can be mapped into features that the runtime supports.
There's no direct support for nondeterminism.
But the CLR supports several features which make it easier
to map nondeterministic languages to efficient CLR code.
In particular, nondeterminism can be mapped to continuation passing.
The CLR's support for value types, `refany', and function pointers
(`calli' and `tail.calli') means that we can do this with reasonable
efficiently -- environments can be allocated on the stack rather than
on the heap.
(Function pointers are not verifiable, which sucks. Also tailcalls with
byref parameters aren't verifiable, and that sucks too. But if we had
a free software implementation of the CLR, we could fix those problems.)
> CLR is only language independent if the set of
> languages you know is limited to languages like
> C, C++, Java, VB, Perl, Python, and C#.
I agree that the CLR is not "language independent", i.e. not all
languages map equally well to the CLR, but nevertheless, I think the
CLR is a better target for a broader range of languages than the JVM.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.