4 ms·
Have you seen Extism? We call it a "plugin system", but it's far more generic than that.. just hard to market a "general purpose universal code runtime". Pytho
by nilslice 4y ago
Have you seen Extism? We call it a "plugin system", but it's far more generic than that.. just hard to market a "general purpose universal code runtime".
Python SDK: https://extism.org/docs/integrate-into-your-codebase/python-host-sdk/ https://extism.org/docs/integrate-into-your-codebase/python-...
Python is 1 of 15+ languages we support, and as far as I know it's the easiest way to setup a wasm engine in your app, load wasm code, and call a function using complex data I/O.
I'm one of the authors - happy to share more about it, or if you'd like to join our Discord we have lots of active users and contributors there: https://discord.gg/cx3usBCWnc https://discord.gg/cx3usBCWnc
- nilslice 4y agoOh, and here's an example (test) showing how to construct a "manifest" to control the cpu/memory limits: https://github.com/extism/extism/blob/main/python/tests/test_extism.py#L111-L112 https://github.com/extism/extism/blob/main/python/tests/test... cpu is really controlled by # milliseconds until the wasm code is trapped.
- simonw 4y agoThat looks like exactly the level of control I've been hoping for in terms of sandboxing. This is really promising!
- simonw 4y agoI hadn't looked at that one. It looks very promising! Definitely has better documentation than the other options I've looked at. I see that the library itself is available in Python, but this page https://extism.org/docs/category/write-a-plug-in https://extism.org/docs/category/write-a-plug-in currently only lists Rust, JavaScript, Go, Haskell, AssemblyScript, Zig and C. Any chance Python might get added to that list as well? Just found https://github.com/extism/extism-sqlite3 https://github.com/extism/extism-sqlite3 which is very relevant to my interests too!
- bhelx 4y agoExtism does not yet support writing the plugins (our term for Wasm guests) in python. I have been working on javascript support[1] and I think I could use a similar strategy to support python. If you are at all interested in following along or helping out you should join our discord.[2] I just started a #python-pdk channel there. [1] https://github.com/extism/js-pdk https://github.com/extism/js-pdk [2] https://discord.gg/mAADpt9r https://discord.gg/mAADpt9r