guiIn 2019, “GUI” was the 6th most highly requested feature that was preventing adoption of Rust. This is fundamentally a limitation in Rust: the design of the language itself makes modelling common approaches to building UI difficult.
In this post, I’ll discuss why Rust’s unique memory management model and lack of inheritance makes traditional techniques to build a UI framework difficult and a few of the ways we’ve been working around it. I believe one of these approaches, or some combination of them, will ultimately lead to a stable cross-platform UI toolkit for high-performance UI rendering that everyone can use.
Tag: gui
Posts
gtk guiAs you might’ve noticed, the gtk3-rs projects are getting less and less attention and we intend to deprecate them in one of the future releases. Therefore, we recommend to anyone who didn’t upgrade to GTK4 to do it now. gtk3-rs will get further releases in the foreseeable future to keep up with gtk-rs-core, but no development effort is going to be directed towards it. This is already the de-facto situation for more than a year. Additionally, the GTK3 versions of various externally maintained bindings will most likely not get any further releases.
In addition to gtk-rs, various externally maintained bindings also had a new release. For gstreamer-rs you can find the CHANGELOG of the 0.20 release here. Most bindings maintained as part of GNOME were also updated.
On this note, time to go through the major changes of this release. Enjoy!
guiRecently I found myself in need of doing GUI with Rust, so I researched and experimented a bit. In this post, I want to share the data I collected, as it might help others. I will mostly compare Tauri, Iced and egui as those seem to be popular choices. I spent quite a bit of time performing tests to assess the speed/performance of these libraries, as a snappy UI experience is something I really value.
gui windowsNative-Windows-Gui (aka NWG) is a windows GUI library that runs on top of Win32. Its main goal is to provide a rust-first API that is dead simple to use, keeps compile time low, does not bloat the final binary size, and provides a large number of features. As the first stable release, all those goals are met.
NWG also comes with a sister project, Native-Windows-Derive (also released as 1.0) that uses a procedural macro to build a GUI from a struct, removing almost all the boilerplate.
NWG is best suited for small to medium size projects that don't require fancy stuff (like animations or custom drawing).
guiA bit more than four years ago I started the xi-editor project. Now I have placed it on the back burner (though there is still some activity from the open source community).
The original goal was to deliver a very high quality editing experience. To this end, the project spent a rather large number of “novelty points”.
I’ve written the CRDT part of this retrospective already, as a comment in response to a Github issue. That prompted good discussion on Hacker News. In this post, I will touch again on CRDT but will focus on the other aspects of the system design.
guiAn immediate mode GUI library written in Rust. Works anywhere you can draw textured triangles.
qt sailfish gui actixEver since it’s illegal for me to leave my house, my weekends have been filled with rewriting Whisperfish. Whisperfish is an app, originally by Andrew E. Bruno, that natively implements Signal for SailfishOS. My goal with the rewrite is to modernize the non-GUI code such that it uses the official libsignal-protocol-c instead of the Go-reimplementation. For this, I would either use C++ or Rust; the title of the post probably spoiled which one I prefer.
I’m imagining two target audiences for this blog post: either you’re a Rustacean, and you’re here for the Tokio and Actix magic, or (and that’s not xor) you’re from the SailfishOS community and you’re wondering what all the Tokio and Actix buzzwords are even about. With that in mind, I’ll make an introduction on both topics, and depending on your background, you can skip either.
guiAlchemy is a Rust GUI Framework, backed by native widgets on each platform it supports, with an API that's a blend of those found in AppKit, UIKit, and React Native. It supports a JSX-ish syntax (RSX), styling with CSS, the safety of building in Rust, and a familiar API for many developers who build UI on a daily basis. The goal is to provide an API that feels at home in Rust, while striving to provide a visual appearance that's easy to scan and parse. It does not, and will never, require nightly. It's still early stages, but feedback and contributions are welcome.
guiOne of the primary reasons computers are so ubiquitous in modern society is their ability to let humans and software cooperate to achieve a desired goal. That is, to be interactive.
Creating interactive applications can be pretty annoying for a programmer. Unlike a computer which is predictable and will blindly follow any instructions given to it,
The ideas and concepts shown in this article aren’t overly advanced. In fact, if you’ve been programming for a couple months (especially if it’s part of a formal Computer Science program) you’re probably already familiar with them.
The difference between an “ordinary” programmer and a Software Engineer isn’t in how many advanced concepts they know, it’s the ability to identify a pattern, understand why it exists, and employ it to solve a problem. The experienced software engineer will do this in a way which won’t make them sad 6 months from now when they need to revisit the code because the boss has asked for a shiny new feature.
gui gtkTobias from our design team created an excellent Librem 5 app design tutorial, which covers GNOME design philosophy, going from sketches to mockups, convergence and even how to name your app. The three part series designs a Wallabag app for the Librem 5 called Read it Later. Wallabag is a link saving service with apps for various platforms, which now includes the Librem 5 thanks to Bilal Elmoussaoui. Bilal is a passionate community member who turned Tobias’s designs into a fully featured app. Purism community member Thibault spoke to Bilal about the development process and contributing to the larger ethical software movement.
guiWhen it comes to creating modern looking Desktop applications, JavaFX is a tried-and-tested weapon of choice. The rise of the Kotlin programming language as a Java replacement makes the proposition even more appealing as it comes with new powerful features while cutting down on verbosity. The good news is that it can be interfaced with a Rust WebAssembly library thanks to the Asmble tool. This tutorial is an example of how this can be done.
guiAs I’ve worked on my Pushrod library over the past year, one of the major struggles I encountered was trying to figure out how to draw using just the GPU, instead of drawing directly to the on-screen Canvas.
I originally started this project using Piston (thus, the engine analogies), and found that library to be overly complicated for what I wanted. Although it provided all of the features I wanted, it introduced a lot of overhead that was concerning. Not to mention, Piston is a more game-oriented library.
I ultimately settled on SDL2.
guiIn trying to figure out the best reactive structure for druid, as well as how to communicate that to the world, I’ve been studying a wide range of reactive UI systems. I’ve found an incredible diversity, even though they have fairly consistent goals. This post is an attempt to find common patterns, to characterize the design space as a whole. It will be rough, at some points almost a stream of consciousness. If I had the time and energy, I think it could be expanded into an academic paper. But, for now, perhaps these rough thoughts are interesting to some people working in the space.
gui gtkWhen talking to various people at conferences in the last year or at conferences, a recurring topic was that they believed that the GTK Rust bindings are not ready for use yet.
I don’t know where that perception comes from but if it was true, there wouldn’t have been applications like Fractal, Podcasts or Shortwave using GTK from Rust, or I wouldn’t be able to do a workshop about desktop application development in Rust with GTK and GStreamer at the Linux Application Summit in Barcelona this Friday (code can be found here already) or earlier this year at GUADEC.
ownership-and-borrowing guiImplications of Rust's borrow checking and memory ownership on GUI development (simple case)
guiI’m one of the maintainers of Winit, the main pure-Rust window creation library. Even if you haven’t used it directly, you’ve probably heard of projects that depend on it - Servo and Alacritty being the best-known applications that depend on our codebase. If you’ve done any graphics programming in Rust using Glutin (or dependent projects including gfx-rs, Glium, and Amethyst) we’ve been the ones making the windows actually show up on your desktop.
This announcement details the major changes since Winit 0.19. Also, we are looking for new contributors! If you are interested in working on the foundations of Rust’s GUI story, now is a great time to join the project.