Hacker News new | ask | show | jobs
by nine_k 467 days ago
JS, interestingly, has a notion of integers, but only in the form of integer arrays, like Int16Array.

I wonder if Typescript could introduce integer type(s) that a direct TS -> native code compiler (JIT or AOT) could use. Since TS becomes valid JS if all type annotations are removed, such numbers would just become normal JS numbers from the POV of a JS runtime which does not understand TS.

1 comments

AssemblyScript (for WASM) and Huawei's ArkTS (for mobile apps) already exist in this landscape. However, they are too specific in their use cases and have never gained public attention.