3 ms·
> Most of them are type hints. Perl6 and cperl have a similar distinction. Why are so-called “type hints” interesting in? The real value in a type system is:
by catnaroek 9y ago
> Most of them are type hints. Perl6 and cperl have a similar distinction.
Why are so-called “type hints” interesting in? The real value in a type system is:
(0) Not having to worry about large classes of mistakes. They just don't happen in a legal program.
(1) Enforcing abstractions, i.e., not allowing library users to make decisions based on library implementation details.
(2) Managing the verification effort. Proving that a program meets its specification becomes much easier when components are guaranteed not to violate the assumptions made in each other's design.
A “type system” that can't do any of these is just a waste of engineering effort.
- rurban 9y agoYes, and much more. types also allows lowering generic ops to fast ops, which is typically 10x faster then without types.
- catnaroek 9y agoI'd love to read about how you can use so-called “type hints” to mechanically rule out programs that inspect the internal representation of abstractions provided by third parties.