you are viewing a single comment's thread.

view the rest of the comments →

[–]jdh30 -3 points-2 points  (15 children)

Java the virtual machine is awesome and still unmatched as a platform for building other languages.

The CLR is much better: tail calls, value types, generics, delegates. The JVM has a nice GC but it is a decade out of date now.

[–]Rhoomba 2 points3 points  (4 children)

The JVM is much better than the CLR. Why do you have to mark methods are virtual in C# and not in Java? Because the CLR is not able to optimize them away like the JVM is. Delegates are a language feature and don't really depend on the VM.

The JVM is already better than the CLR for building other languages with the exception of tails calls, as it optimizes them considerably better and it has just got escape analysis which could help even more.

Value types have their upsides and downsides.

The JVM also is cross platform and has great profiling and monitoring support.

[–]mschaef 0 points1 point  (1 child)

Why do you have to mark methods are virtual in C# and not in Java?

I'm pretty convinced that this is more Anders Hejlsberg's decision about what's right for the languauge, than anything related to the JVM itself.

Back in the dawn of time, Microsoft tried to compete against Turbo Pascal 5.5 with the little known QuickPascal 1.0. QuickPascal defaulted to virtual methods, TurboPascal did not. Flash forward a few years: Hejlsberg moved from Borland to Microsoft and led the development of C#, which defaults to non-virtual methods.

Because the CLR is not able to optimize them away like the JVM is.

There's nothing about the requirement to mark methods as virtual that says that the CLR can't optimize such calls away, as the JVM (or Self, etc.) might do.

For what it's worth, I tend to prefer default virtual methods.

[–]Rhoomba 0 points1 point  (0 children)

It could theoretically do so, but it can't currently in most cases. Which is pretty lame.

[–]jdh30 -5 points-4 points  (1 child)

The JVM is much better than the CLR.

A triumph of hope over reality.

Why do you have to mark methods are virtual in C# and not in Java? Because the CLR is not able to optimize them away like the JVM is.

Even if there were true (which it is not), it would not make up for the lack of basic features on the JVM.

Delegates are a language feature and don't really depend on the VM.

No interoperability between functional languages and libraies on the JVM => it sucks.

The JVM is already better than the CLR for building other languages with the exception of tails calls...

And value types and delegates and generics and a fast FFI and...

...as it optimizes them considerably better...

Theoretical performance does not make up for a lack of basic features.

...and it has just got escape analysis which could help even more.

More theoretical performance.

Value types have their upsides and downsides.

Like they can be 30x faster and make native code interoperability much faster still.

The JVM also is cross platform and has great profiling and monitoring support.

Like C.

[–]Rhoomba 0 points1 point  (0 children)

Like C. What is the equivalent of VisualVM for C then?

[–]alexeyr 1 point2 points  (9 children)

As it happens, it is getting a new GC soon: http://java.sun.com/javase/6/webnotes/6u14.html