News for hackers. Stuff that matters.
Re:Microsoft and Xamarin partner by pnathan on Wednesday November 13, 2013 @11:43AM (#6726391)
That would be horrible.

C# is a pretty weak language[1], and .NET is layers of bad design choices (both of these problems stem from a aggressive OO design methodology combined with poor API taste + a policy of "never break".

Not only that, Microsoft is a monopolist by character, and an unpleasant competitor. It would be a disaster for the world if they regained dominance (much like other companies, but MS brings a particularly domineering flavor).

[1] It's adequate. It gets the job done, adequately. It doesn't shine except in being adequate. I would rather use pretty much any open source language than a .NET one.

Re:Microsoft and Xamarin partner by gjulianm on Wednesday November 13, 2013 @11:52AM (#6726456)
Well, I think MS has been drifting away from their monopolistic character. Look at Azure, for example. They give you documentation even to develop and deploy with Java. That's not something I'd expect from the old MS.

Apart from that, why is C# a weak language? I think it shines in features: dynamic typing, code by contracts, runtime code generation (you can generate assemblies in execution time with System.Reflection.Emit), LINQ... you can even use it as a functional programming language. I wouldn't say C# is pretty weak.

Re:Microsoft and Xamarin partner by michaelwww on Wednesday November 13, 2013 @12:59PM (#6727007)
> C# is a pretty weak language[1]

I like how you give a citation then cite yourself

Re:Microsoft and Xamarin partner by was_hellbanned on Thursday November 14, 2013 @12:50AM (#6730808)
Footnotes are used for more than just citation.
Re:Microsoft and Xamarin partner by michaelwww on Thursday November 14, 2013 @12:58AM (#6730840)
My tone was meant to be gently humorous, not seriously precise. I was reminded of a guy on another site who was backing up his arguments with quotes from a book -- that he wrote. When someone called him on it he didn't miss a beat; he said it was a good book four years ago when he wrote it and still a good book worth quoting.
Re:Microsoft and Xamarin partner by pnathan on Thursday November 14, 2013 @11:32AM (#6733245)
Sometimes parentheticals simply take away from the point of a paragraph.
Re:Microsoft and Xamarin partner by depr on Wednesday November 13, 2013 @04:42PM (#6728772)
-- Michael Scott
Re:Microsoft and Xamarin partner by thatthatis on Wednesday November 13, 2013 @11:49AM (#6726428)
Of Java, C#, and ObjectiveC the language I most want as the common language is Python.

That not being an option, C# is decently close to python in expressiveness, certainly better than the other two, and in my appraisal actually a pretty nice language.

Re:Microsoft and Xamarin partner by CmonDev on Wednesday November 13, 2013 @12:53PM (#6726956)
Supports both kinds of typing and most functional features. Let's just see what happens when Roslyn finally gets done (something that keeps them busy from keeping innovating on language side)!
Re:Microsoft and Xamarin partner by rayiner on Wednesday November 13, 2013 @12:37PM (#6726825)
What's wrong with the CLR? It seems to be better for a cross language runtime than the JVM.
Re:Microsoft and Xamarin partner by jlgreco on Wednesday November 13, 2013 @03:58PM (#6728456)
CLR does seem much better than the JVM, but my dislike of it comes from what I see of it in the wild. Any randomly chosen JVM program in the real world has a much greater chance of running on my platform of choice than anything that was developed for the CLR. The JVM has a culture of writing things that turn out to actually be cross platform, the CLR does not seem to.

I can count on one hand the programs written in C# that I use in Linux, and those projects have to explicitly support Linux. Compared to JVM targeting projects where the experience is typically "Linux? Well shit, I don't know. Here's the jar, try it out. Oh, it works? Great!"

If I were writing a new language and had to pick one to target, from a technical perspective the CLR would seem to be the clear choice. But I don't think that is the perspective most people are coming from.

Re:Microsoft and Xamarin partner by stusmall on Wednesday November 13, 2013 @01:09PM (#6727062)
I see people say this but I've never seen an actual reason. I know the CLR was built with this in mind with things like CLS but that doesn't seem like that huge of a deal. There are also some naughties in the JVM like how generics are handled, but that seems more like knocks against the JVM as a whole rather than its cross langauge support.

So legitimate question, is the CLR better than the JVM at cross language support and if so what makes it better?

Re:Microsoft and Xamarin partner by pjmlp on Wednesday November 13, 2013 @01:59PM (#6727493)
> So legitimate question, is the CLR better than the JVM at cross language support and if so what makes it better?

Yes in the early days, because JVM was initially designed just for Java and many bytecodes are directly related to Java semantics.

Meaning any language that targets the JVM has to adapt their semantics to Java semantics at the bytecode level, hence the tricks mapping closures to anonymous classes as one example from many.

This got better with the introduction of new bytecodes in Java 7 and the upcoming Java 8, but it is still a Java VM at heart.

The CLR was designed as language agnostic, meaning its design had to support a good implementation of VB, C# and C++ on day one, alongside other languages from Microsoft partners like Eiffel and COBOL as two possible examples.

There is inclusive a .NET ABI for interoperability between languages, CLS (Common Language Specification).

So the bytecode is much more generic and more low level than the JVM bytecode is.

Then thanks to the work done on IronPython and IronRuby, it got the DLR part with allows for better performance of dynamic languages implementations. Since initially CLR was mostly targeted for strong typed languages.

Nowadays both platforms are quite similar in terms of language support.

Re:Microsoft and Xamarin partner by rayiner on Wednesday November 13, 2013 @01:46PM (#6727380)
Tail calls, value types, and generics are the big ones.
Re:Microsoft and Xamarin partner by bad_user on Wednesday November 13, 2013 @06:25PM (#6729394)
Counter examples ..

1) On top of the JVM we've got Scala, Clojure, JRuby, Jython, Groovy, Fantom, very successful, very active, with big communities.

2) On top of the CLR, we've got IronRuby dead, IronPython dead, Clojure.NET almost dead, Scala.NET dead. VB is C# with a different syntax. The only partial success story is F#, executed by Microsoft and I say partial because its impact is less than Clojure, Scala or JRuby, in spite of Microsoft promoting it.

So you see, something is wrong with your assessment and you've been listening too much to marketing pamphlets.

Re:Microsoft and Xamarin partner by rayiner on Wednesday November 13, 2013 @07:14PM (#6729610)
That's not a technical argument. Nobody wants to build on the CLR because its closed source and Microsoft tightly controls it. But the person I replies to claimed it was full of design mistakes, which is different.
Re:Microsoft and Xamarin partner by bad_user on Thursday November 14, 2013 @04:22PM (#6735675)
True, I never read the parent comment, sorry.

The CLR is definitely not full of design mistakes, it's actually quite awesome. But in terms of technical arguments, the JVM is better for dynamic languages, as it can do all sorts of optimizations at runtime that the CLR is not capable of. It's not that Microsoft couldn't improve it, but C# would have nothing to gain as it was designed to not need runtime optimizations (e.g. on the JVM, AOT compiler optimizations can actually get in the way, whereas the C# engineers focus on optimizing the compiler). And the new InvokeDynamic from JDK 7 is amazing. Starting with Java 8, it will even have benefits for static languages, like Scala. Scala for example has the notion of "lazy val", which are final references initialized on first access. In the current implementation, lazy vals have a performance penalty on access, as the generated code implies synchronization on the underlying reference, however Java 8 will make it possible to declare the generated values as being effectively constants.

The JVM also has a more capable garbage collector(s) for more wasteful languages. It makes a world of difference for languages like Scala or Clojure (e.g. functional languages use a lot of persistent immutable data-structures which generate a lot more junk than their imperative counterparts).

On the community side, for the JVM there are more capable libraries for generating bytecode. Also the ECMA standard has been kind of incomplete. For example Mono had to use for a long time their own format for the debugging symbols, while slowly reverse-engineering Microsoft's format. The debugging symbols on the JVM are documented and directly a part of the generated bytecode. Sun made many good choices here too. A JAR is just a zip containing .class files and other resources. It's definitely easier to generate JARs than it is to generate DLLs. I think language developers have a much easier time generating code for the JVM.

There is one feature of the CLR that stands in the way of dynamic languages and that is the reified generics support. The JVM has fewer restrictions, although in truth both suck for languages that are not Java or C#.

Re:Microsoft and Xamarin partner by tedunangst on Thursday November 14, 2013 @12:09AM (#6730661)
IronPython is dead?
Re:Microsoft and Xamarin partner by pnathan on Thursday November 14, 2013 @08:49AM (#6732208)
Technically, I dunno. But I can pick up JVMs and JVM apps for pretty much any OS I want, can't say the same for Mono/.NET. I'd rather use the JVM for cross-platform JIT language work because of this. Further, the JVM has a broad base of development and support; many companies build products around it & there are multiple JVMs. That isn't really the case for .NET.

So in a head to head on tools + community + buyin from multiple vendors, the JVM wins, hard.

Re:Microsoft and Xamarin partner by tracker1 on Wednesday November 13, 2013 @02:44PM (#6727899)
P/Invoke vs JNI is probably the single biggest win for CLR... It's simply much easier to integrate with system libraries in .Net than it is with Java.
Re:Microsoft and Xamarin partner by ygra on Wednesday November 13, 2013 @04:20PM (#6728637)
Re:Microsoft and Xamarin partner by tracker1 on Thursday November 14, 2013 @12:27PM (#6733664)
Yeah, and that came out in 2007.. 6 years or so after .Net and Mono were started...
Re:Microsoft and Xamarin partner by Zigurd on Wednesday November 13, 2013 @11:56AM (#6726474)
Some people prefer C# over Java and VS over Eclipse, and the Xamarin team will probably do a better job of making cross-platform work than most others.

I suspect it will still lead to many lowest common denominator apps, but it's not like Android doesn't suffer from iOS-portitis and hordes of shoddy apps for other reasons, anyway.