Hacker News new | ask | show | jobs
by daxfohl 1738 days ago
Changing companies led me from C# to Java. I feel so much less productive in Java, so much extra boilerplate everywhere. C# is just as mainstream as Java, so learning curves and nicheness arguments don't apply, it's just better.

I wonder if MSFT will ever make C# run on JVM.

5 comments

> C# is just as mainstream as Java, so learning curves and nicheness arguments don't apply, it's just better.

Java has way more web framworks from what I've seen (could be a good or bad thing), and more alternative languages that you can pick from.

That's basically how C# came into being in the first place. Microsoft "bought" Anders Hejlsberg of Borland Delphi fame, and had him create a "better Java". And IMHO Visual J++ was a much superior Java, with a visual designer that was much more advanced than anything else available back then. The problem? It was very much Windows Only (tm) if you wanted to use the advanced features. Sun was not happy about this. And the end result of the legal struggle was that Microsoft used Visual J++ as a base for C# and scrapped Java compatibility.
Only if they want to cripple C#, as the JVM isn't able to support all the C++ like features from C#.
It would still make sense, as long as when coding in the "crippled" C# one can still take advantage of the entire Java ecosystem.
You already have IKVM for that, with various degrees of success depending on the library.
C# was designed in a way that makes it very hard to run on the JVM in a performant way. It has slightly different scope behaviors, slightly different asthmatics etc. Source: worked on a JVM running on C# which was hard, I think the reverse is even harder.
It might be easier these days with GraalVM/Truffle. You wouldn't run C# directly, you'd implement CIL in a Truffle interpreter, so you bypass JVM bytecode and its semantics entirely.
There’s IKVM for running Java libraries in .NET.