WordPress / WordPress/wordpress-playground
Emscripten Docs, Materials, Learnings
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 462
- Avg merge
- 18h 44m
- Merged PRs (30d)
- 33
Description
Emscripten lacks developer resources. Since we often reverse engineer Emscripten code, let's centralize our efforts, document our learnings, and use this issue as a hub for everything we learn about Emscripten.
- Compilation flags
- There are two layers of flags: Upstream Clang flags (including some related to WebAssembly!) and Emscripten-specific flags
- Memory
- Emscripten-built binaries are 32 bit
- The 64 bit memory proposal is in the works
- Meanwhile, would the
-sMEMORY64=2flag help with anything? The docs says: "The “architecture” to compile for. 0 means the default wasm32, 1 is the full end-to-end wasm64 mode, and 2 is wasm64 for clang/lld but lowered to wasm32 in Binaryen (such that it can run on wasm32 engines, while internally using i64 pointers). Assumes WASM_BIGINT."
- WASI
- Emscripten is unlikely to support WASI. Any WASI support in Chrome will come through a third-party JavaScript integration library.
- https://github.com/WordPress/wordpress-playground/issues/290
- Async
- Filesystem
- The JavaScript filesystem API works, but it may not get significantly more features
- The Emscripten team heavily invests in a C-level filesystem implementation called WASMFS. It requires pthreads or JSPI.
- adamziel/emscripten-wasmfs-demo repository has a few examples of WASMFS
- OPFS Explorer enables browsing OPFS in chrome devtools
- I don't know any prior art on synchronizing concurrent writes from multiple workers to OPFS
cc @brandonpayton @bgrgicak @mho22 @psrpinto @akirk
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing Emscripten references in settings.js, the asyncify documentation, the settings reference, and the linked WASMFS examples. Organize the documented learnings about compilation flags, memory, WASI, async behavior, and filesystems into a maintainable developer-resource hub, with each topic supported by the cited references.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, wasm
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100