|
|
|
|
|
by readittwice
2612 days ago
|
|
Well I am skeptical about performance improvements due to type annotations as well. Other languages have similar different systems and didn't get faster. Dart had gradual types but didn't enforce them at runtime because of performance. The PyPy devs don't believe that type annotations help them for performance (http://doc.pypy.org/en/latest/faq.html#would-type-annotation...). Also there is no JS engine that uses TypeScript annotations so far to improve performance. Types are usually on the wrong boundary: e.g. Integer doesn't state whether that value fits into a register or is a Bignum. Also: Aren't some type checks quite expensive? So more expensive than a simple map/class/shape check? E.g. passing an array from untyped code to a signature with something like `Array<Integer>`. Wouldn't a runtime that verifies signatures have to check all elements in the array to be actual Integers? |
|