Re:How JavaScript engines achieve great performance
by FpUser on Thursday November 25, 2021 @11:56PM
(#29347583)
Typescript compiles down to Javascript. And this is the problem. When I say uint16_t in C++ I know how it will be kept in RAM and what I can do with it, how I can pack things together etc. etc. TS lacks this abilities. You can play with terminology all you want but it does not change simple facts.
[ Parent
| on HN ]
Re:How JavaScript engines achieve great performance
by kaba0 on Friday November 26, 2021 @04:53AM
(#29348825)
You could (probably can) compile C++ to JS. What will that be? In the end, code is just data operating on data with no semantics. Your uint16_t is only meaningful to the compiler, the same way as TypeScript types are (with a few caveat).