Live data from Hacker News

Ask HN: How to make a native GUI with a modern language?

news.ycombinator.com

81–90 of 145 posts

Re: Ask HN: How to make a native GUI with a modern language?

#82
post #76

Earlier quoted context omitted.

JavaFX is terrible and I'm a Java fanboy. It isn't native looking so it doesn't satisfy the requirements outlined above. You can get a facsimile of "native" but at a lot of effort and for specific cases. But the problem is the deployment story. It requires native libraries so you need to package it somehow. Ideally, one day GraalVM will support JavaFX. That day isn't here. So you need JavaPackager which is one of the…

There is no such thing as native, windows doesn’t even have a singular native look. And as far as I know jpackage and the like should be able to package a javafx program just fine.

There sure is "native look" for Windows and Mac. Did you actually try shipping an app built on such a packager?

I shipped multiple. JDeploy solves some of those things but it's not as refined as native packaging.

Re: Ask HN: How to make a native GUI with a modern language?

#83
post #49

Earlier quoted context omitted.

I've tried it. It's a very strong effort but if you want to support Windows then welcome to hell. You'll need to ship Microsoft's new Edge runtime thing, which is a separate package. You'll either have to include that giant package in your package or download it on demand, and the latter is very brittle and will fail if MS changes their URLs or you're installing inside a very heavily firewalled (whitelisted) environm…

As another Windows application developer targeting enterprise users, thanks for the warning. Electron it is, I guess. Either that, or using the IE engine for web views, or no web views at all. Edit: I'm already using Electron, though I've been wishing I could move away from it.

If you are shipping software for Windows just make sure your insurance has good mental health coverage.

Re: Ask HN: How to make a native GUI with a modern language?

#84
post #83

Earlier quoted context omitted.

As another Windows application developer targeting enterprise users, thanks for the warning. Electron it is, I guess. Either that, or using the IE engine for web views, or no web views at all. Edit: I'm already using Electron, though I've been wishing I could move away from it.

If you are shipping software for Windows just make sure your insurance has good mental health coverage.

Heh, I've been shipping software for Windows one way or another for about 20 years. I just hadn't used Edge's WebView2 in anger yet, and now I probably won't.

Edit: And I've generally followed the "bundle every dependency" approach. As far as I can recall, the only dependency in a shipping product that I ever delegated to an external installer was the .NET Framework (before the .NET Core reboot). And IIRC, that did trip up a few users; thankfully, that was only a consumer app.

Re: Ask HN: How to make a native GUI with a modern language?

#85
Writing cross platform desktop applications is series of compromises in the technical requirements you may have. You should prioritize each requirement from top to bottom. Then start removing requirements from the bottom and compare against available technologies, iterate this process you will find out what is truly important and what compromises you are willing to make.

Personally I searched for many years for the perfect GUI system, the unicorn, but never found any. By doing a stricter prioritization I came to the conclusion that writing in a modern language is overrated.

Re: Ask HN: How to make a native GUI with a modern language?

#86

I write native GUIs in GTK using Julia at the moment. Julia is one of the most modern languages you can use today. Multiple-dispatch, very functional, modern package management and virtual environments, high performance, modern sophisticated REPL environment. GTK is quite nice as Glade is one of the nicer GUI designers. Here is a simple Julia GTK project on GitHub: https://github.com/ordovician/RocketBuilder.jl Some…

The big problem with GTK is backwards compatibility or, more precisely, the lack of it. I don't know how it has or hasn't impacted your own work, but I would hold off on recommending GTK to OP unless he/she is aware of this caveat.

Re: Ask HN: How to make a native GUI with a modern language?

#87
post #76

Earlier quoted context omitted.

There is no such thing as native, windows doesn’t even have a singular native look. And as far as I know jpackage and the like should be able to package a javafx program just fine.

There sure is "native look" for Windows and Mac. Did you actually try shipping an app built on such a packager? I shipped multiple. JDeploy solves some of those things but it's not as refined as native packaging.

What's the problem with jpackage for, say, shipping Windows binaries?

I just let it package a "portable" (no need to install) directory of all dependencies and that's it. Users just download a ZIP and can use my programs.

Re: Ask HN: How to make a native GUI with a modern language?

#88

Earlier quoted context omitted.

There sure is "native look" for Windows and Mac. Did you actually try shipping an app built on such a packager? I shipped multiple. JDeploy solves some of those things but it's not as refined as native packaging.

What's the problem with jpackage for, say, shipping Windows binaries? I just let it package a "portable" (no need to install) directory of all dependencies and that's it. Users just download a ZIP and can use my programs.

They don't have FX installed. No one does.

The whole idea of using Java is to support something other than Windows. I use a Mac and all companies I worked with had all common OS's on desktops. The edge cases are the problem. This isn't a product for other engineers. At least not engineers who have experience with JVM conflict issues.

For end users and to get a smooth installer experience there's a huge distance. Customizing the installer in the packager is a nightmarish problem... Or at least it was the last time I did it.

Re: Ask HN: How to make a native GUI with a modern language?

#89

MAUI in .NET 7 checks many of the boxes you have here: - Native looking: MAUI supports native controls as much as possible - Cross platform: Nearly everything but Linux today (and there are forks out there trying to bridge that gap); macOS (Catalyst), Windows, iOS, and Android - C# as the default .NET option is a very sane language. Other options may be possible with more effort. (Some people are still working on tha…

It doesn't support the second most popular OS (Win7) which still holds the quarter of the market share.

Re: Ask HN: How to make a native GUI with a modern language?

#90

Earlier quoted context omitted.

What's the problem with jpackage for, say, shipping Windows binaries? I just let it package a "portable" (no need to install) directory of all dependencies and that's it. Users just download a ZIP and can use my programs.

They don't have FX installed. No one does. The whole idea of using Java is to support something other than Windows. I use a Mac and all companies I worked with had all common OS's on desktops. The edge cases are the problem. This isn't a product for other engineers. At least not engineers who have experience with JVM conflict issues. For end users and to get a smooth installer experience there's a huge distance. Cust…

I can't use jpackage on Windows to build Mac binaries, but not having FX installed is what kind of problem? Just use jpackage to create an .app for Mac, an installer or portable build for Windows, and a .deb or executable binary for Linux. It bundles all dependencies and users can just click and run it.
Post reply on HN