3 ms·
Modern static typing isn't remotely related to typing from the "1970's"
by andybak 11y ago
Modern static typing isn't remotely related to typing from the "1970's"
- vanderZwan 11y agoWell, depends on what you mean with modern static typing. In some ways, mainstream programming is finally catching up with ML, which is from the 1970s. If you mean cutting edge PL research it's a different story of course.
- CuriousSkeptic 11y agoOk, 1969, but fairly close! https://en.m.wikipedia.org/wiki/Hindley–Milner_type_system https://en.m.wikipedia.org/wiki/Hindley–Milner_type_system
- nostrademons 11y agoThe type systems in modern languages like Swift, Rust, Scala, Haskell, and even Kotlin go way beyond classical Hindley-Milner. Classical Hindley-Milner gives you parametric polymorphism over algebraic data types, along with an inference algorithm. No subtyping, no casts, no coercions, no overloading, no polymorphic literals, no interfaces. You basically get SML. Consider that in 2006, MPTCs with fundeps was the preferred way to represent "a collection of items that can be compared via equality" [1]. Associated types were a vague research idea [2] that showed a lot of promise, but hadn't been implemented in any language with type inference (they did exist in C++ templates, but C++ isn't exactly what people think of when you say "modern type system"). Now both Rust and Swift feature polished implementations of associated types and use them pervasively in the standard library. [1] https://en.wikibooks.org/wiki/Haskell/Advanced_type_classes#Multi-parameter_type_classes https://en.wikibooks.org/wiki/Haskell/Advanced_type_classes#... [2] https://prime.haskell.org/wiki/AssociatedTypes https://prime.haskell.org/wiki/AssociatedTypes
- naasking 11y ago> You basically get SML. SML is still more usable than the statically type languages in use the most today (C++ and Java).
- nostrademons 11y agoYes, but by "modern static typing" I think we're talking about the latest generation of languages that have come out since 2010 (Swift, Rust, Kotlin, etc.)