6 ms·
So if the JVM beats CLR but C# beats Java, why isn't there a C# compiler for the JVM? I suspect that all language features of C# should be expressible in Java
by voidpointer 17y ago
So if the JVM beats CLR but C# beats Java, why isn't there a C# compiler for the JVM?
I suspect that all language features of C# should be expressible in Java bytecode, but I have not thought about the details yet. If you know of anything in C# that would be unimplementable in terms of Java bytecode it would be interesting to hear about that.
- rcoder 17y agoJava bytecode is Turing-complete, so there's nothing explicitly preventing you from implementing many of the advanced features of C# atop the JVM. As the OP stated, alternate languages running on the JVM (such as Scala) already do this. The problem is simply that most Java shops use only the officially-blessed Java language. Because Sun has always forced "certified" implementations of the language and platform to conform to their standard, there has been little room for innovation in the source syntax and bytecode format since the release of the first JDK in 1996. In the meantime, programming languages (and the programmers who use them) have moved forward, and Java has failed to keep up.
- icey 17y agoI know it's doable in the other direction (http://www.ikvm.net/ http://www.ikvm.net/). My assumption is that there's no real incentive to create such a beast though. Most people who like C# don't care enough about the JVM to want to deal with that kind of effort.
- leadnose 17y agoMy guess is that C# supports stuff that has no direct and fast implementation on the JVM. IIRC C# has unsigned primitive types, stack allocated objects etc. which JVM doesn't have.
- jwhitlark 17y agoThese days I tend to think of Java as the new assembler; I need to read/understand it, occasionally write it, but I do most of my work in clojure and python, (or scala, whatever your preference)
- solutionyogi 17y agoThat's the problem with the article. Author concluded that JVM is better than CLR without giving any details. As I wrote in my other comment, .NET platform implements various features in CLR and in the language (in this case C#), to make C# a superior language. I challenge anyone to come up with examples which shows that JVM is better than CLR.