Live data from Hacker News

WebAssembly: Adding Python support to WASM language runtimes

wasmlabs.dev

71–80 of 88 posts

Re: WebAssembly: Adding Python support to WASM language runtimes

#72
post #5

the issue right now with Python support in WASM (at least for machine learning, the main driver of the language) is that Python is largely a wrapper language and none the utilities that make it so powerful (numpy, PyTorch, JAX) work particularly well in wasm, since it's so limited performance-wise (no FMA, no GPU support). I'm excited for pairing wasm with WebGPU, which will likely unblock these projects from buildin…

Don't expect too much from WebGPU, its hardware target model for the MVP is how version 1.0 of modern GPU bindings used to be several years ago.

In fact, in what concerns compute, it is hardly any better than GL ES compute shaders that Chrome refused to add to WebGL.

Re: WebAssembly: Adding Python support to WASM language runtimes

#73
post #40
post #28

Earlier quoted context omitted.

Wasmtime's `wasmtime-py` embedding in python has support for Wasm Components: https://github.com/bytecodealliance/wasmtime-py#components (disclosure, I helped create it) The remaining piece of the puzzle would be to create a wit-bindgen guest generator https://github.com/bytecodealliance/wit-bindgen#guests for this build of the python interpreter. You could then seamlessly call back and forth between the host and gue…

If you could provide example code for how to do this - how to run a snippet of untrusted Python code using wasmtime-py with a CPU and RAM limit - I would shout it from the rooftops. I think a LOT of people would benefit from clear examples of how to actually achieve this.

is this close to what you had in mind?

https://gist.github.com/pims/711549577759ad1341f1a90860f1f3a...

Re: WebAssembly: Adding Python support to WASM language runtimes

#74
post #71

This looks like a solution looking for a problem, like many others regarding the use of WebAssembly outside of the browser.

Our most immediate goal is to be able to run traditional web apps written in PHP, Ruby, Python mostly unchanged but with the additional layer of isolation and sandboxing. We see this (once fully matured) as a great way to improve security without changing how web developers work

Re: WebAssembly: Adding Python support to WASM language runtimes

#75
post #71

This looks like a solution looking for a problem, like many others regarding the use of WebAssembly outside of the browser.

Our most immediate goal is to be able to run traditional web apps written in PHP, Ruby, Python mostly unchanged but with the additional layer of isolation and sandboxing. We see this (once fully matured) as a great way to improve security without changing how web developers work

Containers and similar OS security features already provide that.

Re: WebAssembly: Adding Python support to WASM language runtimes

#78
post #75

Earlier quoted context omitted.

Our most immediate goal is to be able to run traditional web apps written in PHP, Ruby, Python mostly unchanged but with the additional layer of isolation and sandboxing. We see this (once fully matured) as a great way to improve security without changing how web developers work

Containers and similar OS security features already provide that.

Exploring and providing new and different approaches is worthwhile, and I doubt the tradeoffs of each technology is identical.

Re: WebAssembly: Adding Python support to WASM language runtimes

#79
post #77

I thought this was running python in the browser. I don't understand what's the point of this article. I'm already okay with brython, which is fast enough, but sometimes it generates JavaScript errors, which are difficult to understand.

I believe this is envisioned a bit more like docker-lite minus the os image layer?

Re: WebAssembly: Adding Python support to WASM language runtimes

#80
post #75

Earlier quoted context omitted.

Our most immediate goal is to be able to run traditional web apps written in PHP, Ruby, Python mostly unchanged but with the additional layer of isolation and sandboxing. We see this (once fully matured) as a great way to improve security without changing how web developers work

Containers and similar OS security features already provide that.

Not with that level of granularity. Wasm is able to run in severely constrained environments (ie microcontrollers) and non-posix OS that may not be able to support containers
Post reply on HN