DEV Community

Discussion on: What would a JavaScript Wasm desktop be like?

Collapse
 
jerch profile image
jerch

Hmm interesting idea. There are just a few things that bug me:

  • half of the kernel duties are missing for wasm tasks, namely process scheduling/isolation, privilege system (security in general), maybe that could be bridged somehow
  • blocking semantics to not rewrite 90% of existing apps - is that solved yet in wasm/emscripten? Thats a hard one, esp. when GUI/mainthread interaction is needed
  • preemptive vs. cooperative multitasking, imho with wasm/JS only cooperative style is possible (we are back to win3.1, yay)
  • How is a native GUI app supposed to run/to get embedded? Just as normal with HTML/CSS driven window decorations?
Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

Excellent questions, I don't know the answers get but it going to be a blast finding out. I had some ideas that could answer atleast 2 of your questions.

Wasm Kernal

medium.com/wasmer/running-webassem...

Broadway Gtk backend

blogs.gnome.org/alexl/2019/03/29/b...

Emscripten

I'm afraid I don't know, I moved away from c dialects to look at zig and Rust. Developer buy in would be crucial to the success of the project but as far as I can see from wasi and the wapm package manager there are many successful ports.

I'm looking at writing a DE first not a distro I guess. I hope that smarter people like yourself can help me. I am just a humble frontend developer with a fetish for native binaries.

Collapse
 
jerch profile image
jerch

Wow this wasm-kernel thing looks interesting. Not sure yet how this gonna help with kernel tasks beside drivers written in wasm (which is nice on its own), but I think they might find a way to bridge the kernel/userland ring issue in a secure way.

About broadway Gtk - lol wasnt aware that this is even possible with Gtk. I have no clue about wayland internals, at least with good old X it would be quite easy to embed "foreign stuff". Broadway Gtk though does quite an expensive roundtrip - where a 3D acc. desktop/GUI would directly paint into the GPU with all its super fast bells and whistles broadway-gtk seems to render stuff in CPU offscreen, moves the view diff through a socket to the browser where it gets merged into the current view (again CPU). Imho a better approach for a wasm/browser engine driven DE would be to use offscreen-canvas and just clip the content into the right place. Lol macusers gonna cry for their battery life :) Well just some random thoughts on this...