typescript has no explicit number types and all numbers in js are f64...can the ts->c compiler infer usage of u32 if it can prove that function calls only from say typedarrays and add the proper types? or will it just convert typedarray access to f64?
maybe this needs some sort of subset of the typescript language where u can optionally pass in proper number types instead of "number" to force the compiler to increase strictness...but then it wouldnt be typescript lol idk...or just fork typescript.
cuz i think v8 can do this where if it sees that u are calling method on u32 typed array, it will compile down to u32 in the assembly.
typescript has no explicit number types and all numbers in js are f64...can the ts->c compiler infer usage of u32 if it can prove that function calls only from say typedarrays and add the proper types? or will it just convert typedarray access to f64?
maybe this needs some sort of subset of the typescript language where u can optionally pass in proper number types instead of "number" to force the compiler to increase strictness...but then it wouldnt be typescript lol idk...or just fork typescript.
cuz i think v8 can do this where if it sees that u are calling method on u32 typed array, it will compile down to u32 in the assembly.