Live data from Hacker News

Ask HN: What's the best library for making cross-platform UIs?

news.ycombinator.com

181–190 of 230 posts

Re: Ask HN: What's the best library for making cross-platform UIs?

#181
post #33

Earlier quoted context omitted.

JUCE is a great framework, has a very commendable coding style and is easy to get into. One thing to note is that the "JUCE way" of doing things is to have a UI that looks exactly the same on every platform - this is good for predictability, but if you want a UI that looks native , you're better off using Qt or wxWidgets (as C++ UI toolkits go). In many cases I'd say that's not an issue, and JUCE is underrated/underu…

probably licensing and cost limit juce's popularity.

Licensing and cost is similar to Qt (free for open source, $$$ for commercial applications, though I think JUCE is cheaper). So, at least relatively to Qt, it doesn't particularly limit popularity.

And even in an absolute sense, you can't confidently say that dual-licensing limits popularity in the long term. If JUCE and Qt were free for everyone, perhaps they wouldn't be able to have the full-time developers they both currently have. So maybe they wouldn't be as good, thereby decreasing popularity against competing dual-licensed libraries. This is all wild speculation, of course, but it's an example to show how their model works.

Re: Ask HN: What's the best library for making cross-platform UIs?

#182
post #171
post #127

Earlier quoted context omitted.

Pretty sure that C++ and Qt is what you want. Maybe not perfect in every sense, but widely used and battle-tested. If you don't want to deal with Windows, you can cross-compile for Windows from Linux using the mingw-* packages (eg https://fedoraproject.org/wiki/MinGW or the Debian or SUSE equivalents).

Or you can use preconfigured cross-compilation toolchain like MXE[1]. If you have clean codebase and use CMake it's usually enough to just pass one extra argument to get working binary out. And it's also work on OS X. [1] http://mxe.cc/

