logoalt Hacker News

rurbantoday at 1:18 PM1 replyview on HN

Nonsense. You get the simplification and faster development times of knowing some variable types statically, plus the performance improvements for the compiler which can move the type checks from runtime to compile-time. Plus all the new optimization possibilities.

Common Lisp showed you the way. But almost none looked at it. Only PHP did.


Replies

dajonkertoday at 6:35 PM

At least CPython and CRuby (MRI), the most common implementations of each language, ignore all type hints and they are not able to use them for anything during compile or runtime. So the performance argument is complete nonsense for at least these two languages.

Both Python and Ruby (the languages themselves) only specify the type hint syntax, but neither specifies anything about checking the actual types. That exercise is left for the implementations of third party type checkers.

show 1 reply