https://github.com/ern0/howto-wasm-minimal Skip to content Sign up * Product + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Learning Lab + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} ern0 / howto-wasm-minimal Public * Notifications * Fork 7 * Star 132 How to create minimal wasm module MIT License 132 stars 7 forks Star Notifications * Code * Issues 0 * Pull requests 2 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 2 branches 0 tags Code Latest commit ern0 updated readme ... 28bf326 Mar 30, 2022 updated readme 28bf326 Git stats * 31 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .gitignore js2c fn call works Mar 20, 2022 LICENSE Initial commit Mar 20, 2022 README.md updated readme Mar 30, 2022 build.bat Added .bat build Mar 30, 2022 build.sh Added .bat build Mar 30, 2022 inc.cpp published Mar 27, 2022 index.html published Mar 27, 2022 script.js published Mar 27, 2022 volt.jpg grayscale works Mar 26, 2022 View code howto-wasm-minimal Goals Mystic issue Install Summary Why WASM? Try it README.md howto-wasm-minimal How to create minimal wasm module - PoC Goals * use no Emscripten or any libs * simple toolchain, compile to wasm in a single step * wasm may use memory prepared by JavaScript * do something relative compute-intensive * do something visible Mystic issue Symptom: on some systems, the linker may hang, or produce output file with correct size but full of zeros (that's why build script contains a hexdump as last step). Solution: update your linker. More info: https://stackoverflow.com/questions/71573019/ cant-compile-to-wasm-on-linux Install You need CLANG and CLANG's linker (LLD). Tested on versions 13 and 14. Debian nightly pacakges: https://apt.llvm.org/ On Windows, you may use Chocolatey package manager to install CLANG: https://chocolatey.org/ Summary Why WASM? Writing web app in any language which is not JavaScript is just pure joy. Try it The color change and the blur effect is a WASM module, written in C: https://linkbroker.hu/stuff/howto-wasm-minimal/ About How to create minimal wasm module Resources Readme License MIT License Stars 132 stars Watchers 3 watching Forks 7 forks Releases No releases published Packages 0 No packages published Languages * C++ 43.4% * JavaScript 39.0% * HTML 9.2% * Shell 4.7% * Batchfile 3.7% * (c) 2022 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. 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.