How is WebAssembly cross-platform when Assembly is not
Warning
This post is more than a year old. Information may be outdated.
- WebAssembly is like Assembly, except that
- it runs cross-platform
- it runs isolated
- it runs on browsers
- But how is WASM fast and cross-platform simultaneously?
- Does it pack multiple precompiled binary executables for multiple CPU vendors, like Apple's Universal Binary?
- But then, whenever a new type of CPU gets announced, they wouldn't be able to run existing WASMs
- WebAssembly's runtime environments (RE) are low-level virtual stack machines (akin to JVM or Flash VM)
- Seems like WASM is closer to intermediate Java Byte Code instead of the genuinely low-level Assembly.
- But then, why is it faster?
- JS Interpreter can skip the parsing
- It can ship in a much more compact file format
- WASM is just like Java Byte-code. Java Byte-code is cross-platform when machine code for a real CPU is not. It's input for a JIT compiler that targets whatever real CPU. Peter Cordes
- WASM defines its own _CPU standards and . .
Backlinks1
220920Comments