Hacker News new | ask | show | jobs
by rubber_duck 3757 days ago
>For example: NPM compiling C-dependencies together with ECMAScript/JavaScript into a single WebAssembly package that can then run inside the browser.

The reason you'd write stuff in C is (aside from performance) to access native API. Browsers and WASM doesn't let you do that.

WASM in the Node could let you do that - meaning that you would get cross platform assembly packages instead of ELF or w/e binary - but you would still need APIs on the platform and often for C the way that's handled is preprocesor macros that choses which platform you are compiling to - so you can't just "compile to WASM and then magic" even with WASM you'd have to "compile to WASM + POSIX and WASM + Win32" if you want to run on POSIX/Win32, etc. for all platform/API permutations.

TL;DR WASM is big but it won't quite be the abstract virtual machine like say JVM or CLR