You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's basically an implementation of "fork + exec" but entirely within a single WASM instance, which is I think simple, flexible and fast, but of course has drawbacks. The way it works is:
Make a copy of all state -- memory, WASI, etc.
Load the program to run as a dynamic library -- for this to work, the program needs to be built -fPIC, which most WebAssembly programs aren't.
Runs the main (or similar) function in the dynamic library
After termination of the program, restores state from the copy.
Also keep track of unloading dll's from memory.
When running under node.js there's also a different fork/exec implementation, but it's less accurate. There's also an implementation that works very well for Python. (These are for running native subprocesses, and I care about this mainly so I can use pip to install and building C compiled Python packages from source...)
The steps above are just one neat way of efficiently running programs without the complexity of multiple WebAssembly instances, which leverages this packages https://www.npmjs.com/package/dylink that I wrote. It has drawbacks, of course. cowasm could also be extended to run programs in other ways.
I wonder, how easy or difficult will it be to port programs
// I plan to study and do experiments, EDIT: first plan:
https://github.com/sagemathinc/cowasm/blob/main/Dockerfile https://github.com/sagemathinc/cowasm#build-from-source
EDIT:
related:
The text was updated successfully, but these errors were encountered: