Am I the only one who feels like dynamically typed #programming languages are becoming obsolete? Type systems are more expressive and type inference is more ergonomic, so there seems to be few arguments in favor of weaker typing.
@icefox
I think there are still places weakly-typed languages have their uses; I loved writing unit tests in Groovy because it was so easy to make test doubles to do what I needed without having to explicitly mock out irrelevant pieces just to get everything wired up and running.
@icefox Obsolete? No, they're going to stick around whether through legacy language versions or not, there is a decent trend towards stricter type systems in newer languages. However it remains to be seen whether any of them will gain true mainstream industry appeal.
@icefox Common Lisp user here.
There's been a lot of improvement in the Common Lisp world regarding typing, especially regarding compile-time type inference. You can write bits of Lisp code with all types declared up front, and therefore get statically typed code that 1) performs better because of fewer runtime type checks, 2) is safer because type mismatches are signaled at compile time.
This solution doesn't prevent you from dynatyping whenever you need it to or enjoying other Lisp boons.
More expressive than earlier static type systems. Consider C or Pascal's type system, then consider C#/Java, then consider Rust's, then consider Haskell's. The amount of metaprogramming and reasoning about types and their properties gets increasingly more sophisticated, so the guarantees you can make also gets more and more comprehensive. Now you have sum types, product types, dynamic dispatch, generics, higher-kinded data types, and so on. C has `void *` and that's all you get.
@pfm @phoe And I said "becoming obsolete". :-P This doesn't mean they're going away, it means they're starting to look a lot more like statically-typed language. Gradual typing is part of Julia and is now infecting Python for example, and probably Javascript soon (dunno about Ruby)
So my prediction, based off of current data, is in 10-20 years purely dynamically typed languages will be considered as old-fashioned and ill-principled as a large software project without tests is considered now.
@phoe Yeah, I'm aware of that. The Python people at least call it "gradual typing" and it's really nice, but CL naturally had it like 30 years before anyone else.
My main priority is the safety rather than the performance, to be honest
@icefox the benefit of dynamic typing today comes from the all-around flexibility - reflection, serialization, polymorphic behavior.
It's too much power for a reusable module but great for glue and prototype code.