Compiling LLJS to asm.js
jlongster.com
jlongster.com
V8 doesn't support it: http://code.google.com/p/v8/issues/detail?id=2455
noasm 285
asm 13
asm 13
noasm 269
That's all that appears in the console. Network and everything looks fine, no 404 or other errors.See my link in the comment below for benchmarks of a sha1 algorithm that shows a good speedup in Chrome by using TypedArrays, but an even greater one in OdinMonkey.
Can you tell me, how did you confirm you wrote valid asm.js and there was no fallback-mechanism kicking in?
I benchmarked my implementation, of course, and noticed a 2x speedup. However, this seems quite less for the this type of low-level algorithm...
P.S. Looking at your code, I can tell it's not asm.js conformant yet, though it should just be a bunch of small tweaks (e.g. an expression like (a+b) will need to be (a+b)|0, etc.).
asm.js is very exciting technology!
As the post says, it's a proof of concept and a way to open up asm.js to people who want to tinker with it without compiling C code with emscripten.
I'd like to explore the possibility of porting some of the C toolchain to the browser too, though. It's possible that it could be quite successful, and in that case LLJS would target people who just want to write small parts of there app for asm.js.
EDIT: to clarify, the ideal solution would be an editor (like codemirror or ace) with a compile+run button that would compile the code down to JS and run it.
http://kripken.github.com/llvm.js/demo.html
Which translates LLVM IR into LLVM bitcode, and then emscripten can translate to JS, all in the browser.
No reason clang couldn't be compiled too, I imagine someone someday will do it when there's a need.
https://github.com/kripken/emscripten
See the BananaBread demo: https://developer.mozilla.org/en-US/demos/detail/bananabread
The ideal solution would be an editor (like codemirror or ace) with a compile+run button that would compile the code down to JS and run it.
The shorter path is something like LLVM, but we could see something like a compiler all in js that can take a large subset of C and compile it.
EDIT: see azakai's comment below which provides much better insight into this
See this project, which compiles SpiderMonkey to javascript via emscripten, which supports asm.js: https://github.com/jterrace/js.js/