3 ms·
Hard disagree: interfaces should be statically typed, but implementations need not be unless it adds value. Languages like python with a typechecker are much c
by joshuamorton 7y ago
Hard disagree: interfaces should be statically typed, but implementations need not be unless it adds value.
Languages like python with a typechecker are much closer to rust (safe, but with the ability to have unsafe areas) than true statically typed langs, because static languages don't give easy escape hatches (you end up having to cast everything, no static Lang I'm aware of ships with an Any type like python's).
- _jsdw 7y agoRust is a true statically typed language; `unsafe` in rust relates to code that violates memory safety guarantees, but you can't escape the static type checking using it. Rust actually has an `Any` trait which allows for a certain amount of runtime type asserting if you don't know what concrete type you'll be working with.
- joshuamorton 7y agoThis is a mostly semantic distinction. Rust provides safety guarantees, but you're able to opt out of some of those in certain well defined ways.
- colatkinson 7y agoNever actually seen it used, but: https://en.cppreference.com/w/cpp/utility/any https://en.cppreference.com/w/cpp/utility/any
- coldtea 7y ago>no static Lang I'm aware of ships with an Any type like python's). Isn't that similar to the dynamic type C# has had long before Python? https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/types/using-type-dynamic https://docs.microsoft.com/en-us/dotnet/csharp/programming-g...
- joshuamorton 7y agoLooks like it, TIL. Thanks for the link.