gnulinux a day ago

There are ways to do this efficiently but it'd have to be over engineered and thus probably not worth it. You write the code in C/C++/Rust or similar and compile to WebAssembly. Then package it all in the thinnest wrapper you can find, of which I'm familiar with: https://tauri.app/ This gets you a "webpage" that runs C++ which you can let your customers install and use as a desktop app. Your mileage will vary.

It all depends on how powerful computers you want to support, if you assume your users will allow WebGPU use and your application needs 2D or 3D graphics (or more niche, GPGPU compute) imho Godot engine is actually pretty good to develop any web app (not just games) since it can compile its shader language down to WebGPU. Again, you'll probably need to write most of the code in C++ and compile to WebAssembly, which is pretty doable with Godot. If you just need graphics and very light CPU processing, GDScript will be enough. Once you do this you still need to wrap the webpage as a desktop app, I think Chrome browser has tools that can help with that.

The other obvious way is to use something like Electron and writing most of the code in Javascript. This will probably get you far if you need something simple but the memory and CPU usage will be much higher than necessary. Since the app ends up being so bloated, I personally don't like things approach, but apps like VSCode exist.

  • dualogy a day ago

    Even with JS/TS app code, instead of Electron, you can still also use Tauri afaict: just minimally get the Tauri binding up in your compiles-to-native lang of choice, and then one can still write the overwhelming bulk of the GUI in JS/TS (and perhaps even most/all of app logic, depending on how much of it is expressible via browser web APIs).

    Certainly less bloat this way than Electron, for those with a taste for JS/TS.

jauntywundrkind a day ago

It's deeply rude to the user to strip away all the user agency they have on the web. The web is one of the only places in computing where users get more than pixels being pushed at their faces: walking backwards into the dark & shadow is a bad move.

Basically all the same faults and troubles of Towards a Modern Web Stack apply. https://news.ycombinator.com/item?id=34612696

It's also notable that your software is grossly immoral if it does not have accessibility. You could write your desktop app that renders into an HTML5 canvas to also expose a second render of the app that is the accessibility tree (or less kindly use some of the new APIs to grammatically create accessibility, but this is far worse an option). But this greatly increases the effort of the work, and it's effort you don't need to spend if you use actual HTML with semantic tags and some ARIA sprinkled in.