Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But none of these languages will ever adopt Hindly-Milner type inference, which is the staple of the ML family. I mean, you have fist class functions and pattern matching in Erlang, and a library for pattern matching in Clojure, but this doesn't make them members of the ML family. And I really don't see Java and friends evolving much beyond that.


Honest question: Why would/could they not? There has been a ton of research published on extending HM type inference to support structural subtyping, row polymorphism, extensible records which very closely model many (but not all) of the concepts in Object Oriented systems.


That's actually a good question. I suppose that it would be possible in theory to try and reconcile the two, but I don't see that happening. And I don't know how much you can extend HM to support the full C++ featureset. I'd be surprised if it was possible.


I haven't seen the entirety of C++'s feature set added to an HM system, but even OCaml has an OO system that's fairly complete. Many new functional languages are adopting Daan Leijen's extensible records approach which can model OO fairly well. http://research.microsoft.com/pubs/65409/scopedlabels.pdf

All of these are extensions of ML that are shipped into production today, so it looks like more than just a theory at this point.


It looks like Apple just released Swift two weeks after my original comment/prediction. Does this change your mind?


Not full-on Hindly-Milner, of course, but it seems like C++11's auto is a move in that direction.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: