3 ms·
> Python [...] could be difficult to port to Web Assembly down the road The Pyodide project has already compiled CPython to WebAssembly - why is that a worse s
by pansa2 5y ago
> Python [...] could be difficult to port to Web Assembly down the road
The Pyodide project has already compiled CPython to WebAssembly - why is that a worse solution than compiling one of these other scripting language interpreters to WASM?
- zurn 5y agoIndeed, Python is one of the most well behaved scripting languages for WebAssembly, and people were running in browser for a good while already with WebAsembly predecessors (emscripten and asm.js).
- germandiago 5y agoThis was not my information at the time. But thanks for the info, it is helpful. With https://github.com/pybind/pybind11 https://github.com/pybind/pybind11 there is really great integration with C++ and Python is my second home after C++ actually. Anyway, I am quite happy with Wren and it seems to be fast (not a requirement for my project, though)
- pansa2 5y agoOne issue could be size - CPython's native binary is an order of magnitude larger than Lua's, and the same is probably true when using WASM. Perhaps something like MicroPython could solve that, though.
- fulafel 5y agoYep, that exists: https://github.com/micropython/micropython/tree/master/ports/javascript https://github.com/micropython/micropython/tree/master/ports...
- tyingq 5y agoWhile it "works" python under WASM means downloading a very large interpreter and runtime and waiting quite a long time for it to start up. On my i5 laptop, this demo downloads about 8Mb and takes a couple of seconds to load up: http://karay.me/truepyxel/demo.html http://karay.me/truepyxel/demo.html Lua, by comparison, is very small and has a fast startup under WASM.