News for hackers. Stuff that matters.
Re:Rust 2021: GUI by jakear on Tuesday September 29, 2020 @05:26PM (#24633195)
What's the development experience scene like for Rust GUIs? In my experience developing Electron apps there are a a couple major plusses that I'm not sure Rust can compete with, based only on my limited knowledge of the ecosystem:

- Excellent embedded developer tools. Hundreds of thousands of engineer-hours have gone into the chromium devtools, providing everything from styling overrides to layout metrics to profiling tools to a REPL to DOM tree inspection and modification, to an integrated debugger, etc etc etc, and all of that is at your disposal with a simple Cmd+Opt+I. To my knowledge Rust doesn't have anything like this.

- Super quick incremental updates. Making a change and seeing the impact is sub-second, even on large projects (vscode). Based on my understanding of rust, recompilation can take a very very long time. When making GUI's a lot of the time is spent making finicky little changes and reloading -- if that inner loop is slow you're going to have a bad time.

Re:Rust 2021: GUI by raphlinus on Tuesday September 29, 2020 @05:35PM (#24633297)
I've talked up the strengths, you've brought up the big weaknesses. I think there is some interesting work on both of these fronts, but the developer experience situation is very primitive so far by comparison.

Compile times have been getting better. For reference, on my machine an incremental build of Runebender is 2.3s. Part of this reflects some choices we've made to use platform capabilities rather than build the entire stack ourselves.

Re:Rust 2021: GUI by pornel on Tuesday September 29, 2020 @08:38PM (#24634691)
DevTools is the killer feature.

I've developed a Gtk GUI in Rust recently. It wasn't bad, but I probably won't use it ever again. When I'm debugging a UI, I want to right-click it, select Inspect, and be able to tweak everything live.

DevTools is such a force multiplier, that I'm confident I can quickly and reliably develop a whole GUI from scratch, with custom layout animations and bells and whistles using JS+CSS. I have zero confidence in doing anything in Gtk or Cocoa beyond dumping static pre-built controls in a window. The cycle of editing blindly, recompiling, and re-running is the old paradigm that I don't want to return to.

Re:Rust 2021: GUI by jakear on Tuesday September 29, 2020 @09:04PM (#24634813)
Seems to me like the future could well be TS/Electron with bindings to Rust for system-level high perf activities. Let the UI scripting language and mature rendering platform do the UI scripting and rendering, and let the high performance systems programming language do the performance-critical system interfacing.

For example, in vscode we do almost everything in TS, but shell out to ripgrep for workspace text search.

Re:Rust 2021: GUI by brundolf on Wednesday September 30, 2020 @02:27AM (#24636186)
This is what some people have started doing, and it works well as long as your bottleneck lives outside of the UI itself. But for some highly complex apps, web layout itself can become the bottleneck, and that's really hard to work around. VSCode is an absolute miracle in this regard, but it uses lots of dirty tricks under the hood to accomplish that.
Re:Rust 2021: GUI by pjmlp on Wednesday September 30, 2020 @01:57AM (#24636057)
Great, here is an off topic quick feedback to someone from VSCode, in what concerns search I always end up starting notepad++ Ctrl-Shif-F, get what I was searching for, meanwhile VSCode just keeps showing its increasing blue line without any results to show up.

Which is quite disappointing, given ripgrep's reputation in search performance.

Re:Rust 2021: GUI by jakear on Wednesday September 30, 2020 @04:39AM (#24636735)
Have you perhaps disabled ignore files accidentally? It’s the toggle in right of the the exclude field.
Re:Rust 2021: GUI by pjmlp on Wednesday September 30, 2020 @06:05AM (#24637108)
Seems to be enabled, oh well there are enough Github issues related to search performance anyway. Thanks for the help.
Re:Rust 2021: GUI by jakear on Wednesday September 30, 2020 @12:29PM (#24640524)
Up to you if you want to go through the rigamarole, though we do appreciate every issue^, even if we do end up closing it as a duplicate :)

^well, every issue that isn't completely void of information ;)

Re:Rust 2021: GUI by maxxk on Thursday October 08, 2020 @06:10AM (#24717679)
Actually there is built-in GTK Inspector [0] and I used it successfully with gtk-rs before.

    GTK_DEBUG=interactive your-app
[0] https://wiki.gnome.org/Projects/GTK/Inspector
Re:Rust 2021: GUI by fulafel on Wednesday September 30, 2020 @12:15AM (#24635642)
GTK has all bits needed to support this tweaking workflow, no? "Just" missing a UI (outside the GUI builder tools).
Re:Rust 2021: GUI by pjmlp on Wednesday September 30, 2020 @02:00AM (#24636073)
Kind of, you need introspection capabilities, check for example live tree in VS for WPF and WinUI/UWP for .NET and C++ applications.
Re:Rust 2021: GUI by higerordermap on Wednesday September 30, 2020 @03:53AM (#24636537)
Flutter is an example you can have efficient AOT compilation while not sacrificing ability to hot reload during development.

The tooling is not here yet. But there are drawbacks to using web and flutter is already promising. Any progress in this field should be welcomed by us.

Re:Rust 2021: GUI by thayne on Tuesday September 29, 2020 @10:27PM (#24635154)
Otoh, despite the name, electron apps are very heavy in terms of both memory and disk size, have a long load time, and can be very slow if not designed well.
Re:Rust 2021: GUI by pjmlp on Wednesday September 30, 2020 @01:52AM (#24636041)
Same applies to other native GUI tools, like WPF/WinUI(UWP), Qt, Cocoa,...

The Rust semantics also seem to make it quite complex to just drag components around on a GUI designer, because the lifetimes become dynamic and just dropping a component in the middle of a form can have multiple lifetime meanings, depending on the surrounding context.

Re:Rust 2021: GUI by detaro on Wednesday September 30, 2020 @05:15AM (#24636878)
Qt at least has Gammaray for introspecting running apps.
Re:Rust 2021: GUI by nyanpasu64 on Wednesday September 30, 2020 @02:45PM (#24642164)
GammaRay is like Dev Tools but extremely unstable, and requiring fiddling with ptrace permissions on Linux, and I don't know how to make it work on Windows.