RFC: Rewrite it in Rust
I am working on an upgrade of the application to Gtk4 and here are some conclusions I've made.
- Gtk4 deprecates
gtk_dialog_run
and other blocking APIs in a favor of asynchronous approach. - Gnome Commander being a "classic" application from older times has a lot of dialogs.
- Dialogs are used in various complicated flows (nested dialogs, dialogs opened by a long-running processes, dialogs opened from loops, etc.).
- Rewriting the code in an asynchronous style will probably require to change each and every function to a some sort of a state machine or CPS or something else. This will probably be a very long process with new memory bugs being introduced.
- On the other hand, more modern languages have a better way to address this kind of issues --
async/await
syntax. - Vala and Rust are widely adopted languages by a Gnome community and both have this syntax.
- My bet is on Rust (vs Vala). It is not just a "Gnome-language" like Vala, and may attract more contributors. It has a stronger story about memory management and multi-threading (Gnome Commander needs this for safe background operations).
I've made a quick test how it could be done gradually: !99