Hacker News new | ask | show | jobs
by kentonv 2153 days ago
Wasm isn't compiled to JS, it's a separate engine within V8. Depending on the kind of code it can be faster than pure JS -- but it depends. JS code benefits from using V8's native garbage collector and other high-level built-ins that Wasm code currently cannot access so easily. So, perhaps counter-intuitively, transpiling Python to JS will likely perform better than compiling CPython to Wasm. OTOH, Rust compiled to Wasm will probably beat JS on number-crunching tasks.

(There is work underway to expose the native garbage collector to Wasm apps but it's not here yet.)