Live data from Hacker News

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

news.ycombinator.com

31–40 of 145 posts

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

#31
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.

Whenever I see a small comment like “C++ bad, X good” I wonder if the poster has a thorough understanding or they just hold the opinion because it’s fashionable since they heard it so many places prior.

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

#32
post #22
post #15

Earlier quoted context omitted.

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?

That's an homage to the Apple II color text rendering.

https://en.wikipedia.org/wiki/Composite_artifact_colors#Appl...

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

#34
Depending on your application, write as much of the core functionality as possible into a cross platform library and/or server in your language of choice. Expose all functionality through a strong API.

Now you can build completely native GUIs in the appropriate language for each platform. Start with the platform which will likely have the most users for the application. Bonus if the application is open source, other developers will build all kinds of native GUIs for you. Just look at how many GUIs are out there for things like PostgreSQL, Git, IRC, etc.

I know this doesn't exactly meet your requirements, but I think this is the way to go if starting something in August 2022.

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

#35
> HN has strong opinions against Electron

Beware the bias of the loud minority. For every 1 noisy user, there may be 50 quiet users who are fine with the decision to use Electron.

Shipping beats not shipping every time, and if Electron is what you need, then do it. I say this as someone who does not like Electron, but also as someone who knows that writing comments on HN is 100x easier than actually shipping production software.

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

#36

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…

JavaFX is not native, nor can it be made to look native like Swing can be made.

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

#39
I hate to stick my neck up here but looking at this recently, I think that in trying to get cross-platform, you might end up with a lot of pain and not that great results. Instead, I would go for getting 3 devs and writing an app in a native language on each OS. You can refactor the business logic into a dll using some standard languages like C/C++ (they aren't that bad) and possibly Python and then just build the front-end in the native framework.

Why? The only way to get a truly native look and the ability to specialise for each OS. Maybe Windows does threading better than Linux and can be optimised in some way. Maybe Linux has some nicer native UI controls that could make that part better on Linux.

Otherwise cross-platform mostly means a UI that is not native looking on any platform. Haven't used QT recently but of all I used, that was the closest to what you are asking for (I was using C++ - sorry, it's not that bad!) but I think there are bindings in other languages, although they might well have some bugs compared to the basic C++ version.

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

#40
post #16

Earlier quoted context omitted.

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.

I think possibly "perpetuating the fear" was the intent. I'm not siding with OP as I don't use C but if they think it's a bad choice then they probably want to assist other people in avoiding that choice.
Post reply on HN