4 ms·
> Does anyone here know how Standard ML inferred types? SML uses Hindley-Milner (with some modifications to support imperative code). Many statically typed fun
by nyssos 3y ago
> Does anyone here know how Standard ML inferred types?
SML uses Hindley-Milner (with some modifications to support imperative code). Many statically typed functional languages descend from it: Haskell and OCaml are the most prominent.
> Other languages haven't adopted a similar system so there must be some kind of trade off. What was the downside?
If you're asking why existing popular languages don't adopt it: they can't. HM type inference requires a HM type system, and they've committed to a different one. At best you could get good inference on a HM-typed fragment within the language (though even that would mean making a lot of painful tradeoffs) but it would break down the moment it made contact with existing code.
If you're asking why HM languages didn't become more popular? Historical accident, in my opinion. I don't think it has much to do with the type system, given how fundamentally awful Java's is.