Re:Introducing MIR
by nostrademons on Wednesday April 27, 2016 @07:34PM
(#11585476)
The big innovation there is in realizing that's enough. When I was into language design from 2004-2007, language designers usually assumed people wanted full global type inference. It turns out that local type propagation is an effective 80/20 solution for most practical programming tasks, which opened up a lot of hybrid type systems that would've been far too complex before.
Yes. A blessing in disguise. In hindsight, global type inference seems too unstable. Too much action at a distance; it's hard to evolve a codebase when local changes cascade. Type annotations keep things grounded.
Nemerle had quite an interesting solution to this problem back then.
http://research.microsoft.com/en-us/um/people/moskal/pdf/msc...
Yes. It’s worth pointing out that this is the author’s MSc thesis, submitted in 2005.
What about Crystal? It has quite extensive type inference.
Re:Introducing MIR
by yokohummer7 on Thursday April 28, 2016 @01:00AM
(#11586634)
Unfortunately they also had to narrow down the scope of type inference recently. IIRC type annotations are now mandatory for class-level variables (member variables). This hindered the "Ruby-like" feeling, but they had to give up global type inference because it costed too much memory in some cases. I got an impression that global type inference is difficult (or, costly) in general.
Re:Introducing MIR
by humanrebar on Thursday April 28, 2016 @07:34AM
(#11587980)
I'm not sure I consider Rust to be object oriented.
Type inference in a OO language is still considered, if not impossible, at least very impractical. Swift, Scala and Rust avoid most algorithmic complexity and ambiguity by mostly supporting only type propagation instead of type inference, and thus require annotations on function parameters.