HN has strong opinions against Electron so here are my requirements:<p>- I want to make a native looking GUI<p>- Cross platform (macOS, Windows, Linux)<p>- With a sane language (no C, C++ or Objective C)<p>- Ideally with a data flow looking like unidirectional data flow / Elm architecture<p>What options do I have?
Having a native looking GUI and being cross platform is almost contradictory. The only way to make truly native looking and feeling GUIs is to use native tools. That means Cocoa on macOS, Gtk or Qt on Linux, and Win32/Winforms/WPF/WinUI on Windows.<p>Most cross platform frameworks won't really look 100% native. The only exception I know is wxWidgets, which provides an abstraction layer over the native toolkits. It's written in C++ but there are bindings for Python, Ruby and other languages. But even using this, apps might not feel truly native. There is more to nativeness than looks. It's also about subtle conventions and ways to do things. You only achieve this when you use a native framework and pay a lot of attention to the HIG guidelines of the OS.<p>My personal (and perhaps a bit unpopular) opinion is that native looking is a bit overrated. And it's mostly macOS users who look for this. Linux and Windows users already get a lot of diversity in their looks and feel because there is no single framework for those OSes.<p>More important than native looking is to have a GUI that is fast, efficient and accesible. The best option that provides this in a cross platform way is QT. Java Swing and JavaFX are also good options.<p>The most productive tool to have cross platform GUIs right now is Electron. That's just a fact. And it's the reason why so many modern products are using it. But as we all know, there is a price in efficiency.<p>There are a bunch of new projects in the works to improve cross platform GUI for modern languages. JetPack Compose Desktop, Flutter, Slint and many more. But these are not yet fully mature.
> HN has strong opinions against Electron<p>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.<p>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.
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.<p>It does make GUI which are native to the platform but you get a small native binary which renders OpenGL.<p>Is Making Advanced GUI Applications with Godot the Future? <a href="https://medium.com/swlh/what-makes-godot-engine-great-for-advance-gui-applications-b1cfb941df3b" rel="nofollow">https://medium.com/swlh/what-makes-godot-engine-great-for-ad...</a>
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.<p>Here is a simple Julia GTK project on GitHub: <a href="https://github.com/ordovician/RocketBuilder.jl" rel="nofollow">https://github.com/ordovician/RocketBuilder.jl</a><p>Some articles I wrote related to GTK programming with Julia and GTK in general:<p>- Understanding GTK Layouts: <a href="https://itnext.io/understanding-gtk-layouts-13e5a36256fa" rel="nofollow">https://itnext.io/understanding-gtk-layouts-13e5a36256fa</a><p>- Hiccups Writing GTK3 GUI Code in Julia: <a href="https://towardsdev.com/hiccups-writing-gtk3-gui-code-in-julia-on-macos-2467483c2e78" rel="nofollow">https://towardsdev.com/hiccups-writing-gtk3-gui-code-in-juli...</a><p>If Julia is not your cup of tea then GTK can be used with Go and Swift as well.
Qt for Python may be an option: <a href="https://doc.qt.io/qtforpython/" rel="nofollow">https://doc.qt.io/qtforpython/</a><p>While the Qt API is imperative (`self.layout.addWidget(self.text)`, ...), focusing on declative Qml whenever possible helps with a more declarative approach.
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.<p>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.<p>Otherwise cross-platform <i>mostly</i> 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.
Personally I like JavaFX.<p>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.<p>As much as people hate Electron, the rendering engine in a web browser is head and shoulders better than any other cross-platform system and I think it's a sane model for programming. The main trouble w/ Electron is that you have 30MB of runtime for any application, even if it something that could be coded in a 25k .EXE file based on Win32.
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.<p>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.<p>I know this doesn't exactly meet your requirements, but I think this is the way to go if starting something in August 2022.
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)
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.<p>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.<p><a href="https://tauri.app/" rel="nofollow">https://tauri.app/</a><p>Check it out.
Flutter seems like the strongest option right now<p>Though overall, its not an uncommon issue. I've found myself in the same place multiple times, I've even considered using a lightweight game engine just for their UI features. But next time I run into it, I imagine Flutter will be what I go with<p>Edit: Just realising you said "native-looking". Not so sure about Flutter for that, I'm not sure such a thing exists.
I suggest to take a look at tauri[1], lorca[2](requires chrome to be installed) or webview[3](uses system webkit). If you're interested I made a small poc that can be shipped as a single binary file with webview and react - <a href="https://github.com/snehesht/goview" rel="nofollow">https://github.com/snehesht/goview</a><p>1. <a href="https://github.com/tauri-apps/tauri" rel="nofollow">https://github.com/tauri-apps/tauri</a>
2. <a href="https://github.com/zserge/lorca" rel="nofollow">https://github.com/zserge/lorca</a>
3. <a href="https://github.com/webview/webview" rel="nofollow">https://github.com/webview/webview</a>
Objective-C is not sane? Have you ever tried it for anything non-trivial? I know that it's not perfect and it's syntax is unappealing to some. I did iOS development for a few years (pre-Swift) and I really enjoyed using Objective C. I found it to be efficient, intuitive (once you get acclimated), and very pragmatic.<p>There are some very powerful capabilities in Objective C (like swizzling) that can be of tremendous help when you have some oddball functionality to implement. This would be conceptually very similar to the monkey-patching that folks do with Python. Perhaps this is the sort of thing that makes it not sane to you?
MAUI in .NET 7 checks many of the boxes you have here:<p>- Native looking: MAUI supports native controls as much as possible<p>- Cross platform: Nearly everything but Linux today (and there are forks out there trying to bridge that gap); macOS (Catalyst), Windows, iOS, and Android<p>- 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 that.)<p>- MAUI's focus is still on declarative XAML UI with databinding (MVVM), but there's a growing community for MVU (vaguely Elm-like) architecture including some official out-of-the-box support now.
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]<p>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.<p>[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.
This is a good resource of information if Rust is your thing:
<a href="https://www.areweguiyet.com/#ecosystem" rel="nofollow">https://www.areweguiyet.com/#ecosystem</a>
Sounds like you're looking for Flutter?
<a href="https://flutter.dev/" rel="nofollow">https://flutter.dev/</a><p>Also java can run on any platform so javafx, etc..
All the well-known cross-platform toolkits are C/C++, so you'll have to find bindings for whatever "sane" language you want to use. Your options are basically:<p>- Qt: the most widely used, but is a little janky on macOS and they've been going down the JS route recently<p>- wxWidgets: is a possibility, I haven't used it in a long time.<p>- GTK: "native" for Linux, but technically cross-platform. However the experience is lousy (and it is C, not even C++)<p>- JUCE: another long-standing, somewhat niche toolkit, but I've never used it or anything written in it.<p>- Flutter: must use Dart as the language, as far as I'm aware. Also, not sure how native-looking it is.<p>There are also Java and C#, but I've never used a Java UI that looked or felt remotely native (or even "good" for that matter). Haven't used any C# apps but I assume some toolkits exist.
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.
Why the emphasis on "unidirectional data flow"?<p>I happen to think Lazarus (based on Free Pascal) is great, but it's not a functional language at all.
I hope golang is modern language for Nerds:<p><a href="https://github.com/fyne-io/fyne" rel="nofollow">https://github.com/fyne-io/fyne</a><p>I done research and have found golang fune is able to run even on thin devices. It core depend on open gl and can be changed to run with messa for embeeded device displays. <a href="https://pirogove.blogspot.com/" rel="nofollow">https://pirogove.blogspot.com/</a>
If money is no object, Xojo fits the bill. Native UI, cross-platform Win/Linux/MacOS/iOS/Web and soon Android. Simple language, LLVM performance and lots of libraries.<p>In the free world, I'd say Racket is the next best thing. Native UI, runs on anything. But you have to fall in love with Scheme. It's easy for me, I'm already sold.<p>I haven't found anything else that a) doesn't break in production, or 2) turns out to be a giant pain in the.
Curious why Kivy framework which uses Python is not even mentioned. Is there something that I should be worried about? I am planning to learn Kivy soon.
You might want to check out Avalonia.FuncUI, which lets you use F# and the cross-platform Avalonia framework to build desktop applications with an Elm-like architecture: <a href="https://github.com/fsprojects/Avalonia.FuncUI#example-using-elmish" rel="nofollow">https://github.com/fsprojects/Avalonia.FuncUI#example-using-...</a>
Why do you want this app you are building to be cross-platform?<p>You've shared technical requirements, but you haven't shared business requirements. You should ask yourself whether you can actually achieve your business / user ends with a cross-platform approach. The three platforms are unique and users across the three have different expectations. For example as a Mac user, unless the software is super specialized such that there isn't any competition, a native Mac-focused solution will always be preferable to something that "kinda sorta" looks and acts like Mac software.<p>Without knowing the purpose of the software you are building, one has to really wonder if it <i>needs</i> to be native or should rather be a web app (for example), or even mobile first or tablet preferred.<p>Just some thoughts.
I mean, how native are we talking? Cross-platform native? Or platform native? Platform native UIs require you to actually read things like the Apple HIG, or the Windows Design Guidelines, and then create language-specific bindings to those operating system controls.<p>If you don't actually care about creating platform native UIs, you'll always be creating something that is a second-class design while putting in first-class effort. Why?<p>Frankly, you're better off just learning the operating system platform native UI programming language and get over yourself if you want to create something that looks like it was actually designed for the OS you're using.<p>And really, it's immature and insulting to call languages insane. Suck it up, these are peoples' professions here. No one wants to read that.
Another unusual alternative could be the V-language [1], depending on if you consider this a "sane language" ;-).
Not having used it myself and obviously you have to consider other arguments as well (community, developers, development activity, documentation etc.), but I was caught on all the features it promises, e. g. a "Native cross-platform GUI library": "V has a ui module that uses native GUI toolkits: WinAPI/GDI+ on Windows, Cocoa on macOS. On Linux custom drawing is used."<p>[1] <a href="https://vlang.io/" rel="nofollow">https://vlang.io/</a>
If you'd like to try your hand at an approachable functional language (Elixir): <a href="https://github.com/boydm/scenic" rel="nofollow">https://github.com/boydm/scenic</a>
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.<p>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.
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.<p>Maybe look into Skia, it’s Googles abstraction layer for multiple graphics libraries on multiple platforms.<p>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.<p>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.
Give Sciter a try, It's not OpenSource, but it's app are native looking written in js and html.<p><a href="https://gitlab.com/sciter-engine/sciter-js-sdk" rel="nofollow">https://gitlab.com/sciter-engine/sciter-js-sdk</a><p>*Edit
Also checkout <a href="https://haxe.org/" rel="nofollow">https://haxe.org/</a>
I didn't knew this one and are surprised at how well it works <a href="https://www.todesktop.com/" rel="nofollow">https://www.todesktop.com/</a>
How much do consumers really care about the native feel? Is this even an issue? There are so many graphic libraries that can create all the needed components, I wonder if people even _want_ those OS-centric styles on the buttons/window borders etc etc. Maybe it's the web developer in me that has been pressured to do the opposite: consistent styles across all browsers. Platform quirks are a headache, not the goal.
If you are fine with using Common Lisp, then Lispworks CAPI [1] and CLOG [2]. There are other options as well, the threads below can point you to those.<p>[1] <a href="https://news.ycombinator.com/item?id=13952643" rel="nofollow">https://news.ycombinator.com/item?id=13952643</a><p>[2] <a href="https://news.ycombinator.com/item?id=29181404" rel="nofollow">https://news.ycombinator.com/item?id=29181404</a>
I’m shocked to not see Flutter supported here. It’s not truly truly native I guess. But Dart is very modern and capable and the Flutter framework is better for building native UIs than nearly anything else out there. It’s also ridiculously developer-friendly to get builds going for all your target platforms quickly.
Many answers here are not well researched. There is not much of a selection of options for your requirement. I also imagine you want the app to be accessible then because of the three platforms?
The only option then is Qt with whatever binding to your "sane language".<p>Cross platform GUI toolkit is a very underdeveloped area.
Maybe not modern enough but I like to use Lazarus to create native desktop applications. It compiles to several platforms with a small footprint. It's based on Free Pascal.<p><a href="https://www.lazarus-ide.org/" rel="nofollow">https://www.lazarus-ide.org/</a>
Not everyone considers Tcl to be a same language, but if you are willing to approach things a little differently Tcl/Tk can be very effective in the space you are looking at.
Take a look at Apptron: <a href="https://progrium.com/blog/apptron-announcement/" rel="nofollow">https://progrium.com/blog/apptron-announcement/</a>
So you want to make a native GUI without a native language? Rust might be "a sane language" but it is not the best at GUI, the best tool I've tried is Qt.
Does it still make sense to use GDI or WinAPI to build GUI if the app is not large? I wonder what library did Bioware use to build the Aurora Toolset for NWN.