4 ms·
The fact that you can't represent function pointers (not closures, just plain old C-style function pointers) in asm.js severely limits its usability as a target
by rntz 14y ago
The fact that you can't represent function pointers (not closures, just plain old C-style function pointers) in asm.js severely limits its usability as a target language for even C-like languages.
- marijn 14y agoCan you explain the use case where you need need function pointers but closure pointers won't do?
- rntz 14y agoOh! Closure pointers would absolutely suffice. But as far as I could tell, asm.js doesn't support closure pointers either. Obviously I could use a value of "unknown" type to pass them in, but section 2.1.9 says "Since asm.js does not allow general JavaScript values, the result must be immediately coerced to an integer or double." So I'm under the impression that asm.js can't really deal with closures or functions as values. Am I reading the docs wrong? I hope I am.
- evincarofautumn 14y agoLooks like it’s in the works. https://github.com/dherman/asm.js/issues/4 https://github.com/dherman/asm.js/issues/4
- deleted 14y ago[deleted]