Live data from Hacker News

Zero-native – Build native desktop apps with web UI

zero-native.dev

41–50 of 65 posts

Re: Zero-native – Build native desktop apps with web UI

#41

Im not sure if people are getting the biggest problem in electron desktop apps. Its RAM usage not the disk!! Why are they all making the same thing in different ways?! I have never worked on an electron app where the executable size was an impediment to the business. Its always the RAM/CPU usage. If we are going to work on the same webviews like electron and others, how will this make any difference?

Easy: the problem with memory is not the WebView nor is it displaying HTML using that WebView. The problem is the layers of layers of JavaScript (frameworks) running in that WebView when using Electron or the like. I am working on something similar, HTMXNative as part of a bigger idea called interscri.pt that can use either WebView or native for rendering and the difference in memory consumption is somewhere between…

I am cursed that I always have to work on legacy products that were built many years ago and didnt consider these things.

I hope we eventually get a good/simple language/framework that can compile to native code. Even react native for mac/windows is good enough now.

Re: Zero-native – Build native desktop apps with web UI

#42
post #28

Slightly off topic, but what is the best way to build a cross platform GUI app these days, but something with good graphics, typography, etc. I mean a beautiful app. I would prefer to have a shared core in Go, and then something around it to give me the GUI. I know on MacOS it is straightforward to build something beautifully looking with their native Swift toolkit, but not sure on Linux and Windows. Is it better to…

Only reasonable way is shared core with thin UI layer on top. For Rust there is Crux, don’t know for other languages. Everything else is just compromise, like all Flutter apps I know on iOS are just atrocious.

Re: Zero-native – Build native desktop apps with web UI

#43
post #42
post #28

Slightly off topic, but what is the best way to build a cross platform GUI app these days, but something with good graphics, typography, etc. I mean a beautiful app. I would prefer to have a shared core in Go, and then something around it to give me the GUI. I know on MacOS it is straightforward to build something beautifully looking with their native Swift toolkit, but not sure on Linux and Windows. Is it better to…

Only reasonable way is shared core with thin UI layer on top. For Rust there is Crux, don’t know for other languages. Everything else is just compromise, like all Flutter apps I know on iOS are just atrocious.

I like this approach, it's what I had in mind, but Crux doesn't seem to support desktop targets. I know on MacOS you can get nice looking apps with their native toolkit, on Linux you have GTK4 which can be decent looking, but not amazing, and on Windows, I truly don't know. Native apps on Windows look crap to me (without even mentioning the advanced fragmentation in UI toolkits in Windows). Maybe someone has some good examples for Windows and Linux, using native SDKs.

Re: Zero-native – Build native desktop apps with web UI

#44
post #28

Slightly off topic, but what is the best way to build a cross platform GUI app these days, but something with good graphics, typography, etc. I mean a beautiful app. I would prefer to have a shared core in Go, and then something around it to give me the GUI. I know on MacOS it is straightforward to build something beautifully looking with their native Swift toolkit, but not sure on Linux and Windows. Is it better to…

I'm actually working on that - it's called Hypen - (hypen.space). You can build your core in Go or any other supported language, and write the UI in the Hypen DSL. While desktop is still in the works and should be out in the next week or two, currently the alpha supports Native iOS, Android, Web and Web Canvas, and just like mobile, the Desktop will be _real_ native.

[dead]

Re: Zero-native – Build native desktop apps with web UI

#45
> No borrow checker. No lifetimes. No fighting the compiler for 20 minutes over a string.

It's embarrassing. If the borrow checker and lifetimes are difficult for the author, I would suggest sticking with non-systems-languages. In systems languages you have to either do the work the borrow-checker does in your head, or you let Rust do it.

If you are fighting the Rust compiler for 20 minutes over a string (or whatever actually happened that warrants this hyperbole), you are simply not writing good systems-level code.

This is an advanced version of the kind of person who deliberately compiles without warnings in C because they make it harder to find the error messages. It's complete amateur hour and it's embarrassing.

The real fix here is to learn how to do it properly. I VERY RARELY run into Rust compilation issues where I think "this is stupid". Nearly all of the time, the compiler is telling me that I forgot to think of something that I should have been thinking about, or that I've not been explicit enough. I've written C++ for way too long to know that this is hyper valuable.

I've also written enough Zig to know that Zig is not for people who are bad at systems level programming. It'll blow up in your face, just like C.

Re: Zero-native – Build native desktop apps with web UI

#46

I love the redefinition of "native desktop app" - a web app which uses the system web-view instead of bundling Chrome.

Considering Microsoft already doing this in win11, it's fine.

If Microsoft does it now, and didn't used to do it, it's probably terrible.

Re: Zero-native – Build native desktop apps with web UI

#47

I love the redefinition of "native desktop app" - a web app which uses the system web-view instead of bundling Chrome.

Considering Microsoft already doing this in win11, it's fine.

They are redeveloping much of that electron-based code back to Win32 as part of their quality improvement initiative.

Re: Zero-native – Build native desktop apps with web UI

#48
post #5

> Use the system WebView for lightweight apps, or bundle Chromium via CEF so basically a vibe coded Tauri in zig? I don't like calling webview dependent applications "native desktop apps". Native desktop apps means using the OS primitives and directives to draw the UI imo; WinForms, SwiftUI, and their ilk.

If Tauri ever gets proper webgpu support, that'll be the Electron killer.

Re: Zero-native – Build native desktop apps with web UI

#49
post #43
post #42

Earlier quoted context omitted.

Only reasonable way is shared core with thin UI layer on top. For Rust there is Crux, don’t know for other languages. Everything else is just compromise, like all Flutter apps I know on iOS are just atrocious.

I like this approach, it's what I had in mind, but Crux doesn't seem to support desktop targets. I know on MacOS you can get nice looking apps with their native toolkit, on Linux you have GTK4 which can be decent looking, but not amazing, and on Windows, I truly don't know. Native apps on Windows look crap to me (without even mentioning the advanced fragmentation in UI toolkits in Windows). Maybe someone has some goo…

> Native apps on Windows look crap to me (without even mentioning the advanced fragmentation in UI toolkits in Windows).

WinUI 3 is pretty decent. Have a look at first-party programs like PowerToys[1], or Windows Terminal[2].

[1]: https://github.com/microsoft/PowerToys

[2]: https://github.com/microsoft/terminal

Re: Zero-native – Build native desktop apps with web UI

#50
post #5

> Use the system WebView for lightweight apps, or bundle Chromium via CEF so basically a vibe coded Tauri in zig? I don't like calling webview dependent applications "native desktop apps". Native desktop apps means using the OS primitives and directives to draw the UI imo; WinForms, SwiftUI, and their ilk.

Tiny nitpick: Windows Forms wraps the Windows API; the function call is `CreateWindowEx`[1].

[1]: https://github.com/dotnet/winforms/blob/27e7cb2e5043780dd75e...

Post reply on HN