JavaScript! • Works with LLVM bitcode (produced by llvm-gcc or clang)! • Generates asm.js formatted JavaScript! • Works anywhere JavaScript will run (browsers, node, etc)
instructions (or simply Google ‘emscripten’) • SDK provides a toolchain to interact with C/C++ • emconfigure/emmake to compile an existing project • emcc to compile .c/.cpp files manually
of grid points (example is 614x428) • Original JS code was around ~130ms to ~160ms in Chrome and Firefox, respectively • Native C version is ~26ms • Chrome was ~88ms per grid • Firefox hit ~40ms per grid (?!) • Code is cross platform • OpenGL is compiled to WebGL
well (IE11 looks much better) • Not all C calls optimized for JS (hypot) • Editing and debugging code “difficult” • Have to get into the mindset of working on a heap with things like ‘malloc’ and ‘free’