News for hackers. Stuff that matters.
Re:Not So Fast: Analyzing the Performance of WebAssembly vs.... by jakobegger on Wednesday July 17, 2019 @08:06AM (#20458517)
Can someone explain a concrete use case for web assembly? Are there projects out there using web assembly in production? What kind of application needs more performance than Javascript can offer, but doesn't need full native performance?
Re:Not So Fast: Analyzing the Performance of WebAssembly vs.... by sp332 on Wednesday July 17, 2019 @08:30AM (#20458689)
The Internet Archive has a ton of in-browser emulators that can boot many old computers and arcade cabinets in the browser. https://archive.org/details/msdos_Oregon_Trail_The_1990

Not all of these will boot, but most will. https://archive.org/details/softwarelibrary & https://archive.org/details/internetarcade

Re:Not So Fast: Analyzing the Performance of WebAssembly vs.... by snek on Wednesday July 17, 2019 @10:55AM (#20460118)
> Are there projects out there using web assembly in production?

pspdfkit, unity, google earth, and figma spring to mind. Obviously more stuff is using it, but it isn't like there's a big index of sites using wasm.

> What kind of application needs more performance than Javascript can offer, but doesn't need full native performance?

Wasm and JS can achieve equal performance in modern browser engines (and note that in engines like v8, there are operations that can be reduced such that they compete with output from gcc and clang). The thing that wasm is designed to do is make that performance predictable. Optimizing JS requires a lot of guesswork which can end up incorrect, while wasm doesn't require any guesswork because it is strongly typed and uses a regular bytecode. Right now what is holding wasm back is coming up with all the best ways to reduce it to the machine code of the specific platform, and ways to reduce the performance hits of security checks wasm has. For example, v8 recently sped up wasm memory access by ~30% by getting rid of bounds checks and using mmap + sigsegv to detect out of bounds access.

Re:Not So Fast: Analyzing the Performance of WebAssembly vs.... by GeneralMaximus on Wednesday July 17, 2019 @09:25AM (#20459160)
Figma (https://www.figma.com/) is a design tool that runs in the browser and makes heavy use of WASM. It's definitely slower than using a native app like Sketch, but not slow enough to be completely impractical. A few design people I work with here in India have switched to Figma from Sketch, and they seem very pleased with the results.

I can see WASM becoming useful for enabling apps that do real-time audio/video/image processing in the browser. Games are another obvious use case.

Maybe one day I'll be able to run an Ableton-lite right in the browser.

Re:Not So Fast: Analyzing the Performance of WebAssembly vs.... by throwawaywindev on Wednesday July 17, 2019 @09:50AM (#20459443)
Everyone likes Figma because of its real time collaboration. The performance is terrible but you put up with it because of the features.
Re:Not So Fast: Analyzing the Performance of WebAssembly vs.... by josalhor on Wednesday July 17, 2019 @08:25AM (#20458652)
Unity 3D targets Web Assembly now for the web, which makes much more sense than JavaScript, even if asm
Re:Not So Fast: Analyzing the Performance of WebAssembly vs.... by DonHopkins on Wednesday July 17, 2019 @12:46PM (#20461423)
Yes, Unity3D's WebAssembly back end is a very widely used, non-trivial, practical, and successful example.
Re:Not So Fast: Analyzing the Performance of WebAssembly vs.... by jacknews on Wednesday July 17, 2019 @08:10AM (#20458545)
I think it's more a case of wasm being a more natural target for compilers, meaning you can write or port applications in other languages to the web without the much-worse performance (and size) implications of compiling to interpreted javascript.
Re:Not So Fast: Analyzing the Performance of WebAssembly vs.... by kristiandupont on Wednesday July 17, 2019 @09:27AM (#20459182)
In addition to the examples given, I offer the opinion that using the same language for front- and backend is nice. I currently achieve this with JS, but it would be nice to be able to do the same with, say, Rust.
Re:Not So Fast: Analyzing the Performance of WebAssembly vs.... by aldanor on Wednesday July 17, 2019 @08:11AM (#20458556)
You can, for instance, run Python in your browser by compiling RustPython to WASM
Re:Not So Fast: Analyzing the Performance of WebAssembly vs.... by MikusR on Wednesday July 17, 2019 @08:25AM (#20458651)
Beta of Google Earth is Wasm.
Re:Not So Fast: Analyzing the Performance of WebAssembly vs.... by dakom on Wednesday July 17, 2019 @08:15AM (#20458592)
gamedev comes to mind, where performance isn't only about raw power but also avoiding garbage-collecting hiccups which are unavoidable in JS