Compatibility with Emscriptenforge, Pyodide, Pyscript? #44
-
.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Great questions. Thanks for taking an interest in CoWasm!
In cases that don't necessarily have much to do with Python, I'm probably just using npm. It's a relatively mature package format at this point. Example: https://www.npmjs.com/package/dash-wasm For Python modules, I tried everything I could think of, and I'm currently happiest with "a .tar.xz file that when extracted can be imported by Python". It's a pretty simple format. I tried a dozen or so popular Python packages (e.g., pandas, sympy, numpy, etc.) and compressed it's usually about 5% the size of what pip install produces (uncompressed), so more suitable for the web. It's also easy to extract and decompress just using code in the Python standard library.
CoWasm currently uses the same dynamic linking WASM format as PyOdide/Esmscripten (i.e., clang's
CoCalc doesn't have anything to do with CoWasm yet. The public website CoCalc.com does have a large number of conda packages preinstalled, which people find very useful. See https://cocalc.com/software/python for a list of the ones from Anaconda. CoWasm itself doesn't technically currently have any relationship with CoCalc or Conda. CoWasm is a distinct BSD-licensed attempt to make something similar in spirit to PyOdide, but starting with Zig/Clang/Node.js, and trying to use lots of existing popular open source libraries like https://www.npmjs.com/package/memfs, which obviously emscripten couldn't use since it was such a pioneering project. (That said, I've had to fix a number of bugs in memfs, etc.) One thing is that CoWasm directly uses pip to install pure python packages now. I spent the last two weeks implementing enough of the TCP networking stack in WASM (via posix-node). This is kind of like https://github.com/emscripten-core/emscripten/tree/main/tools/websocket_to_posix_proxy, except implemented using node.js instead. I haven't quite got extension modules to build via pip yet, but that's on my roadmap. I guess my plan is more to install via pip, then post-process the results in some settings to be more suitable for distribution, since what pip produces or uses is not optimized for size.
I don't know. Thanks for the additional information about these projects. |
Beta Was this translation helpful? Give feedback.
Great questions. Thanks for taking an interest in CoWasm!
In cases that don't necessarily have much to do with Python, I'm probably just using npm. It's a relatively mature package format at this point. Example: https://www.npmjs.com/package/dash-wasm
For Python modules, I tried everything I could think of, and I'm currently happiest with "a .tar.xz file that when extracted can be imported by Python". It's a pretty simple format. I tried a dozen or so popular Python packages (e.g., pandas, sympy, numpy, etc.) and compressed it's usually about 5% the size of what pip install produces (uncompressed), so more suitable for the web. I…