Hacker News new | past | comments | ask | show | jobs | submit login

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.



Can you explain the use case where you need need function pointers but closure pointers won't do?


Oh! 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.


Looks like it’s in the works.

https://github.com/dherman/asm.js/issues/4




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: