Live data from Hacker News

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

news.ycombinator.com

51–60 of 145 posts

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

#51
Strange nobody mentioned Tauri, it is really pleasant experience to use and good solution. It works really well for what it does, it is still not covering all features and everything, but it is more performant and more secure alternative to Electron.

I was considering using it for some app that otherwise would be PWA. While I didn't use in-depth features and didn't run into any serious problems, it is likely that not everything will be perfect, but it is also likely that overall experience will be more pleasant.

https://tauri.app/

Check it out.

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

#52
I just spent the past three months building a custom GUI framework in C# using OpenTK, which is basically just a C# wrapper for OpenGL. It's inherently cross-platform because of .NET. [1]

After finishing, I regret spending so much time on it. For my use case, I think it would have been a better use of time to just use Electron. At least until .NET MAUI has Linux support, which is looking very promising.

[1] I haven't tried MacOS because I don't have a Mac and I believe it has OpenGL compatibility problems. It works great on Windows and Linux though.

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

#53
One unusual alternative you may not have thought about is using Godot Game Engine. Before dismissing it, consider this: Godot engine is shockingly small for what it does. The download is about 30-40 MB. The GUI designer tool is second to none, and you can make highly interactive advanced GUIs using a language that looks very much like Python called GDScript. It is very quick to learn.

It does make GUI which are native to the platform but you get a small native binary which renders OpenGL.

Is Making Advanced GUI Applications with Godot the Future? https://medium.com/swlh/what-makes-godot-engine-great-for-ad...

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

#54

> 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 producti…

> HN has strong opinions against Electron

Beware the bias of the loud minority.

Hear hear.

Though depending on the application(s) in question, if JS and things that traspile to it are attractive to the developer then they could also consider an offline-first/-only web app. Not practical for everything and adds its own family of potential complications, but worth considering.

> but also as someone who knows that writing comments on HN is 100x easier than actually shipping

As someone who has a huge pile of projects just waiting to be started (and one or two languishing in a PoC state) I think your 100x factor is more than a little too small!

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

#55

Why the emphasis on "unidirectional data flow"? I happen to think Lazarus (based on Free Pascal) is great, but it's not a functional language at all.

Do you have any examples of apps that use that tech?

Lazarus is essentially a free clone of Delphi, which was used to make a lot of desktop applications in the 2000s. Some examples are RPG Maker 2000, Cheat Engine, and FL Studio.

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

#56

Are C# WinForms or VB.NET not the right answers here for some reason?

I don't believe mono supports winforms on linux and I wouldn't classify VB.net as having a elm-like architecture with a unidirectional data flow... so yes?

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

#57

> 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 producti…

I usually agree with this sentiment of shipping vs not shipping. But Electron is just really bloated. You cannot install 10 apps and regularly use it. Most systems will just hang or crawl. Systems with 8GB should not be hanging because you are using 10 apps.

I have 16GB RAM and even then I feel the hog with Discord, Slack, VS Code, A note app taking up too much memory. Then there is unnecessary security risk of bringing all the browser issues along with it.

People shouldn't have to buy an expensive Mac books to use normal apps. That should be for MLOPS or other processing heavy tasks.

Also, an Electron app uses anywhere around 150+MB to 400ishMB ram on normal cases. For one app.An app like QOwnNotes uses only a small portion of it. 50MB-100MB max. So when you you add just 10 electron apps, the number just blows up.

I feel like whatever progress with performance we are making with processor is just cancelled out with things like Electron. That is just sad.

So no. I don't think this is a good example of loud minority scenario.

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

#58
post #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 fr…

I agree with this (except for the bit about C++ but that's neither here nor there) but what I landed on was that maybe a native look isn't as important as I thought. Some of the nicest apps I've used just have their own look. They're still native and very quick, but they use their own UI toolkit that doesn't fit the system. For example nheko, ripcord, blender, sublime merge, etc.

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

#59
post #20

Earlier quoted context omitted.

I haven't used it myself (yet), but https://tauri.app/ looks very promising as Electron alternative. It uses the OS's browser so it doesn't have the bundle size issue you describe.

Isn’t the downside to this then that although you’re using the native browser you’re losing the whole point of Electron which is to have a consistent environment regardless of where it’s run?

That is a downside. However, it's better to look at Tauri like you might look at React Native. If complete consistency between platforms is required, Tauri still saves you time by letting you write a single codebase and then do a low effort port to each platform. For many applications, Tauri applications will look the same between platforms out of the box.

That's the pitch anyway. People can spend a lot of time on ios vs android in react native applications, so ymmv

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

#60
post #57

> 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 producti…

I usually agree with this sentiment of shipping vs not shipping. But Electron is just really bloated. You cannot install 10 apps and regularly use it. Most systems will just hang or crawl. Systems with 8GB should not be hanging because you are using 10 apps. I have 16GB RAM and even then I feel the hog with Discord, Slack, VS Code, A note app taking up too much memory. Then there is unnecessary security risk of bring…

It is sad.

But I'd rather people ship something and refine the Electron version than never ship anything at all. Mostly because I believe more in indie devs than I do in the purity of software.

Post reply on HN