Closed renaudpawlak closed 8 years ago
This does not make much sense for now regarding other priorities. We should take a look at the webassembly project and see whether it makes sense to support anything in JSweet. But for now it is not a priority.
It should be possible in JSweet to write asm.js modules.
The good news is that Java, by supporting integers and floats, could be a good environment to generate type-checked asm code (so is C++). Of course there would be the limitations imposed by asm.js (only numbers, no strings, no objects, ...). NOTE: on contrary, TypeScript, with its sole number is not well armed to type check asm.js, as said here.
So, the idea would be to have an annotation to generate the "use asm" directive. That could be a specific annotation or a generic one. Let us imagine a generic
@StringDirective
annotation. We could have something like:Which would generate as the following TypeScript code:
NOTE: my knowledge of asm.js being still quite recent, I may be getting some things wrong so please correct me if it is the case.