News for hackers. Stuff that matters.
Re:The State of WebAssembly 2022 by azangru on Monday June 20, 2022 @12:24PM (#31812205)
What is a use case for running a javascript vm in webassembly? Why not run javascript in the browser itself? Is it for server-side webassembly stuff?
Re:The State of WebAssembly 2022 by jeffparsons on Monday June 20, 2022 @12:52PM (#31812580)
You can "pre-initialise" the JavaScript VM so that your JavaScript code starts much faster at the cost of some small ongoing performance penalty.

I think the main use case is "serverless" or "edge compute" where start-up time is often hugely important.

Re:The State of WebAssembly 2022 by goatlover on Monday June 20, 2022 @02:35PM (#31813877)
Why not just use a language that's better suited for serveless or edge computing? Why is JS the hammer to every programming nail? Aren't programmers supposed to be able to learn and use multiple languages, depending on best use case?
Re:The State of WebAssembly 2022 by trusktr on Wednesday June 29, 2022 @11:36AM (#31921651)
Perhaps they are, but they don't want to.
Re:The State of WebAssembly 2022 by simonw on Monday June 20, 2022 @02:55PM (#31814154)
Yeah, my interest in this is for server-side purposes. I can imagine wanting to build a feature that allows users of my web application to write and execute their own custom code - think triggers and hooks for custom logic.

If they're creating code that will run on my servers I need to have an EXTREMELY reliable sandbox around it - I see WebAssembly as providing the best possible option for that these days.

Letting them write their customizations in JavaScript which I then execute in a JavaScript interpereter inside a WebAssembly container sounds like a pretty good option.

Re:The State of WebAssembly 2022 by trusktr on Wednesday June 29, 2022 @11:37AM (#31921667)
Node.js has reliable sandboxes for JS code without the need for Wasm.