5 ms·
It is like the Java runtime, but started afresh with all of Java's learned lessons taken into account (although Java with 7 and 8 in particular is catching up).
by Someone1234 12y ago
It is like the Java runtime, but started afresh with all of Java's learned lessons taken into account (although Java with 7 and 8 in particular is catching up).
Up until now however it has only ran on Windows which was its biggest "downside" Vs. Java which runs on many platforms.
- mozumder 12y agoSo, why would a Mac user develop in it, instead of in a Windows (virtual) machine? How would .NET compare to Apple's native environment? I guess the whole point is to write cross-platform code, but is the .NET environment that much better than Swift/Xcode? I mean, Java never really caught on with the Mac user base.
- UK-AL 12y agoFor mac users, it's probably going to used for web development rather than native apps. Although there are some good bindings to cocoa to do so.
- thalesmello 12y ago> I guess the whole point is to write cross-platform code, but is the .NET environment that much better than Swift/Xcode? You said it all. The whole point is cross platform development. People use Swift to develop apps for Apple products. Before Dot.net was made open source, people only used it to develop for Microsoft platforms. The fact Dot.net is now crossplatform makes it possible for GNU/Linux and Mac users to consider it for development.
- notsony 12y agoSo when will Swift be made open-source? I am not going to make the same mistake twice and be tied down to a language (Objective-C) and private APIs (Cocoa, iOS, etc) which are useless outside of Apple's ivory tower. I had always thought of C# and Mono as a potential cross-platform solution, but now that .NET is open-source and Microsoft are pushing it hard, even on Linux, it has become a viable one. I suspect I am not the only Mac->iOS developer who is thinking along these lines.
- rmsaksida 12y agoOne advantage is developing server-side .NET apps without the need of a Windows VM, with the aid of regular Unix tools in your regular dev environment. That's a win in my book. But a cross-platform CLR opens up some possibilities even for desktop or CLI apps. The wealth of the .NET ecosystem is compelling.
- emodendroket 12y ago> I guess the whole point is to write cross-platform code, but is the .NET environment that much better than Swift/Xcode? Well, probably it is better if you have (say) a company full of people who know how to write C# but have never used Swift. And the whole write once run anywhere thing is nice (sure, native apps "feel" better, but if there are no native apps I'd rather have a Java version than nothing).
- pron 12y agoThe JVM is much more sophisticated than the CLR. Its GCs and JIT are many, many years ahead of the CLR's.
- Someone1234 12y agoI'll just direct you to the first reply on Stackoverflow here: https://stackoverflow.com/questions/453610/javas-virtual-machine-and-clr https://stackoverflow.com/questions/453610/javas-virtual-mac...
- pron 12y agoMost of the things in that answer says are simply irrelevant. - The biggest relevant difference -- which he mentions -- is indeed value types, which are coming to Java, - The CLR doesn't have coroutines. Yield/await are what's known as "stackless coroutines" and are, AFAIK, implemented at the language level (and besides, stackless coroutines are a far cry from coroutines, as the most powerful concept of coroutines is the stack). The JVM, OTOH, offers such sophisticated bytecode manipulation capabilities that full coroutines can be implemented as a library (e.g. Quasar). - What he says of bytecode/package design bears absolutely no relevance to the quality -- or power -- of the VM. Those are just simple design tradeoffs with little effect on results. Also, see my reply to math.
- deleted 12y ago[deleted]
- barrkel 12y agoIt's not that simple. The CLR has a different feature set to the JVM; or rather, it has a feature superset. If you run Java-like code on the CLR, I would expect it to not be as fast or have as high GC throughput as Hotspot, especially if the Java code has been tuned to Hotspot - there are particular fast paths for certain operations that kick in, where if your code is a little bit too far from the optimized idiom, you end up 3-5x slower. For regular code, I wouldn't expect a big gap between CLR and JVM; a lot of Java code is dominated by pointer chasing because the primary tool of abstraction is a heap-allocated object. C# written in the same way will be bottlenecked in similar ways on cache misses, TLB misses, etc. There's a larger variety of JVMs designed for a broader range of hardware, the most interesting to me being Azul and their GC tech. But the CLR gives you some different tactical options. Value types and unsafe code let you do things that are far more expensive or awkward on the JVM. Writing a significant amount of functionality that does no heap allocation is more feasible on the CLR than JVM. Native interop is an order of magnitude easier. The CLR is generally much faster to start up; Java terminal apps don't suit interactive use. The library linking story is much more pleasant too, with a single dynamically linked executable referencing GAC-installed assemblies, rather than stringing together enormously long class paths.
- dlubarov 12y ago> started afresh with all of Java's learned lessons taken into account I don't think that's really historically accurate. Java and C# were pretty similar back in 2002. The .NET team was more willing to add complexity and occasionally make breaking changes, like generics in CLR 2.0.
- toyg 12y agoThat's not historically accurate either. The .Net team was more willing to break things because in 2002 they had their 1.0 release. By then Java had already lived through 6 years of very aggressive presence in the marketplace, with lots of legacy code already in the wild. The only legacy MS had to worry about was COM, which had its own compatibility wrappers that were not fundamentally intrinsic to the CLR. So .Net had the advantage of coming years after Java had shown what it could be done (or not, see browser applets) from a technological and commercial point of view, AND quite a few years of development without worrying about backward compatibility. I'm not saying Sun developers were not slow (they were), but they clearly had a much more "entrenched" position, with all that it entails.