Could WebAssembly and WebGPU be the next hope of the Linux desktop ?

reddit

I recently learned about WebAssembly (WASM) which is a new standard that allows developers to compile pretty much any language (like C++, Rust, C#…) to a portable virtual machine that can be run in any modern browser with near-native performance while being sandboxed. To be fair I'm pretty hyped by this technology and I'd like to share my reflection about what that could implies for software development as a whole and how that could help the Linux desktop.

Firstly, the only real problem with Linux today is software availability, it is literally the only problem that cannot be reasonably addressed by its users, we probably all know some people who tried Linux and even tho they enjoyed it, they need to use some kind of Windows-only software, however they would happily make the switch if only they could run all their software and games on it.

However, recently thanks to technology like Electron, this problem started to see some answers : cross-platforms frameworks that allow to "Write once, run everywhere" are probably the only reasonable solution. Electron allow developers to take any web application and ship it as a desktop application (Discord is written in Electron for example), even tho I perfectly understand the hate towards Electron for a variety of reasons, I still think it is a wonderful technology that helped Linux : some companies who previously would not have care about shipping a Linux build can now do it simply by editing a single compilation flag without any further modification to their code.

So, even if Electron is very useful, there are still some major limitations : most notably it is still just a Chrome tab running JavaScript, for light applications it is not a problem, but if the app needs near-native performance or direct access to the GPU, Electron is out of luck. However this may no longer be true very soon thanks to WASM and a new standard which is right now under active development : WebGPU which will allow web applications that need heavy graphics workload to operate like native applications.

In a few years, I can see a future where any application could run in a web browser, we may for example use Photoshop right into the browser or play any game directly in the browser as the gap between real native performance and WASM will tend to zero. The best part is that thanks to technologies like the Emscripten compiler, C++ code can directly be ported into WASM, not requiring developers to make massive changes to their codebase, making it directly executable in a browser or in Electron. Stuff like "Universal binaries" already exist by taking advantage of the WASM format (the Wasmer runtime for example).

Essentially operating systems may just become a bootloader for these universal platforms, once this happen for real, Windows may lose its biggest advantage, in fact Microsoft will probably fight against it but it's not clear how they could win in the long run, once we'll be there, the Linux desktop will finally become a fully viable alternative.
So, what do you think is going to happen ? Is WASM just another technology that will remain marginal or the start of something great ? Could the Linux desktop rise because of that ? It this reflection realistic ?

submitted by /u/EnderSpirit
[link] [comments]