MXE has an ok reputation. Not everything seems to play well with it though. :(

For example, we (sqlitebrowser.org) compile our window nightly releases from Linux, using MXE. But, SQLCipher (an encryption library) doesn't build with MXE. So the nightlies don't support encryption.

Meanwhile, we've figured out how to do full Windows dev setup and builds. eg:

  https://github.com/sqlitebrowser/sqlitebrowser/wiki/Setting-up-a-Win64-development-environment-for-DB4S
We're building our releases natively now, and the nightlies will be built natively too in (hopefully near) future.

Guess we just outgrew MXE?

Re: Ask HN: What's the best library for making cross-platform UIs?

#183
post #129

Just getting started on Electron myself. Used by Atom, Slack, Visual Studio... It's worth a look ;) Electron - Build Cross-Platform Desktop Apps With HTML, JS, CSS http://electron.atom.io/

No HTML, JS, CSS. Electron is eliminated.

Huh? I don't get what you are saying. Are you referencing something here?

Re: Ask HN: What's the best library for making cross-platform UIs?

#184
post #133
post #109

None, abstract the functionality of your app into a cross-platform library and build a native GUI for each platform you support using that platform's native SDK.

Shouldn't this be a solved problem?

There's a reason there are multiple OS's, right?

One of the reasons is different UI paradigms and choices.

Re: Ask HN: What's the best library for making cross-platform UIs?

#185
post #23

It would help a lot to have the question elaborate on what you really need. What do you mean by "best", and do you actually need the best? Do you need easy to learn, or code that is easy to deliver, or most powerful features, or most number of platforms covered? Do you include mobile in cross platform, and do you have a performance or language requirement? A web app is one of the most cross platform ways to go, is th…

I agree across the board with your assessment.

It is a shame that OP does not want to go HTML/CSS engine, because over the years, I have found that to be the easiest to update, the most reliable across platforms, and (most importantly) the easiest to support for multiple users.

I have tried (and used in production) most of the UI tookits mentioned here.

WxWindows (later WxWidgets), Tk, and FLTK are getting long in the tooth and show it.

Java (SWT, etc), looks wonky across platforms and really do not stand up to the "write once, run anywhere" promise. Also, if you have to do anything even a little out of the lines, count on keeping multiple codebases for different platforms.

Although I had a brief love affair with other VM-type platforms (Adobe Air, Silverlight), mobile mostly pushed support for them out (Air just pivoted to mobile altogether, I believe). They offered single codebase, easy updates, and easy-ish support at a cost of have the user install additional software, but worth the tradeoff in my opinion.

All of the python UI libs are a pain in the ass to distribute, update, and support.

Ultimate++ and Borland Delphi are pretty polished, but you either have to buy into their ecosystems or accept their limitations.

At the end of the day, even though Javascript is a bullshit language for desktop development, HTML/CSS engines (phonegap, Electron, sciter, etc) are just pleasant for maintaining codebase, pushing out updates, doing anything you want with the UI, and support has been a breeze.

Re: Ask HN: What's the best library for making cross-platform UIs?

#186
post #104

Earlier quoted context omitted.

Instead of giving me the tools to make a modal pop-up, but then leaving me to match that modal pop-up to the stylistic conventions of each OS GUI, why can't a UI framework give me a "YesNoModalPopup" that looks and acts however a "YesNoModalPopup" is supposed to act on the respective OS—even going so far as to actually be a modal sheet or a command-line prompt instead? This, I think, is one of the bigger but oft-unst…

> why can't a UI framework give me a "YesNoModalPopup" that looks and acts however a "YesNoModalPopup" is supposed to act on the respective OS As a simple counter-example, macOS rarely uses Yes/No/OK/Cancel buttons. Instead, dialog buttons have meaningful names based on the task at hand, e.g. "Overwrite File" and "Keep Old File".

That's exactly what I meant, though. "YesNoModalPopup" is the name of a semantic behavioural contract, not a concrete implementation class whose name describes what you'll see. In instantiating a YesNoModalPopup, there would be required fields for button labels—even though those field-values will only be used on OSX.

With an abstract+declarative toolkit, you would still have to do just as much customization toward your use-case as you would if you were writing one view class for each GUI. You just get to skip the marginal cost of everything that's not that customization. You can have a single code path to create, and show, and receive input from, the instance of the pop-up abstraction.

Re: Ask HN: What's the best library for making cross-platform UIs?

#187
post #135

It depends on what you mean by, "cross-platform." In my world there is no such thing. You pick your target platforms and program to them. However it is common to imply "major platforms" (ie: iOS , Android , Windows 10 , OSX ). Different platforms have different requirements and will shape your solution. Next... what is the application? Do you need to target native APIs? Do you have memory limitations? If you don't mi…

> there is no such thing Why?

Different platform, different requirements.

If a language run-time or virtual machine promises, "you can write code once and run it anywhere," then they're not telling you the whole story. There's no such thing as, "cross platform." It's just a vague term that is commonly interpreted as, "major OS platforms," or, "most popular mobile platforms," etc.

Requirements are both technical and non-technical. If we just focus on the technical requirements you have to look at the data you're working with, your user, and how the program interacts in this system between the human and the rest of the world. If you're writing safety-critical mobile applications for remote workers that spend a week or more in the field you're probably not going to waste your resources on a memory-hungry VM just so that life is more convenient for you. That's starkly different to prototyping an application in a lab where convenience is paramount compared to cheap resources. I have yet to see any kind of language or run-time that lets you have it both ways.

One may say, "Yes agentultra, but what about generating the code for the highly-constrained environment from the higher-level language?" I love this approach. It's possible to generate efficient code this way. This approach still requires you to understand your target platform well enough to spot bugs in the generated code. So while it may be an approach to gain some leverage as a single developer or small team; you're still quite constrained but this DSL... the same code written for the DSL is not likely going to run well or even be considered for use by your other target platforms.

I haven't yet found a way to "escape" the reality that different combinations of hardware and OSs require different solutions for different applications. It may seem like "all you need is Java" or X, Y, or Z -- but the reality is more nuanced than that.

Re: Ask HN: What's the best library for making cross-platform UIs?

#188

Strange nobody mentioned wxWidgets so far which gives you true native apps, so I'll do it: http://wxwidgets.org It provides API layer which compiles to Win32 API on Windows, Gtk2 on Linux and Carbon/Cocoa on Mac OSX. Qt only emulates Windows controls, but wxWidgets uses the actual Windows controls via Microsoft Win32 API. BTW, there's wxQt, a wxWidgets implementation that uses Qt instead of Gtk, but it's still experi…

> Qt only emulates Windows controls, but wxWidgets uses the actual Windows controls via Microsoft Win32 API.

I don't think this is actually what you want on Windows. The standard common controls are pretty outdated. Anyone who has built a complex program with a lot of widgets using common controls (or a framework that wraps them) can probably tell you that they're really slow and they have problems with flicker. They also use outdated font rendering (GDI rather than DirectWrite) and they don't natively support alpha-blending. Even Microsoft avoid using common controls. Task dialogs, Aero wizards and most control panels are built with an internal toolkit called DirectUI. Office is built with similar technology, and obviously WPF and Windows Store apps don't use common controls.

This makes Qt pretty much what you want on Windows. It uses the native theming APIs so its controls look native, but they are rendered with a high performance raster engine that supports alpha-transparency and eliminates flicker. Also, I think the latest version of Qt uses DirectWrite for font rendering.

Post reply on HN