Re:Rust 1.34.0
by whatshisface on Thursday April 11, 2019 @02:47PM
(#19637872)
We will soon have async/await syntax which will replace some of the use case of callbacks, and (I assume) reduce the borrow bookkeeping tedium.
[ Parent
| on HN ]
I don't think it covers GUI callbacks like on Gtk-rs, accessing internal widget data.
I think that's likely. async/await doesn't appear to map directly onto traditional OO GUI framework callbacks well, just like rust doesn't tend to map well to traditional OO. I believe that async/await will open up new architectural patterns that should be as ergonomic as traditional OO callbacks for GUIs. But these won't map well to existing code or existing frameworks.
Re:Rust 1.34.0
by steveklabnik on Thursday April 11, 2019 @03:16PM
(#19638155)
There have been attempts, like relm, to map futures onto GTK. That means it would work with async/await too, as they’re fundamentally sugar for futures.
Even those are basically Relm components that happen to render via GTK. You can't really import a plain `GObject` and implement a traditional `fn on_click()` without having to worry about internal mutability and the associated borrow checking complexities.