Hello,
I appreciate the effort behind this PEP and share the goal of establishing a standardized wheel format for Emscripten-based Python distributions. However, I would like to propose an adjustment to ensure the format is inclusive and adaptable to a broader range of use cases, including our own.
Context
We are actively developing emscripten-forge, a general-purpose software distribution for the web browser. Unlike Pyodide, emscripten-forge is not limited to the Python ecosystem. It also supports R, GNU Octave, C++ libraries, and command-line utilities. Our aim is to ensure that the CPython build included in our distribution is compatible with the proposed wheel format.
The naming of the wheel format
The current proposal ties the wheel format explicitly to Pyodide (e.g., pyodide_${YEAR}_${PATCH}_wasm32). While distributions like emscripten-forge can use the same libraries and build flags to maintain ABI compatibility, the name suggests a dependency on Pyodide-specific features beyond just the ABI.
For example, WebAssembly-based software often needs to access external resources, such as making HTTP requests. Pyodide addresses this with a Python-JavaScript bridge based on Emscripten-embind, exposing browser APIs like fetch to Python. Emscripten-forge uses a similar bridge, pyjs, which combines Embind with Pybind11. The APIs of pyjs and pyodide.ffi are functionally similar, but not identical. Fortunately, packages like urllib3 work seamlessly with both bridges (by adding a mock pyodide package), but this compatibility is not guaranteed for all packages if the formats diverge.
Proposal
To avoid fragmentation and ensure broad compatibility, we propose:
-
Renaming the wheel format to emscripten_${YEAR}_${PATCH}_wasm32 to reflect its broader applicability.
-
Defining the ABI independently of the Pyodide distribution, in a neutral repository related to Python packaging. This would allow Pyodide, emscripten-forge, and other stakeholders to contribute as peers.
-
Establishing a common denominator for APIs (e.g., pyodide.ffi and pyjs) that package authors can rely on, reducing the need for downstream patches. This could be a subset of the Pyodide API, that would be importable under a name that does not contain the string “pyodide”.
This approach would foster collaboration, minimize fragmentation, and ensure that the wheel format serves the entire Emscripten-based ecosystem.
Benefits
-
Inclusivity: The format would not be tied to a single distribution.
-
Compatibility: Packages like urllib3 would work across distributions without modification.
-
Future-proofing: A shared specification would encourage consistency and reduce maintenance burdens for package authors.
I believe these changes would strengthen the PEP and benefit the entire community. We would be happy to contribute to this effort, work with @hoodmane, and help define the common ABI and API standards.