News for hackers. Stuff that matters.
Re:Making bracket pair colorization faster by Jensson on Thursday September 30, 2021 @04:04AM (#28704138)
WASM isn't Javascript. WASM is a way to represent native code in Javascript that some Javascript runtimes then can use to run it as native code. If the Javascript runtime hasn't implemented a hack to run WASM as native code then WASM is ridiculously slow. If the VSCode team writes their code in C++, compiles it to WASM and then runs WASM and it is fast, then it was C++ that was fast and not Javascript.

If that is really how they got their performance then no wonder that few others actually managed to do it, because most teams wouldn't write their Electron app in C++ and then compile it to WASM. The difference is that Microsoft has a ton of C++ engineers so they could do it easily, but I doubt many Electron teams put out job postings to hire C++ people.

Re:Making bracket pair colorization faster by goldenkey on Thursday September 30, 2021 @10:06AM (#28706468)
That's like saying if you use the _asm directive in any language, your entire project is now assembly. Subtlety is not your strong suite. One can use WASM for manual memory critical paths while using raw JS for other parts. And you did not hear me. You can write WASM in JS. Transpiling. Amazing, huh?
Re:Making bracket pair colorization faster by int_19h on Thursday September 30, 2021 @03:07PM (#28710021)
And how fast is JS compiled to wasm? Are you claiming that it's also as fast as C++ compiled to wasm?
Re:Making bracket pair colorization faster by goldenkey on Friday October 01, 2021 @04:02AM (#28715841)
Yes, Typescript to WASM is just as fast as C++ to WASM.