News for hackers. Stuff that matters.
Re:WebVM: WASM virtual machine in browser with networking vi... by chologrande on Thursday October 06, 2022 @11:26PM (#33117089)
Projects like this are cool, but I can't help but wonder why?

What problem is this, or any WASM, solving? Why do we need a VM in the browser?

Re:WebVM: WASM virtual machine in browser with networking vi... by VikingCoder on Thursday October 06, 2022 @11:38PM (#33117157)
What if the only thing you have access to is a browser, but you'd like to explore Clang, networking, etc?

This turns a lock-down old Chromebook into a box you can learn to develop on.

Re:WebVM: WASM virtual machine in browser with networking vi... by chologrande on Thursday October 06, 2022 @11:42PM (#33117178)
Interesting thought, but realistically what need is that serving besides curiosity?

Even chromebooks have real linux underneath, the scenario you're describing is so niche it's hard to imagine. IMO it makes much more sense to use free tier on a cloud provider

Re:WebVM: WASM virtual machine in browser with networking vi... by VikingCoder on Thursday October 06, 2022 @11:54PM (#33117243)
Not all Chromebooks do. Because their processor doesn't support it.

Think about education Chromebooks that get locked down, too.

Re:WebVM: WASM virtual machine in browser with networking vi... by callahad on Friday October 07, 2022 @03:25AM (#33118360)
Moving emulators and virtual machines to the Web can be handy for software preservation. The Internet Archive has a massive collection of games and applications that you can run right now, on any device with a browser, thanks to this kind of tech.
Re:WebVM: WASM virtual machine in browser with networking vi... by starwatch on Saturday October 08, 2022 @01:23AM (#33129985)
Also (speaking from 1st hand experience) some big companies issue laptops that are extremely locked down - with IT needed to install any software and only after it's been vetted. This gives a bit more liberty without crossing any of the security boundaries.
Re:WebVM: WASM virtual machine in browser with networking vi... by woojoo666 on Thursday October 06, 2022 @11:28PM (#33117102)
I think it's because people want to code in other languages besides javascript
Re:WebVM: WASM virtual machine in browser with networking vi... by colinsane on Friday October 07, 2022 @01:10AM (#33117661)
a “cross-platform” assembly format could, in time, make introducing new hardware architectures a bit easier.

for example, these guys link to a discord channel to chat about their work, but i can’t join it easily because even though Discord ships a Linux client, they only ship it for x86 and not arm. further down the road, i’d like to try some RISC-V devices: that’ll be that same experience times ten. a portable assembly format has the chance to overcome this.

Re:WebVM: WASM virtual machine in browser with networking vi... by csande17 on Friday October 07, 2022 @02:35AM (#33118097)
Isn't Discord's desktop client just an Electron wrapper around their website? It seems like there might be an easier way to get that running on other platforms.
Re:WebVM: WASM virtual machine in browser with networking vi... by nyanpasu64 on Friday October 07, 2022 @04:23AM (#33118665)
If I wanted the full-fat Discord app (rather than a browser website or PWA, or a third-party client Discord will ban you over), I'd look into https://github.com/SpacingBat3/WebCord (which I think isn't detected and banned, but I cannot guarantee this or that they won't rewrite Discord to the point you can get banned for using it).
Re:WebVM: WASM virtual machine in browser with networking vi... by intelVISA on Friday October 07, 2022 @12:29PM (#33123525)
They also ban for blocking the /api/science/ data mining endpoint.
Re:WebVM: WASM virtual machine in browser with networking vi... by nyanpasu64 on Saturday October 08, 2022 @09:19PM (#33137512)
Do you have any cases of people getting banned over it? It would be scary, uBlock Origin blocks /api/*/science and it would be terrifying if running an adblocker could get you banned from Discord.
Re:WebVM: WASM virtual machine in browser with networking vi... by pjmlp on Friday October 07, 2022 @05:14AM (#33119029)
Re:WebVM: WASM virtual machine in browser with networking vi... by colinsane on Friday October 07, 2022 @08:21AM (#33120238)
hey i’m not saying it will or won’t succeed on that front — just that it’s a motivating factor.

but also, look at its neighbors. Vulkan/SPIR-V has made it standard to ship bytecode-level shaders (graphical or compute) which are device agnostic but still performant. even if we’re cursed to try this “architecture agnostic” stuff a hundred times, i don’t think we can say there hasn’t been any progress. that progress only comes from people trying, even if 9 out of 10 serious attempts are flops.

Re:WebVM: WASM virtual machine in browser with networking vi... by pjmlp on Friday October 07, 2022 @08:55AM (#33120589)
So far Vulkan/SPIR-V doesn't seem to be as successful as DirectX/DXIL or CUDA/PTX, specially in what concerns mature polyglot support.
Re:WebVM: WASM virtual machine in browser with networking vi... by titzer on Friday October 07, 2022 @09:46AM (#33121224)
We weren't unaware of these things. Wasm is the first low-level format to instantly have broad availability, becoming available in all web browsers in 2017. AFAICT none of the previous formats had low overhead platform-independent in-process sandboxing, and certainly none had a machine-checked proof of type system soundness.

So Wasm has a few legs up on what came before.

Re:WebVM: WASM virtual machine in browser with networking vi... by pjmlp on Friday October 07, 2022 @10:18AM (#33121667)
If we ignore PNaCL and CrossBridge.

As for how sound the type system is in the face of attacks at the Flash, ActiveX and Java applets scale, it remains to be seen, although there are already some USENIX papers slowly coming up regarding WebAssembly actual security.

Re:WebVM: WASM virtual machine in browser with networking vi... by MoscMob on Friday October 07, 2022 @02:56AM (#33118219)
It's not that we need a VM in the browser, but we just need a VM that's sandboxed in terms of security.

Other than JavaScript, what other way can you send arbitrary code to a device and expect it to run there? WASM is the only other option.

Re:WebVM: WASM virtual machine in browser with networking vi... by eisbaw on Friday October 07, 2022 @04:21AM (#33118652)
Don't buy it. A sandbox is a sandbox. Yes, javascript runs in a sandbox, but other technologies exist beyond javascript-in-a-sandbox.

This is just really inefficient: VM in WASM in javascript in a sandbox in a browser, is insane and will forever be slow due to complexity.

Fun for the lulz, but for the planet's sake I hope this doesn't get adopted.

Re:WebVM: WASM virtual machine in browser with networking vi... by titzer on Friday October 07, 2022 @09:48AM (#33121257)
Wasm is not implemented "in JavaScript", rather JS engines reuse important parts of their compilation pipeline to generate good code for Wasm.