4 ms·
I've spent a fair bit of time with both. Personally, I don't find the two to be all that comparable -- they're fairly distant cousins. F# tends to stick much m
by bunderbunder 8y ago
I've spent a fair bit of time with both. Personally, I don't find the two to be all that comparable -- they're fairly distant cousins.
F# tends to stick much more closely to its ML roots, and fairly scrupulously retains a more ML flavor except when necessary to achieve good interop with the .NET ecosystem.
Scala, on the other hand feels less to me like a dialect of ML and more like an ML-flavored object-oriented language, because it mixes in OOP-style features much more freely. Its algebraic data types, for example, are explicitly implemented as class clusters. A lot of people like this, others see it as an anti-feature. Where you fall probably depends on how you feel about the relative merits of OOP and FP.
It's also, for better or worse, less concerned with maintaining good interop with the rest of the ecosystem. Consuming F# modules from C# isn't always pretty, but it's always possible. There will be C#-friendly wrappers, but creating them is a matter of aesthetics rather than necessity. Consuming Scala modules from Java, though, frequently requires creating wrapper libraries. On the upside, this does mean that Scala gets to have things like typeclasses, which the F# team has kept out of the language due to concern about how they would impact interoperability with the rest of .NET.
Last but not least: F# has type providers. Scala has implicits. F# has quotations. Scala has more stuff that's also called implicits.