Re:Rust and WebAssembly in 2019
by lachlan-sneff on Saturday December 15, 2018 @04:56PM
(#18690566)
Python is extremely dynamic and compiling it into wasm would likely be impossible or would generate extremely low-performing code.
[ Parent
| on HN ]
You ‘just’ wasm-compile the whole interpreter. It could even be feasible with a cdn.
An example of compiling the CPython interpreter to WebAssembly can be found in Pyodide (https://github.com/iodide-project/pyodide/).
Re:Rust and WebAssembly in 2019
by lachlan-sneff on Saturday December 15, 2018 @05:08PM
(#18690641)
Oh yeah, you can do that. Performance is still quite terrible unfortunately.
Actually 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.