Live data from Hacker News

Py2wasm – A Python to WASM Compiler

wasmer.io

161–170 of 175 posts

Re: Py2wasm – A Python to WASM Compiler

#167
post #18

So I had a look at the repo/branches at https://github.com/wasmerio/py2wasm . This might be a nit, but in the spirit of OSS: if I'd done this work, I'd have contributed it to upstream Nuitka. I definitely would not have forked a whole new GitHub repo and given it a completely different name. What's the rationale for creating a new project and calling it py2wasm? Am I missing something?

My first thought upon reading Nuitka's name in the article was along the lines of "I hope they've contributed some of this to Nuitka". Not a very nice trend.

What trend?

Forking happens all the time. It's one of the benefits of open source. I've often made PRs on github to projects while shifting projects I work on to my fork since upstreaming can take months or often never happen

Granted, Nuitka is an active project, but wasmer.io is going to have a much more focused desire with their changes that they can deploy, meanwhile getting it upstream will have to go through rounds of review & adjustments

https://github.com/rustwasm/wasm-pack/pull/937 this small change took over 2 years to merge. Open source takes time

Re: Py2wasm – A Python to WASM Compiler

#168
post #104
post #40

What's the hello world wasm file size?

ls -lh hello.wasm -rw-r--r--@ 1 tcole staff 24M Apr 22 14:18 hello.wasm This is on macOS. That is hello.py compiled to wasm with Py2wasm.

Wow! 24M makes it even less practical than interpreted pyodide.

Re: Py2wasm – A Python to WASM Compiler

#169

So I had a look at the repo/branches at https://github.com/wasmerio/py2wasm . This might be a nit, but in the spirit of OSS: if I'd done this work, I'd have contributed it to upstream Nuitka. I definitely would not have forked a whole new GitHub repo and given it a completely different name. What's the rationale for creating a new project and calling it py2wasm? Am I missing something?

Thanks for the feedback! I'm Syrus, main author of the work on py2wasm. We already opened a PR into Nuitka to bring the relevant changes upstream: https://github.com/Nuitka/Nuitka/pull/2814 We envision py2wasm being a thin layer on top of Nuitka, as also commented in the article (not a fork as it is right now, although forking got us into the proof of concept a bit faster!). From what we gathered, we believe that the…

On a different note, will there some technical documents on how exactly to use it, e.g. exporting functions etc...?

By the way is it an alpha release, usable for testing, or something in between?

Re: Py2wasm – A Python to WASM Compiler

#170

Earlier quoted context omitted.

Yeah more honest would have been "2x slower"!

Even more honest would be “on one particular microbenchmark that everybody optimizes for”. That said, this seems like a really cool project that could have some real value! It still fully depends on having the full CPython runtime environment, but that means it could work correctly with most existing code and libraries (including numpy and script).

From what I could tell, Nuitka dynamically loads extension modules so this wouldn't work with Webassembly modules which are statically linked. If I could be enhanced to automatically build wheels of packages like numpy and statically link them, then that could bring extensions to Wasm and be very cool. IIRC, Google does this with their Python apps so the concept does exist but don't think I've seen any OSS tooling trying that.
Post reply on HN