3 ms·
C-python runs on a bytecode interpreter, so theoretically you could port the VM to webassembly, provided you remove features that depend on a native operating s
by dangerbird2 10y ago
C-python runs on a bytecode interpreter, so theoretically you could port the VM to webassembly, provided you remove features that depend on a native operating system. More bare-bones interpreters like Lua (http://daurnimator.github.io/lua.vm.js/repl.html http://daurnimator.github.io/lua.vm.js/repl.html) and Chibi-scheme (https://chibi-scheme.appspot.com/ https://chibi-scheme.appspot.com/) which have had their C compilers and vms ported to emscripten can run natively on the web. JIT interpreters like Juajit, Java Hotspot, and pypy, cannot easily run on webassembly or asm.js due to their dependency on native chipsets with self-modifying code support. Also, most of the tooling for wasm and asm.js relies on llvm, so a good amount of work would be required for compiled languages that don't have compilers emmitting llvm bytecode