3 ms·
Once you have had real Hindley-Milner Scala feels painfully primitive. Just go straight to OCaml.
by gaius 10y ago
Once you have had real Hindley-Milner Scala feels painfully primitive. Just go straight to OCaml.
- mafribe 10y agoI'm afraid I disagree. I went from Ocaml to Scala. While full type inference is nice, it's a minor issue in practise, but the vastly bigger library ecosystem that Scala has (due to being a JVM language) isn't. Object orientation also works better in Scala than Ocaml.
- dsacco 10y agoCan you expand on this for someone who is not familiar with Hindley-Milner typing?
- premium-concern 10y agoHindley-Milner means that you – unlike Scala – don't need to provide any type annotations at all as they can all be inferred. This comes at a steep price, as HM-inferable typesystems are very limited, and most languages have in fact a typesystem that might be based on what HM can infer, but have extensions that require type annotations. In the end Scala's requirement to annotate input parameters is not a big deal, as this only enforces what Haskell/Ocaml/... consider to be best practice anyway.
- tome 10y ago> In the end Scala's requirement to annotate input parameters is not a big deal, as this only enforces what Haskell/Ocaml/... consider to be best practice anyway. It's a huge deal. I always write type signatures once I know what they are, but a lot of the time I get the compiler to infer them for me which saves significant headaches.
- saosebastiao 10y agoI'm afraid you have it backwards. Scala's type inference comes at a slight cost (you have to annotate parameters), but it enables a much more powerful type system than even HM allows for.
- dgudkov 10y agoOr go to F# and enjoy the vast universe of .NET.
- gaius 10y agoTo be fair Scala does have access to the Java ecosystem