Emscripten is an LLVM-to-JavaScript compiler. It takes LLVM bitcode - which can be generated from C/C++, using llvm-gcc (DragonEgg) or clang, or any other language that can be converted into LLVM - and compiles that into JavaScript, which can be run on the web (or anywhere else JavaScript can run).
Emscripten is an LLVM-based project that compiles C and C++ into highly-optimizable JavaScript in asm.js format. This lets you run C and C++ on the web at near-native speed, without plugins.
emcmake cmake . emmake make
oh oh....
: (
make clean
git checkout
google errors
stackoverflow
(repeat)
....
these projects weren't trivial
maybe my Emscripten environment wasn't setup correctly
I wasn't familiar with C or C++ world
I wasn't familiar with the build systems
emcc src/*.cpp -o hlslparser.js -s EXPORTED_FUNCTIONS="['_parseHLSL']" --bind -O3
I'm Joshua Koo
I work for Zopim, a Zendesk company
and organize creative coding meetups
twitter: @blurspline
facebook: fb
github: zz85
My forks
https://github.com/zz85/hlslparser
https://github.com/zz85/glsl-optimizer
Documentation
https://github.com/kripken/emscripten/wiki
http://kripken.github.io/emscripten-site/
https://hacks.mozilla.org/2014/11/porting-to-emscripten/ http://mozakai.blogspot.sg/2013/11/c-to-javascript-emscripten-mandreel-and.html http://ejohn.org/blog/asmjs-javascript-compile-target/ https://github.com/gsathya/SDL-emscripten/wiki/Building-with-CMake http://mozakai.blogspot.sg/2012/03/howto-port-cc-library-to-javascript.html http://kripken.github.io/emscripten-site/docs/api_reference/emscripten.h.html#c.em_str_callback_func http://kripken.github.io/emscripten-site/docs/optimizing/Optimizing-Code.html http://kripken.github.io/emscripten-site/docs/api_reference/val.h.html