3 ms·
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.
by jkrems 12y ago
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.
- lmm 12y agoF# is elegant but ultimately held back by its lack of higher kinded types.
- kvb 12y agoHeld 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.
- jakevn 12y agoIt'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.
- seanmcdirmid 12y agoI 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.
- bad_user 12y agoMeh, 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 ;-)
- noblethrasher 12y agoYou 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-constraints-and-overloading-resolution http://stackoverflow.com/questions/9868327/f-type-constraint...
- seanmcdirmid 12y agoScala for .net never actually worked, at least when I tried it. I submitted a few bug reports and started leaning C#.
- dragonwriter 12y ago> 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.
- eloisant 12y agoF# 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.
- edgyswingset 12y agoYes 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.
- frowaway001 12y ago> F# [...] more "extreme" in terms of FP In the sense of lacking higher-kinded types and typeclasses?