WebAssembly
Emscripten has WebAssembly backend. Have you tried what is the performance?
https://github.com/kripken/emscripten/wiki/WebAssembly
Yes please !
FWIW Webassembly should not bring us much: it's just a new bytecode format. I expect the main improvement will be in page load time. However it comes at the huge cost of browser compatibility.
I'll give it a try at some point, but for now I don't even have a browser installed that supports it. If someone else wants to do a comparison feel free.
Well bypassing js is bound to be faster no ?
Well bypassing js is bound to be faster no ?
asm.js (which lua.vm.js uses) is already specially processed by browsers. While still being valid js (so works at a snail's pace all the way back to pre IE6; which is great if you want to replace javascript's place on the web entirely)
For test purposes I did build to WebAssembly.
I had to make some ugly changes to make it work. The js object is not populated yet. But it works if anyone is interested.
@giann It looks like WebAssembly is now stable, and it would be awesome to get formal support here. I'm hoping to build a cross-platform game using Lua as a scripting language, and being able to write the bulk of my logic (everything except rendering, that is) in WebAssembly calls would be awesome.
Have you tried doing this recently? I think WebAssembly was stabilized earlier this week, so I'm guessing not yet. If you don't have a chance, I may play with it this weekend. I wonder how it'll compare to native JavaScript.
As for this project, is this the proper place to propose merging patches to make it work with wasm?
being able to write the bulk of my logic (everything except rendering, that is) in WebAssembly calls would be awesome.
Why? (I'm not sure what benefit this brings)
I may play with it this weekend. I wonder how it'll compare to native JavaScript.
Let me know how you go.
As for this project, is this the proper place to propose merging patches to make it work with wasm?
Yes.
PS, @giann started the project https://github.com/giann/fengari at my suggestion after discussing this thread elsewhere.
Webassembly should not bring us much
Have you seen the WebAssembly GC/DOM integration page?
Looks like they've added to it a bit since I saw it last; but it's still all just unconfirmed plans with no implementations.This is in addition to the fact that these new features won't ever work in legacy (or current) browsers.
In 3 years when the code exists we can start work on an implementation. In 7-8 years there should be enough browser penetration that we might be able to use it for non-demo purposes.