News for hackers. Stuff that matters.
Re:Show HN: Run Python, Ruby, Node.js, C++, Lua in the Brows... by apignotti on Monday November 22, 2021 @01:36PM (#29309997)
As pointed out by another user, I was actually referring to compiling Python _directly_ to Wasm. Porting the C++ _implementation_ to Wasm is obviously possible.
Re:Show HN: Run Python, Ruby, Node.js, C++, Lua in the Brows... by azakai on Monday November 22, 2021 @02:30PM (#29310630)
Well, Pyodide does port CPython directly to wasm. You're basically running CPython on wasm instead of on x86 - it's just another architecture. That's the natural thing to do I think.

But I see what you're saying, one could also theoretically write a new implementation of the Python language that uses wasm in a more "direct" way. We are exploring exactly that right now using wasm GC, compiling Java and Dart objects directly to wasm GC objects and so forth. That approach still has a lot left to prove, and it may not make sense for all languages, and specifically, I'm not sure if Python would benefit from it at all. So that is very much unclear.

In practice, when you want to run Python on wasm today, I think Pyodide's approach of porting CPython to wasm is the natural way, and it works well. That's what I was getting at.