31 December 2021

WebAssembly in Windows XP

While it has been 15 years since I did real Webdev work (php + dhtml mind you), my recently build clang toolchain need some wasm trial. This tutorial https://depth-first.com/articles/2019/10/16/compiling-c-to-webassembly-and-running-it-without-emscripten/ will serve as reference, emscripten itself being mostly python based might be works on XP.

clang download: https://sourceforge.net/projects/xpitory/files/clang/ (25MB)

to check what's supported target:


Compiling add.c example (I added -v to see more detail):


As the article explained browser security mostly prevent direct access like that, so lets skip to python webserver:


To test add.html, 360 Chrome Browser 69 is used:


That's it. I think...


WASI runtime is included in the clang package above, but haven't follow up the article to test it. Basically think of wasi sdk like mingw + libgcc + libstdc++, so instead of relying on emscripten prepared libraries you build your own from scratch. Note that since llvm 12 there is llvm own libc, not sure how different is this from wasi-libc.

next time I will demostrate using clang 10 as usable Visual C++ 2019 build tools replacement, all within XP box.

No comments:

Post a Comment