componentize-py
componentize-py
Goal: provide a componentize-py
CLI executable which takes a Python app and its dependencies, plus a WIT file, and produces a Wasm component.
This would include four inter-related parts:
make-python-int
, get-python-lint
, make-python-list
, etc.), and also makes them available to Python scriptscomponentize-py
app which embeds the above runtime module, and:
componentize-py
could optionally stop here if requested, just generating the script for type checking by IDEs without creating a component.Kevin's update: got NumPy up and running. They have an emscripten flag, need a wasi flag too. Had to create custom wasi-sdk, wasm-ld, etc. builds to debug. Python fix to import nested shared libraries. Hoping to upstream both. Hoping to post a repo soon. 10+ libraries for NumPy, 40+ Pandas. Polars probably easier than Pandas.
Pandas had lots of name clashes. After renames, it builds. Other things: requires ctypes (not used much, but pulled in on import), mmap (also not used much, but also pulled in on import). NumPy will use ctypes if it exists, so adding it fixed Pandas but broke NumPy. Pandas works with ctypes and mmap stubs. Only when a command, not a reactor.
Wasi-vfs + Pandas had libc collisions. Solved by dropping in wasi-sdk file to override.
Pyodide has a bunch of patches for common libraries.
Emscripten has dynamic linking, so no precendent for using .o and .a files. Each tool has custom build tools for native code. No universal way to handle everything. They all support CFLAGS, generally speaking.
Kevin hacked wasm-ld to generate .a files instead of .so files.
Jamey proposes creating a dlopen/dlsym that uses static tables and statically linked code instead of the filesystem. The .so files would be core wasm modules intended to be statically linked. Could put those in a registry for anyone to use. Could have wasi "wheels". Need to intercept stat calls, not just dlopen.
Joel:
Kevin:
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing