News for hackers. Stuff that matters.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by bonzini on Thursday December 19, 2019 @03:06AM (#21832937)
Qt and to some extent GTK+ come close. GTK+ can be programmed in Vala which is a fine language that transpiles to C and supports idioms such as asynchronous programming.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by Const-me on Thursday December 19, 2019 @04:51AM (#21833438)
> Qt and to some extent GTK+ come close

Both are C++: developers are more expensive to hire, and stuff takes more time to develop and debug. I'm proficient in C++ (programming for living since 2000), but I wouldn't pick the language for 2D GUIs in 2019.

> GTK+ can be programmed in Vala

Picking a non-mainstream languages is risky. Harder to find developers. Way more likely to find bugs in the toolchain and these can easily cost weeks to fix.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by bonzini on Thursday December 19, 2019 @05:41AM (#21833681)
You can also write GTK+ in JavaScript for that matter, or Python. Vala is a very underrated language though and it should be very easy for a good JavaScript programmer to pick it up.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by Snetry on Thursday December 19, 2019 @09:03AM (#21834931)
Enough languages have bindings for GTK or Qt to make it viable
Re:Building a new Windows 3.1 app in 2019: A Slack Client by otabdeveloper2 on Thursday December 19, 2019 @01:36PM (#21837766)
> Both are C++: developers are more expensive to hire, and stuff takes more time to develop and debug.

Have you seen the state of Javascript 'ecosystem' and job market?? Both statements are false.

The real reason is that C++ toolkits don't have platform and device independence. HTML and CSS are really good and powerful design tools, especially compared to composing raw pixels like you'd (essentially) be forced to do with Qt and GTK.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by ahartmetz on Friday December 20, 2019 @08:27AM (#21843938)
The ignorance in this thread is rather concerning.

Let me correct: GTK+ is not C++, it's C. Qt is very cross-platform: it supports about 10 platforms, including Linux, Windows, and macOS. You are not doing anything close to compositing raw pixels in Qt or GTK+. They have layout managers that are specifically made for typical application UIs, and they have lots of ready-made widgets. Qt also has QML, which is a declarative UI descriptions language kind of like HTML/CSS but much more productive because (gasp) it's actually designed from the ground up for applications, not websites.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by kleiba on Thursday December 19, 2019 @07:36AM (#21834320)
but I wouldn't pick the language for 2D GUIs in 2019

Which one would you recommend?

Re:Building a new Windows 3.1 app in 2019: A Slack Client by Const-me on Thursday December 19, 2019 @10:46AM (#21835862)
I mostly program for Windows and use C# for the GUI.

Cross-platform story is complicated, though. I have good experience creating a custom GUI framework for embedded Linux: drm/kms, gles, NanoVG, [DllImport], everything on top is custom C# code in .NET core 2.2. But that approach is not for everyone. I only needed 10-15 screens with simple GUI on them, it’s a 5” touchscreen with no other user-facing devices. Creating more advanced UX this way would consume too much time.

There’re Avalonia and Xamarin. Didn’t used them at that time because I needed full-screen GUI for a single-application Linux, without any desktop environments or user mode OS components. For desktops and especially mobile apps they might work OK.

It’s unpopular opinion here, but I think Electron is not that bad for GUI, esp. when writing TypeScript instead of JS. I think it’s similar story to Unity3D or PHP: low entry barrier attracted inexperienced programmers, then the whole ecosystem is judged based on the output of these inexperienced people.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by kleiba on Saturday December 21, 2019 @04:20PM (#21853425)
Great reply, thanks very much!
Re:Building a new Windows 3.1 app in 2019: A Slack Client by marton78 on Thursday December 19, 2019 @03:20AM (#21833006)
That's cross platform for Windows, Mac and Linux, but what about Web, Android and iOS?
Re:Building a new Windows 3.1 app in 2019: A Slack Client by shakna on Thursday December 19, 2019 @03:39AM (#21833099)
Ignoring that you probably _don't_ want the same interface across all of those...

Qt, as well as Windows, macOS and Linux actually can do Android [0] and iOS [1], and Web is halfway there [2].

[0] https://doc.qt.io/qt-5/android.html

[1] https://doc.qt.io/qt-5/ios.html

[2] https://wiki.qt.io/Qt_for_WebAssembly

Re:Building a new Windows 3.1 app in 2019: A Slack Client by danShumway on Thursday December 19, 2019 @11:00AM (#21836027)
I just want to step in quick to advocate. Please do not use Qt for the web. Their web export tools aren't just unfinished, they're actively hostile to web paradigms. The finished product doesn't render to the DOM, it's completely screenreader inaccessible, it overrides browser preferences. In a lot of ways, Qt on the web is even worse than Flash was.

You know all of the arguments against Electron that people trot out about how it's not real native, and it doesn't follow the right UX conventions or paradigms? Qt on the web is exactly like Electron on native, except way worse and without any sign that it's going to improve, because fundamentally Qt is structured around the idea that it should be able to spit out a binary blob of pixels instead of hooking into web-native primitives like the DOM.

Look into something that's showing more promise, like .NET and Razor. The Rust community is also doing some good work here, although I don't know that they have any UI frameworks that are mature enough to be reliable in an enterprise setting.

These aren't true cross-platform efforts yet, since they're still forcing you to think about HTML. But if I was going to bet on any project ending up with a real cross-platform solution that felt good on the web, some kind of export option from an Open Source Windows Forms or similar is probably what I would bet on. Either Microsoft or (possibly) the Rust community are the two parties that I think are most likely to end up producing a true native UI toolkit that can actually export to the web in a usable, acceptable way.

Re:Building a new Windows 3.1 app in 2019: A Slack Client by leadingthenet on Thursday December 19, 2019 @03:58AM (#21833194)
That's exactly what your users don't want you to do!
Re:Building a new Windows 3.1 app in 2019: A Slack Client by tjoff on Thursday December 19, 2019 @03:27AM (#21833041)
You do not want the same UI on desktop and mobile.
Re:Building a new Windows 3.1 app in 2019: A Slack Client by mmariani on Thursday December 19, 2019 @04:45AM (#21833409)
Beeware [0] does it too, natively in python. The architecture and code base are very nice as well. [1]

[0] http://www.beeware.org [1] https://dan.yeaw.me/posts/gui-widget-for-beeware/

Re:Building a new Windows 3.1 app in 2019: A Slack Client by Kipters on Thursday December 19, 2019 @03:47AM (#21833146)
Xamarin and Uno Platform