Live data from Hacker News

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

news.ycombinator.com

21–30 of 145 posts

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

#21

Definitely Flutter. https://flutter.dev

Though, your milage may vary, as you still need to

1. Take care to ensure that you follow platform guidelines

2. Ensure that the view and controller are not tightly coupled

3. Ensure that whatever libraries you want to use have support for all platforms you want to support

4. Pray that you don't need something very platform specific (or need to use Bluetooth, which I am told is a huge pain)

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

#22
post #15

Personally I like JavaFX. I made something pretty complicated with tkinter and Python. It's not that hard to do but the result looks awful, it doesn't support many features people expect in 2022, and the documentation for using tk in Python is poor. You probably need to refer to the tcl/tk documentation and translate it in your head to apply to Python. As much as people hate Electron, the rendering engine in a web br…

I used JavaFX a while ago and hated it. It was insanely slow, fonts were awful and the lib of components was non existent. It really felt like something created by someone but never used in the real world. Is it even used anywhere?

Agreed, JavaFX's font rendering on MacOS was like this for years: https://user-images.githubusercontent.com/1413266/82507544-6... (Note not only the inconsistency between letters - all the specific colour values used are the wrong ones to get a working subpixel effect in the first place).

Possibly still is like that. But that gets around to your question... is anyone still around to notice?

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

#23
post #16

If you don't think C or C++ are sane languages you are never going to write any thing sane for Von Neumann computers imo. Much less something cross platform.

Ok, so be it. C and C++ are still insane to work with.

It's really not that bad and comments like this just perpetuate the fear to other people who have never touched them.

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

#24

Personally I like JavaFX. I made something pretty complicated with tkinter and Python. It's not that hard to do but the result looks awful, it doesn't support many features people expect in 2022, and the documentation for using tk in Python is poor. You probably need to refer to the tcl/tk documentation and translate it in your head to apply to Python. As much as people hate Electron, the rendering engine in a web br…

FYI the later versions of TK look much more native across platforms.

I recently found this tutorial: https://tkdocs.com/tutorial/index.html and am going thru ut.

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

#25
post #18
post #14

Earlier quoted context omitted.

> trouble w/ Electron is that you have 30MB of runtime for any application JavaFX has the same problem? Or you rely on user's JREs already installed? I'd think 30MB really isn't much any more.

The difference is that Electron is bundled with every app. If you have 200 electron apps, that’s 200x30mb. With Java, the JRE is reused so the binaries can be smaller.

That is the case with JavaFX as well. It's not part of the JRE anymore. Also there really isn't any such thing as the JRE anymore, only the JDK. If you want to distribute a desktop Java app you must embed the entire runtime via javapackager. They have correctly realized that end users cannot be expected to install and update a language runtime separately...

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

#27
Not quite sure what your definition of a “sane language” is. Pretty much all guis in the industry involve one of those three to some extent.

Maybe look into Skia, it’s Googles abstraction layer for multiple graphics libraries on multiple platforms.

But if you are just learning, I wouldn’t concern yourself with any of those sort of environment conditions, just figure out how to make something that works on your preferred OS.

For example, if you use Windows, learn 2d rendering with direct x. Learn about event handlers for controller interaction. And of course read about MVC.

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

#30

Hate to say it but, this is one of the biggest tragedies of modern CS. Best bet is to use gtk, or qt, and hope the language bindings for your lang of choice aren't horrible (depending on the language you might be in tears)

Can you elaborate more? I actually don't quite understand this statement.
Post reply on HN