4 ms·
Python is extremely dynamic and compiling it into wasm would likely be impossible or would generate extremely low-performing code.
by lachlan-sneff 8y ago
Python is extremely dynamic and compiling it into wasm would likely be impossible or would generate extremely low-performing code.
- baq 8y agoYou ‘just’ wasm-compile the whole interpreter. It could even be feasible with a cdn.
- lachlan-sneff 8y agoOh yeah, you can do that. Performance is still quite terrible unfortunately.
- rthy 8y agoAn example of compiling the CPython interpreter to WebAssembly can be found in Pyodide (https://github.com/iodide-project/pyodide/ https://github.com/iodide-project/pyodide/).
- sametmax 8y agoActually pypy and it's jit proves you can make python fast. Nuitka also compiles python, and gain up to x4 in perfs. What more, i think it would make more sense to actually make a bytecode to wasm and vice versa compiler than directly use python code. Besides, performances are not important at first. The goal is not python is the browser, as wasm can go far beyong the web. The greatest assests for wasm IMO is the interroperability.