6 ms·
Original Nautilus and early GNOME developer here. I am very out of touch with what is current, so excuse some possibly ignorant questions. How is this a Rust-ba
by diskzero 5y ago
Original Nautilus and early GNOME developer here. I am very out of touch with what is current, so excuse some possibly ignorant questions. How is this a Rust-based environment if it is based on GTK? I assume GTK is still essentially the C-based GTK we used with some improvements.
Why is this called Rust-based? I’ll do some more research but would like to get some insight from more knowledgeable sources.
- k_kalupe22 5y agoEasy, it's for advertising reasons. 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.
- amarshall 5y agoThe answer seems to be that the applications [1] are written in Rust using gtk-rs [2] (Rust-bindings for the GTK libs). [1]: https://github.com/orgs/pop-os/repositories?q=&type=source&language=rust https://github.com/orgs/pop-os/repositories?q=&type=source&l... [2]: https://gtk-rs.org/ https://gtk-rs.org/
- mohanmcgeek 5y agoDoes this work similar to the python bindings that were ubiquitous a decade ago? 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?
- ludston 5y agoEven Rust code can still be unsafe. It's a question of where it can be unsafe. You're reducing the scope of code that can be unsafe to specific areas.
- symlinkk 5y agoSo basically it’s not Rust.
- cowsandmilk 5y agoHow pure does your program have to be to be rust for you? How few libraries in C or C++ must it call? The developers are writing all their code in rust, so it is in rust…
- symlinkk 5y agoIt’s a UI library that’s showing UI controls that are written in C. It’s dishonest to call it Rust because it wraps those controls in a layer of Rust
- southerntofu 5y agoBy that standard no binary that links against glibc, whether originally written in rust or go, is in fact rust or go.
- k_kalupe22 5y agoI appreciate your facts. But System 76 should then call it GTK based, I guess.
- mmstick76 5y agoOnly the applications are GTK-based. The compositor that makes the whole environment possible is written in Rust.
- Narishma 5y agoGTK is just a library, you can use it from any language it has bindings for.
- jandrese 5y agoThe issue is that Rust is extremely opinionated at to how code should be structured and there is going to be considerable interface friction with a system that is built around aliasing data every time there is a callback.
- acdha 5y agoDo you have an example of that friction? Looking through the docs at e.g. https://gtk-rs.org/gtk4-rs/stable/latest/book/hello_world.html https://gtk-rs.org/gtk4-rs/stable/latest/book/hello_world.ht... it doesn't seem that bad but not having used it I would be curious how it works out once you're building a serious app.
- jandrese 5y agoThings are already getting quite hairy by page 4[1] of that link. And that example is showing data completely owned by the GObject. If you need to pass a mutable reference to third party data to a GObject it's not going to work in Rust. Imagine a button that you click to change the contents a GtkTreeModel connected to a GtkTreeView--you're going to need to work hard. You're going to write a fair bit Rust specific glue code to work around these issues. [1] https://gtk-rs.org/gtk4-rs/stable/latest/book/gobject_memory_management.html https://gtk-rs.org/gtk4-rs/stable/latest/book/gobject_memory...
- rollcat 5y agoAsking as someone who's never spent significant time/effort working with Gtk/GObject in C (only a bit in Python). Isn't it still generally desirable to have the compiler yell at you, if you can't convince it you know what you're doing? Rather than allowing the possibility of memory corruption. 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.
- sprash 5y agoAlso GTK4 means they are still at the mercy of GNOME which changes APIs often and without consideration for third parties. Wasn't the whole point of the project to emancipate themselves from GNOME? If they rely on GTK they will fail.
- bmarkovic 5y agoSo XFCe == GNOME and LXDE is GNOME or KDE, depending on which version we're talking about? 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.
- mixedCase 5y agoWith the transition from version 3 to 4, GTK is now more focused on being a generic UI toolkit, with GTK4-based libadwaita now being the place to be for GNOME-specific patterns.
- sprash 5y agoHistory and experience tells a different story [1]. Never trust a library that is maintained by GNOME. 1.: https://github.com/thestinger/termite https://github.com/thestinger/termite
- addicted 5y agolibadwaita exists solely to move Gnome specific stuff out of GTK into libadwaita. 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.
- lmm 5y ago> it's hard to see how an open source project with as many developers as Gnome/GTK have can have some secret agenda How many serious Gnome/GTK developers are there who are not IBM employees?
- deleted 5y ago[deleted]
- mmstick76 5y agoDepends on what parts of the environment you're looking at. The compositor that's the basis of the entire environment will be written entirely in Rust, based on smithay. But applications written for COSMIC are currently based on GTK4. 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.