←back to thread

7 points string-theory | 1 comments | | HN request time: 0.258s | source

what do you think about the strategy of publishing apps via html5. I mean desktop apps trough html5 rendering. Let me know.
Show context
gnulinux ◴[] No.45683804[source]
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.

replies(1): >>45684290 #
1. dualogy ◴[] No.45684290[source]
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.