3 ms·
>what's the point of porting a memory-safe (with GC and runtime) on a VM especially dedicated to remove the costly memory safety part of JavaScript. a) binary
by rubber_duck 10y ago
>what's the point of porting a memory-safe (with GC and runtime) on a VM especially dedicated to remove the costly memory safety part of JavaScript.
a) binary portability - compile and ship WASM link/run on any machine with WASM VM - eg. package up to NPM and run trough any V8 target
b) extra sandboxing layer for security (it's designed for browsers where you are supposed to run non-trusted code)
c) portable APIs (assuming WASM targets expose the same underlying platform like node or w/e)
d) WASM is single threaded right now but from what I've seen it's a top priority for next release to spec out shared memory threads
- stymaar 10y agoI agree with d), but I'm quite skeptical about the other 3. a) and c) means it's portable on everything a JS VM runs on, which is not that much more than what Go runs on. b) is legit, but that really sounds like an overkill.
- rubber_duck 10y agoWell a) and c) also means you can run in the browser - client/server code sharing and such can be a really big win.