Re:Type Systems (2004) [pdf]
by rurban on Friday September 01, 2017 @07:02AM
(#15147432)
Most of them are type hints.
Perl6 and cperl have a similar distinction. Hard types and compiler hints. In an FFI context it's a hard type, with arrays or structs also, with primitives the compiler may ignore it or allow otherwise permitted temporary casts.
[ Parent
| on HN ]
> 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.
Yes, and much more. types also allows lowering generic ops to fast ops, which is typically 10x faster then without types.