4 ms·
asm.js doesn't support GC... for now. Read the FAQ for more details: http://asmjs.org/faq.html http://asmjs.org/faq.html Even if it never supports GC, it's no
by jdonaldson 14y ago
asm.js doesn't support GC... for now. Read the FAQ for more details:
http://asmjs.org/faq.html http://asmjs.org/faq.html
Even if it never supports GC, it's not out of the question to use historically GC languages like Java. It's just a matter of manually releasing memory through the API. It's a pain, but it's one i would gladly bear for better performance on some specific methods.
- jkrems 14y agoWhat's the point of writing something in Java if you have to do manual memory management and can't use any of the platform library? asm.js makes sense for performance critical code that you would in other languages write in C. So, in a game you could write your game engine or at least your graphics engine in C/C++ and then add a scripting language for logic (JavaScript/Java/Python/Lua/...). You could compile the engine from C/C++ to asm.js and the game logic to JavaScript. But compiling a classical high(est) level, GC collected language that is mostly defined by its standard lib (read: Java) to asm.js seems weird.
- jdonaldson 14y agoManaging memory in Java is not common, but it's not exactly weird either. Off the top of my head, you need to make memory related API calls for dealing with ORMs, object pools, and native externs.