-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Smaller wasm modules / binaries. #98
Comments
Hi @JamesParrott. Yeah, the size is annoying, I agree. You can reduce it somewhat using e.g. Otherwise, I don't know of any great options for significantly reducing the component size and still keep it self-contained. Neither Python (as a language) nor CPython (as an implementation of the language) were designed to optimize for small, self-contained binaries. However, if you drop the "self-contained" requirement, you have a lot more flexibility. That's what #28 is about. The idea is that we could upload libpython.so and the standard library to a registry which the host has access to. Then I've been waiting for projects like warg to mature so that we actually have a registry to point to, and I know there has been recent progress on that front. I'm not sure I'll have time soon to work on #28 myself, but I'd be happy to mentor anyone who wants to tackle it. Regarding the host side of things, are you referring to the size of the |
Thanks Joel. I'll give wasm-tools a try. I've got no firm requirement. Just a dream of creating light web apps from statically typed Python code, without a O(10)MB download for Pyodide etc. I don't need all the bells and whistles, so perhaps I need more of a transpiler. Or just another language. The thing I'm currently working on is not unportable to JS. The shared object approach is interesting - thanks. It looks similar to the repackaging of Python that distros do. This is all very new to me, but I've done a little bit with .so binaries before. I'll have a look. Re: the host, it's not the wheel or sdist size. When running I prefer web app bundles to be smaller than that, but others might not mind, and it's intended for different purposes. Overall componentize-py is super impressive. It's a compiler for a language that's notoriously tricky to compile. |
Yeah, that's just the result of
Don't be too impressed -- |
Oh I see - thanks for the explanation. I thought the two sizes were suspiciously similar - the original component's functionality was duplicated.
componentize-py sounds more similar to Pyodide than I realised, from your description, but without Emscripten :) . |
Great library everyone - I'm really impressed. I reproduced the example just fine on Windows 11.
Anyway, maybe this is just the nature of Wasm Components, or it's necessary to support every possibility of a dynamic language like Python. And maybe there are settings I've not discovered yet.
But is it possible to produce a Hello World example that's much smaller than 35MB (and to reduce the size of the wasmtime host side bindings from 30MB)?
The text was updated successfully, but these errors were encountered: