100 ms·
It is a binary, a WASM binary. However, your CPU can't execute WASM binaries. That's why you would either have to use an interpreter to execute them (which woul
by hmry 4y ago
It is a binary, a WASM binary. However, your CPU can't execute WASM binaries. That's why you would either have to use an interpreter to execute them (which would be slow), or compile the WASM code into native machine code for your CPU first. Then you can run that machine code directly.
The wazero library supports both of those options AFAIK.
- kretaceous 4y agoThanks. > CPU can't execute WASM binaries How was OP able to pipe the output of echo directly to the wasm binary initially?
- hmry 4y agoI think they probably registered a WASM interpreter like wasmtime to automatically run any .wasm files. You can do that using binfmt_misc on Linux.
- xena 4y agoYeah, my dev box has a binfmt_misc interpreter for .wasm files set to wasmtime. It's pretty neat!
- masklinn 4y agoWriting / edition error? This is before the article notes that: > However this still depends on the program being compiled for your native OS and distribution as well as present in a folder in your $PATH. Though it’s also possibly that the author has a wasm interpreter registered (or the wasm file has a shebang for one).