News for hackers. Stuff that matters.
Re:Microsoft takes .NET open source and cross-platform by jkrems on Wednesday November 12, 2014 @12:21PM (#8596747)
Yes, that's why you would use F# in .NET if you want something like Scala. And then I heard many people say that .NET wins again.
Re:Microsoft takes .NET open source and cross-platform by bad_user on Wednesday November 12, 2014 @12:50PM (#8596947)
Meh, F# is pretty good, but Scala has a better type-system. You cannot model type-classes in F# for example and there's some ugliness in it, in a true Ocaml fashion - for example I don't like how you've got to deal with 2 types of generics or the prevalence of "static" methods, static methods that are complete hacks that go back to C++ at least (Scala has no such thing as static methods btw). In many ways Scala is a very elegant language, too bad that many people are scared by these myths that are flying around.

That said, people are missing the forest from the trees. This isn't about the language, but rather about the runtime and the standard library. That's the true value of the JVM, that's the true value in .NET.

There wouldn't be any problem for porting Scala to .NET. Sure, it would be difficult as .NET's reified generics are maybe too limited for Scala's type-system, but I'm sure somebody could make it work, at least partially.

And there was a Scala for .NET, but it lacked interest so it died. But hey, you can still run stuff built in Scala on top of .NET by means of IKVM ;-) Has poor performance compared to a JVM, but then again, people are willing to build stuff in Scala for Android. Also Clojure.NET is doing pretty good from what I've heard.

As a Scala developer that loves Scala and the JVM, I personally find this announcement very exciting. As finally, the JVM has true competition ;-)

Re:Microsoft takes .NET open source and cross-platform by noblethrasher on Wednesday November 12, 2014 @03:02PM (#8597787)
You can model type classes in F#, but it's not pretty[1].

Interestingly, C# can model type classes much more straightforwardly (using implicit conversions), and this is one of the reasons I continue to use it along side F#.

[1]http://stackoverflow.com/questions/9868327/f-type-constraint...

Re:Microsoft takes .NET open source and cross-platform by dragonwriter on Wednesday November 12, 2014 @05:21PM (#8598660)
> There wouldn't be any problem for porting Scala to .NET.

Other than the fact that .NET reified generics and Scala's type system don't play well together, which was one of the big challenges facing Scala.NET.

Re:Microsoft takes .NET open source and cross-platform by seanmcdirmid on Wednesday November 12, 2014 @05:18PM (#8598640)
Scala for .net never actually worked, at least when I tried it. I submitted a few bug reports and started leaning C#.
Re:Microsoft takes .NET open source and cross-platform by lmm on Wednesday November 12, 2014 @12:22PM (#8596754)
F# is elegant but ultimately held back by its lack of higher kinded types.
Re:Microsoft takes .NET open source and cross-platform by kvb on Wednesday November 12, 2014 @02:32PM (#8597618)
Held back from what? I mean, I'd love it even more if it had higher kinded types, but it's a pretty great language as is.
Re:Microsoft takes .NET open source and cross-platform by jakevn on Wednesday November 12, 2014 @04:45PM (#8598421)
It's simply less expressive.

Just as Go is fine without generics, F# is fine without HKTs.

It's a sad realization for those coming from a language that does support HKTs. Still a great language.

Re:Microsoft takes .NET open source and cross-platform by seanmcdirmid on Wednesday November 12, 2014 @05:20PM (#8598655)
I can't tell if you are serious or joking :). it is definitely a trade off to be made, the power offered by higher kinded typing doesnt come for free.
Re:Microsoft takes .NET open source and cross-platform by eloisant on Wednesday November 12, 2014 @12:54PM (#8596972)
F# is not really like Scala in the sense that it's more "extreme" in terms of FP, you can't easy fallback on more classical patterns if FP doesn't work well for your problem.
Re:Microsoft takes .NET open source and cross-platform by edgyswingset on Wednesday November 12, 2014 @01:57PM (#8597411)
Yes you can. I haven't found a traditional Object-Oriented pattern I can't use in F# ... but honestly, I've usually just ended up molding things to fit pattern-matching and reduced the complexity of things in the process.
Re:Microsoft takes .NET open source and cross-platform by frowaway001 on Wednesday November 12, 2014 @05:31PM (#8598716)
> F# [...] more "extreme" in terms of FP

In the sense of lacking higher-kinded types and typeclasses?