Live data from Hacker News

Rust: State of GUI, December 2022

kas-gui.github.io

91–100 of 149 posts

Re: Rust: State of GUI, December 2022

#92

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.

When it comes to Java GUIs, Intellij is the exception, not the rule.

Re: Rust: State of GUI, December 2022

#93

Is there a decent immediate mode GUI for Rust? Think ImGui, I know of eGui but unsure how workable it actually is in reality.

I've only had a very brief encounter with eGui (using Python+ImGui on a project), but I was very positively impressed by it. If we were starting that project today, we would've gone with eGui.

Re: Rust: State of GUI, December 2022

#94

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.

> Recreating widgets from scratch with GPU rendering is doomed to feel wrong to users. So following your argument, pretty much all apps I use on macOS are 'wrong' as far as GUI goes. Off the top of my head from what I use most of the time: Maya, Houdini, Blender, Fusion360, Resolve, Darktable, Slack, Discord, VSCode. Not a single one of them uses native Cocoa widgets. And I couldn't care less. Some of these are top o…

> Not a single one of them uses native Cocoa widgets. And I couldn't care less.

Meanwhile I do care. My main reason being: macOS offers fantastic facilities for inspecting and scripting the native GUIs, think using the web inspector or GreaseMonkey, but across the entire OS - but of course it breaks e.g. on Electron apps. Other people will cite help menu integration, custom key shortcuts, accessibility (not only for the disabled), and - yes, resource usage. I remember being productive on a system with 256M of RAM, and before that - 4M, and before that - 64k. It's frustrating to see so much progress wasted, I shouldn't need to close ALL of the chat apps just to run StableDiffusion more smoothly.

Re: Rust: State of GUI, December 2022

#95
post #38
post #17

Earlier quoted context omitted.

What even is "native" on Windows? Is it Win32? WinForms? WPF? UWP? WinUI? Windows App SDK? There's so many to choose from and they all look and behave differently.

Win32, WinForms, WPF are as good as it gets, and really the only ones that matter. UWP is deprecated, althought it keeps being the one mostly used on Windows 11, as WinUI still isn't up to its game and keeps collecting issues across all their repos. Windows App SDK is not a GUI framework, rather the new marketing name for Project Reunion, the porting of UWP runtime infrastructure on top of standard COM without sandox…

Do you know which of those toolkits is used for the new Windows 11 Notepad? It's quite a bit more "laggy" to scroll in than the old Notepad that's still on the Server edition.

Re: Rust: State of GUI, December 2022

#96
post #82

Earlier quoted context omitted.

I think, now in 2022 it is time to let go of this idea (for cross-platform applications). What you propose means that any app that wants to be available on "all" desktop platforms has to be written at least 4 times (macOS, Windows, GTK, Qt) and few developers or organizations have the resources for that. > Recreating widgets from scratch with GPU rendering is doomed to feel wrong to users. Yes, and no. When these wid…

The problem with this is unless you drag in something like Electron, you're inevitably going to end up using (or writing) something that just doesn't have the number of maintainers and quality development as either the native UI or an embedded webview. There's nothing with the level of development of e.g. Qt for Rust. Which means "unsexy" things like accessibility get left by the wayside. And your users suffer. Writi…

It's a tough story indeed, but every existing toolkit had to start from scratch at some point. If I'm not mistaken Druid had its start in 2017 (I personally contributed some stuff on the GTK bits around 2019) and it is far from ready but I see it progressing in the right direction. Accessibility is on its roadmap as well I believe.

This is why Rusts' "Are we GUI yet?" and posts like this are a good thing. Eventually some new toolkit will arise that ticks all the boxes. We are not there yet and it will require a huge amount of work.

Re: Rust: State of GUI, December 2022

#97
post #38

Earlier quoted context omitted.

Win32, WinForms, WPF are as good as it gets, and really the only ones that matter. UWP is deprecated, althought it keeps being the one mostly used on Windows 11, as WinUI still isn't up to its game and keeps collecting issues across all their repos. Windows App SDK is not a GUI framework, rather the new marketing name for Project Reunion, the porting of UWP runtime infrastructure on top of standard COM without sandox…

Do you know which of those toolkits is used for the new Windows 11 Notepad? It's quite a bit more "laggy" to scroll in than the old Notepad that's still on the Server edition.

The old notepad was Win32, the new one is WinUI, there you have it, how good WinUI is in its current state.

https://www.thurrott.com/windows/windows-11/260092/hands-on-...

Re: Rust: State of GUI, December 2022

#98
post #67

Shout out to Dioxus. It's a react clone that provides a really nice experience and can run a web GUI faster than React can. That's quite the accomplishment given the disadvantage of having to use shims to access the DOM. If you want to choose a single language that can create native GUI's, Rust is probably your best or only choice. Other languages are lacking a good story for either the web or for iOS but Rust works…

kotlin is a decent choice as well

True. I forgot about the family of languages that will transpile to Javascript. That gives most of them a good web front end story, and of course Kotlin has a good iOS story.

Re: Rust: State of GUI, December 2022

#99

Earlier quoted context omitted.

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

Does Dioxus run in a webview on mobile? That's how I'm reading the docs.

In theory it doesn't have to. In practice, yes.

My comment said that rust had a great cross-platform story, not Dioxus. If I was doing cross-platform rust I'd use cacao for iOS, Dioxus for web front end, et cetera.

Re: Rust: State of GUI, December 2022

#100
post #82

Earlier quoted context omitted.

I think, now in 2022 it is time to let go of this idea (for cross-platform applications). What you propose means that any app that wants to be available on "all" desktop platforms has to be written at least 4 times (macOS, Windows, GTK, Qt) and few developers or organizations have the resources for that. > Recreating widgets from scratch with GPU rendering is doomed to feel wrong to users. Yes, and no. When these wid…

> But if we drop this constraint and design widgets with their own consistent style within the same app Style is just one of many things. And it's extremely hard to properly code your own consistent UI toolkit. On top of that every platform has a myriad of platform-specific behaviors that people expect and that you will get wrong in yours. Accessibility is the big elephant in the room. But even things like secondary…

I agree, which is why I'm not advocating writing or designing your own toolkit. Instead we as a developer community should focus on the "next generation" of toolkits for the modern cross-platform world. Take all that we have learned from GTK, Qt, Flutter and all the web stuff and incorporate it into something new for the next 10-20 years.

Rust is a nice language for that since it is already a "next-generation" language in terms of memory safety and its momentum is still building. Projects like Druid, while far from ready, are a good starting point.

Post reply on HN