I had to do some research to figure out what this is actually doing. When you try to pass e.g. strings through WASM functions you end up writing the data to memory and passing offset / length, which is obviously inconvenient and potentially has security implications. WASM components [1] is a spec that tries to improve on this with an IDL called WIT that lets you define functions that pass complex types with a proper ABI.<p>This all seems sensible for languages like C or Zig that neatly cross compile to WASM. But I was very confused how this could ever work with a duck-typed interpreted language like Python, so I did some digging.<p>Apparently "run your Python as WASM" part is implemented by componentize-py which cross compiles CPython to WASM as libpython3.14.so [2].<p>I'm not sure whether I should be impressed or horrified...<p>[1] <a href="https://component-model.bytecodealliance.org/" rel="nofollow">https://component-model.bytecodealliance.org/</a><p>[2] <a href="https://github.com/bytecodealliance/componentize-py/blob/79e98c3a1788ddf64e5dc675a1631b6f50f3078f/build.rs#L284" rel="nofollow">https://github.com/bytecodealliance/componentize-py/blob/79e...</a>
by csense
|
Feb 4, 2026, 1:39:24 AM
Mruby has something like that build in, you can create a VM which only has basic data types and control flow, no i/o, rng, time, meta programming or any host access possible simply because most functionality is only available as gems and they simply aren’t loaded. Everything you can do with it should be fully deterministic.
by Asmod4n
|
Feb 4, 2026, 1:39:24 AM
It looks really promising but I would love more examples as to how to actually use this with AI agents. Reading the homepage it is not clear if we are meant to have the Agent spun up and act fully in the sandbox (something like the HTTP example) or do we take the result code message from an AI agent and then run it dynamically (with eval?).<p>That being said this is useful even if it wasn't for the running AI agent code aspect, being able to limit ram and cpu usage and time outs makes it easier to run coding based games/applications safely (like battle snakes and Leetcode)
by yohguy
|
Feb 4, 2026, 1:39:24 AM
This looks very neat indeed! Are there any plans to adding network limits? Like, you might want to avoid an agent running code that just requests a resource in a loop, or downloads massive amounts of data.
by bigblind
|
Feb 4, 2026, 1:39:24 AM
Why go this route? Why Python is more powerful than JS is mostly because of third party plugins like pandas which are excplicitly not supported (C bindings, is this possible to fix?)...<p>At that point it might be just easier to convince the model to write JS directly
by gregpr07
|
Feb 4, 2026, 1:39:24 AM
It seems import to highlight these more. Aren't all the limitations of using this based around their limitations?<p>componentize-py – Python to WebAssembly Component compilation<p>+<p>jco – JavaScript toolchain for WebAssembly Components<p>I'm curious how Wasi 0.3 cross language components will go for something like this.
by koolala
|
Feb 4, 2026, 1:39:24 AM
The decorator syntax is neat but confusing to me - I would need to understand exactly what it's doing in order to trust it.<p>I'd find this a lot easier to trust it if had the Python code that runs in WASM as an entirely separate Python file, then it would be very clear to me which bits of code run in WASM.
by simonw
|
Feb 4, 2026, 1:39:24 AM
[dead]
by asyncadventure
|
Feb 4, 2026, 1:39:24 AM