4 ms·
It's not that simple. You can easily design type system + compiler, which will have destructive "attitude". It's no different from human interactions and how
by przemo_li 6y ago
It's not that simple.
You can easily design type system + compiler, which will have destructive "attitude".
It's no different from human interactions and how being "right" is not always "being constructive".
Best type systems have low mental overhead, can be selectively applied (to benefit when it's profitable, and to avoid costs where it's too costly), are humble, and are good companions by helping developer learn the domain space.
E.g. 1 there are good blog posts describing how you can write Haskell code by just asking Haskell compiler what type is needed to fit with the rest of your code. Step by step you fill in the blanks.
E.g. 2 there are good videos from Clojure about how you can follow types to implement a new idea.
Counter example:
Neither 1) nor 2) is possible in C, and yet you pay hefty price mandated by C type system.
All 3 type systems have their own trade offs. Picking one that is most aligned with goals of your project does have impact :)
- lmm 6y agoWhat C has isn't really a type system, it's more a system for expressing storage characteristics. Custom types are cumbersome, polymorphism is nonexistent, but blatant errors are not prevented.