Live data from Hacker News

Rust: State of GUI, December 2022

kas-gui.github.io

141–149 of 149 posts

Re: Rust: State of GUI, December 2022

#141
post #136

Earlier quoted context omitted.

This. It’s so lame when UI elements can’t hang outside the bounds of the window (i.e. menus, tooltips, dropdowns, popovers) because everything is rendered like a game…

The problem right now the separation of concerns for GUIs is a complete shitshow on ALL platforms. Even such "simple" tasks as how to composite a window, a video in that window, and a floating menu over that window are not very well specified in any OS (try resizing that window and watch the fun). Or, for example, your floating menu--should the parent window resize itself and paint with transparent pixels in the extr…

Window resizing works perfectly fine on macOS if you use the native AppKit framework. It’s only when you try to embed a whole different world (Qt, GTK, Flutter, Electron) in your window via an opaque OpenGL/Metal surface that things break/lag/distort on resizing the window, which again is another reason to stay away from these cross-platform GUI shims.

I don’t really see the reason for multithreaded UIs either. A single UI thread works perfectly fine if you move your business logic off to a separate thread. Most people are just too lazy to do that, and start developing their app with the business logic running synchronously on the UI thread; which works for a while, but eventually reaches a point where it starts blocking the UI event loop; then they try bandaging it by moving certain pieces to a background thread and they shoot themselves in the foot with thread-safety issues. The way to solve this is not by making the UI framework multi-threaded… Simply be disciplined with UI ↔ business logic separation from the get go and all these problems go away. Yes, I know it’s so tempting to call the database directly from the button click handler - but don’t do it.

Re: Rust: State of GUI, December 2022

#142

Earlier quoted context omitted.

Does this actually render a native Android back button to the canvas or are you simply saying Pax solves this by not restricting the user from making their own solution to the problem?

Pax's Android chassis isn't built yet — but a Pax ` ` will render an actual native Android button to a layer on top of a separate canvas layer where vector drawing occurs. That native Android button will be affine-transformed, clipped, and occluded so that the two layers together act as a single coherent screen, and the developer can simply position / transform / layout that ` ` alongside, on top of, or underneath vi…

This could be very interesting, I'll have to keep an eye on the development. Thanks!

Re: Rust: State of GUI, December 2022

#143

Earlier quoted context omitted.

> So following your argument, pretty much all apps I use on macOS are 'wrong' as far as GUI goes. MacOS apps feel pretty wrong to me. Some don't remember which screen they should be on, and always go to that screen at a predetermined size and geometry (tkdiff). Others expand incorrectly to full-screen (macvim) when moved to a different screen. VSCode doesn't behave like the native apps. The list goes on, I'm short on…

My main counter argument would be that most of the tasks I do on macOS require/are better done full screen. And if you are on macOS doing any kind of design work, this is your mode of working. People using Photoshop or any 2D/3D DCC etc. You use all the screen space real estate on any number of screens you have. But even if I write code I run VSCode in full screen. If I have a dual screen setup I usually have one scr…

A good "tiling helper" is Rectangle Pro. The basic version does enough, but the paid one is a game changer.

Re: Rust: State of GUI, December 2022

#144

Unless a Rust OS is created with an official toolkit, Rust apps will always exist on a platform that already has a native toolkit. Any custom framework will always feel wrong and out of place. I use macOS, so apps should be written with AppKit. For Linux they should either be GTK or Qt, depending on desktop. Recreating widgets from scratch with GPU rendering is doomed to feel wrong to users.

The only cross platform toolkit that pulls it off well is Java. IntelliJ feels good on every platform. Qt apps can also feel native if a little effort is put into it. Rust GUI frameworks are one of its weaker areas IMO.

It’s mostly an IntelliJ thing. All other Java apps are ugly and weird.

And there are non-native behaviors in IntelliJ too. For example you can’t close windows by double-clicking the window icon on Windows (a feature of Windows since Windows 1?).

Re: Rust: State of GUI, December 2022

#145

Unless a Rust OS is created with an official toolkit, Rust apps will always exist on a platform that already has a native toolkit. Any custom framework will always feel wrong and out of place. I use macOS, so apps should be written with AppKit. For Linux they should either be GTK or Qt, depending on desktop. Recreating widgets from scratch with GPU rendering is doomed to feel wrong to users.

I'm the author of cacao, which is the first thing in this blog post - and is a Rust wrapper around native AppKit. Anything built with it feels fine on macOS and gets most things "for free", but the issue is that nobody wants to write AppKit anymore. ;P

You can blame a variety of things for this, but it's the reality. Apple doesn't really make it easier with the newer UI approaches creeping in.

Re: Rust: State of GUI, December 2022

#146

Earlier quoted context omitted.

Can you let me know about incremental compile times? Basically with the HTML frameworks that use macros I'm getting incremental builds 10 seconds or more. Did you experience the same?

Incremental compile times were quite fast, I'd say in the 1-2 seconds. I also have another project where I'm using Dioxus-web for a web application. When building a web app, it also has hot code reloading and I'd say reloads take under a second (though I just started this app so it only has a couple hundred lines of code). I have an M1 Pro Max though, which is quite a fast machine.

Thanks. I'll give it a try.

Re: Rust: State of GUI, December 2022

#148
post #77

KAS will never be popular so long as it can only be used with Rust apps. It's still nice to see how Rust can be used in this context, but maybe make it into a wrapper for something more flexible.

This seems like a bad take on popularity. What exactly is the criteria here? Is Qt not popular because it's not a JavaScript framework? I think it's much more valuable to look at this from the viewpoint of the Rust GUI ecosystem, and not compare absolute numbers where nothing comes close to JavaScript .

QT and a JS framework are used in very different contexts. If your toolkit is aiming to work on Windows, MacOS, and Linux desktops, it is directly competing with QT, GTK, and Native (on all 3, and very few apps do separate native UI). Open source works better with a larger user base, so aiming for "Window, MacOS, and Linux RUST APPS" is terribly restrictive on the number of people who will use it and hence maintain it.

I'm all for RIIR but it will take 30 years before enough has been rewritten for a Rust-only GUI to be viable IMHO.

Re: Rust: State of GUI, December 2022

#149

Earlier quoted context omitted.

have you built anything with it? We're using Tauri, but Dioxus looks very interesting.

I recently build this side project with Dioxus: https://terhechte.github.io/twitvault/ Here's a review of the experience of using it: https://www.reddit.com/r/rust/comments/zegv2e/comment/izb6nl...

It's beautiful!

OT: it seemed like an awesome application so I ran it but a few seconds into importing I got

"Rate limit for Tweet Replies reached. Waiting 18446744072038294844 seconds"

I'm not going to live nearly long enough for that!

ADD: and there's no cancel button or anyway way to stop it.

Post reply on HN