So I think we are more seeing an ongoing convergence on combined static/dynamic typing approaches.
So I think we are more seeing an ongoing convergence on combined static/dynamic typing approaches.
For C++ et al this is things like the 'auto' keyword that allow skipping the type specification where the compiler can work it out.
The end-game is specifying just enough type information that it's still understandable to both humans and compilers.
I firmly believe type inference is the future. Most objects in dynamic languages are statically typed anyways, the type just isn't exposed at compile time.
For instance, how often do you declare a variable as `int`, when what you really want to say is “an integer in the range 0...100”? A few languages (e.g. Eiffel) provide a formal mechanism for declaring these sorts of constraints, but most don’t, and you end up putting what should be declarative type-level information into the body of your code instead.
And then there’s “cutting-edge” stuff like dependent types, where you really want to express one argument’s type in terms of another argument’s, a classic example being an array indexing method, where you really want to declare the index at compile time as an integer in the range `0..<array.length`, and let the type system propagate that rule and its implications throughout the code that uses it. Whereas most “modern” languages chuck a run-time error if you’re lucky; or just ralph and dump stack like some antiquated 1970s throwback (yeah, looking at you, Apple’s Swift).
3/10 Could do much better.