Why is this called Rust-based? I’ll do some more research but would like to get some insight from more knowledgeable sources.
Why is this called Rust-based? I’ll do some more research but would like to get some insight from more knowledgeable sources.
[1]: https://github.com/orgs/pop-os/repositories?q=&type=source&l...
[2]: https://gtk-rs.org/
My understanding is that you don't get any memory safety/performance advantage from using Rust because gtk can still be unsafe.
Is this correct?
Wasn't the whole point of the project to emancipate themselves from GNOME? If they rely on GTK they will fail.
1) do the yak-shaving and create a whole new GUI stack in Rust (which would be an absolute boon to the Rust community but will be a tremendous effort), or
2) switch to Qt (and basically become KDE)
Thinking about it, maybe Sciter (https://sciter.com/) would be an okay foundation to build a DE in (lightweight stack, flexible theming, solid Rust bindings). But then it isn’t open source (only the interface is, you need to pay for source access), so maybe not.
Is there a reason iced is not good enough (other than not being accessible)?
but looking good so far, gonna check this out for myself. I was rooting for azul, but iced seems to be further ahead
Anyway although a11y and i18n support have not been implemented, they are planned.
If Iced actually gets cross-platform accessibility support, that's great! Very few projects have that today. More certainly wouldn't hurt. But until it does, you shouldn't base a DE on it.
Edit: The issue you linked to is about RTL support. That's also required, but doesn't touch on a11y.
https://en.wikipedia.org/wiki/Input_method
https://github.com/iced-rs/iced/pull/686
See the challenges of properly supporting IME in Druid, another Rust toolkit:
- Rendering multiple layers
- Creating multiple windows
- Multiline text layout and editing
And it's hard to see how an open source project with as many developers as Gnome/GTK have can have some secret agenda that is counter to what they are saying publicly and creating libraries and code publicly to implement.
How many serious Gnome/GTK developers are there who are not IBM employees?
>Implementing keyboard selection inside vte means that every terminal based on vte benefits; adding only hooks for you means that all the other terminals get no benefit.
The patch being pushed wasn't going to help other projects. The developer of that project was working on a fork of the library but it appears it didn't get much use and was abandoned: https://github.com/thestinger/vte-ng
I don't see much more that anyone from GNOME could have done there.
UI toolkit doesn't equal a desktop environment. There is tons of stuff in the GNOME ecosystem (some of which it will make a lot of sense for System76 to reuse, no doubt) that can be entirely ignored when you're using GTK to, essentially, draw your UI widgets for you.
And it has to be said that memory safety isn't Rust's only compelling feature. It also has a pretty great build system, a decent library ecosystem, a very strong type system which gives you an "if it compiles it works" experience surprisingly often, probably the best multithreading system, etc. etc.
In well-tested libraries like GTK, SQLite, Curl, and such, they are often quite robust just based on having been heavily developed and tested by many people over a very long time, and there are still ways that they can be misused and abused that are usually well-documented and warned against. A well-developed Rust wrapper actually makes it impossible to misuse one of these libraries from Rust, and therefore better enables a much smaller team of developers to write secure, robust applications. Rust can guarantee these documented restrictions at the type level and even make impossible many error conditions.
So even though the UI is GTK, Rust still enables developers to write more robust applications with less fear. Personally, I find that GTK with Rust is a very pleasant experience. It's less about guaranteeing that the lower libraries have no bugs and more about preventing people from interacting with the libraries in dangerous or buggy ways.
While the lower layers written in C do impact the overall safety, the bindings are made to be as safe as possible.
For example: every glib parameter that may take NULL in Rust becomes an Option<T>.
GObject's methods are defined on traits and checked by the Rust type system. There are also some macros to provide an easy and safe interface to the GLib type system.
All of this directly applies to gtk-rs.
Overall, the bindings are well documented and with many examples. There's even a book. Also, there's a great community around them.
Bindings website: https://gtk-rs.org/
[1] https://gtk-rs.org/gtk4-rs/stable/latest/book/gobject_memory...
I do agree that the code in the example is far from beautiful. I wonder if we were to redesign GObject from scratch, if we could make interfacing with Python, Rust, JS, etc a bit less hairy.
Of course, that obvious may turn out to be incorrect for some edge condition.
Basically, that’s the same reason why mathematicians don’t put all proofs through a proof assistant.
The core of TLS 1.3 was proved before it shipped. But, the proof makes an assumption which has consequences. It assumes when communicating using an agreed shared secret† you have a separate shared secret for every such pairing. So Alice and Bob need a shared secret but (and this is where humans trip up compared to what was actually proved) the proof says Bob and Alice also need a shared secret different from the one for Alice and Bob.
The consequence of this accidentally missed assumption is the Selfie attack. Alice and Bob share a secret S and communicate over the Network using TLS 1.3. Bob fed the cat half an hour ago. The cat has employed Mallory to trick Alice into feeding it even though Bob already did. Alice sends a message on the Network. It is encrypted with S and it says "Did you feed the cat?". Mallory doesn't know S and can't read this message or tamper with it. But Mallory simply redirects the message back to Alice. Alice receives a message, properly encrypted using S, which says "Did you feed the cat?". She presumes this message is from Bob, so she answers "No, go ahead and feed the cat". Mallory redirects this response back to Alice too. Alice receives "No, go ahead and feed the cat" and she concludes Bob hasn't fed the cat so she feeds it again.
Oops.
The proof was fine, but we brought an assumption along that we did not clearly articulate.
† You never use this mode in your web browser, but IoT things might do this because it's easier than all that stuff with certificates.
In rust, that's what the unsafe keyword is allowed. It doesn't mean that the code is actually unsafe, but rather that the compiler should trust you on this one.
There's some libraries that effectively automate GTK in this way, such as relm4.
Yes, there is relm nowadays, which was yet to be born when I did my Gtkmm => Gtk-rs port.
At least I can also now point others to the book.
GTK is currently the best GUI toolkit for Rust application developers. It's the only toolkit that's fully functional with first class and official bindings. It's been pretty well endorsed by GNOME for most of their new applications lately.
There are some Rust GUI toolkits out there that are shaping up, such as some former Qt developers actively developing sixtyfps, but it'll be a while before we have a GUI toolkit in the Rust space that's truly ready for complex application development.
Devs, admins, enthusiasts etc. are the main target for Systems 76. Hackernews audience is very enthusiastic regarding Rust.
I think it's indeed unfair to GTK.