News for hackers. Stuff that matters.
Re:Advanced programming languages (2009) by gaius on Sunday June 19, 2016 @02:16PM (#11933938)
Once you have had real Hindley-Milner Scala feels painfully primitive. Just go straight to OCaml.
Re:Advanced programming languages (2009) by mafribe on Sunday June 19, 2016 @02:41PM (#11934041)
I'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.
Re:Advanced programming languages (2009) by saosebastiao on Sunday June 19, 2016 @03:39PM (#11934340)
I'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.
Re:Advanced programming languages (2009) by dgudkov on Sunday June 19, 2016 @08:29PM (#11935447)
Or go to F# and enjoy the vast universe of .NET.
Re:Advanced programming languages (2009) by gaius on Monday June 20, 2016 @12:16AM (#11936026)
To be fair Scala does have access to the Java ecosystem
Re:Advanced programming languages (2009) by dsacco on Sunday June 19, 2016 @02:41PM (#11934042)
Can you expand on this for someone who is not familiar with Hindley-Milner typing?
Re:Advanced programming languages (2009) by premium-concern on Sunday June 19, 2016 @05:21PM (#11934733)
Hindley-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.

Re:Advanced programming languages (2009) by tome on Sunday June 19, 2016 @06:42PM (#11935071)
> 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.