SlideShare a Scribd company logo
Developing an application for
GNOME in Rust
Alessio Biancalana
Tokyo | November 3, 2024
わたしはだれでしょう?
Alessio Biancalana - dottorblaster
- Principal Software Engineer @ SUSE
- https://dottorblaster.it (Italian blog)
- alessio@dottorblaster.it (E-Mail)
- dottorblaster@fosstodon.org (Mastodon)
- https://github.com/dottorblaster (GitHub)
Alessio Biancalana - dottorblaster
Once upon a time: React
GTK is amazing… isn’t it?
Things you’ll hate about GTK
- It’s pretty old
- The API is very imperative
- Sometimes clogged
- Really un-intuitive when compared to something like React
- Usual UI elements are pretty basic in their capabilities
- Template files separated from actual code that orchestrates
business logic
Things you’ll love about GTK
- It’s everywhere
- A lot of platforms supported (eg: with some portability you
can run your app on a Mac or Windows)
- GNOME
- Elements available got really better with GTK4
- It can bind to every language, even Haskell (thanks @janvhs
lol)
gtk-rs comes into play
Things you’ll hate about Rust
- Other languages will give you a sense of productivity from
day 1. Rust doesn’t.
- You can’t outsmart the compiler
- You can’t outsmart the borrow checker
- You can’t outsmart clippy (the linter)
- At first learning to trust the tools can be very challenging
- At first learning to understand what the heck the compiler is
telling you can be tricky
Things you’ll love about Rust
- The type system
- Error handling and optional fields
- Refactoring code is a breeze
- Lots of tooling
- Very broad ecosystem of libraries
- Unit testing is just great (more on that later)
- If it compiles (there’s a broad chance) it actually works
Speedrun: libadwaita + relm4
Fixing the GTK ecosystem: libadwaita
- Standard elements
- Widely used in stock GNOME applications
- Native feeling
- Complex widgets ready to use
- Honestly beautiful to see
- Shared UX patterns shared across most apps, that we can reuse
Fixing the GTK ecosystem: Relm4
- Declarative UI
- Split and organize your code in separate components
- Everything is (potentially) reactive: just annotate it
- Centralized state management
- Message-passing based state updates
- Lots of examples
- A very nice template project
Time for some code
Relm4 advanced features
- Async function calls in command spawns
- Factories and vectors of factories
- Conditional widgets
Shortcomings
- Unit testing the view layer T_T
- Nothing similar to Jest, Jest-DOM and Jest-axe assertions
(for now…)
- Scattered documentation
- Lots of open opportunities :-)
- Undocumented patterns
- Even better scaffolding
- Dedicated tooling
ありがとうございます !

More Related Content

PPTX
Rust 101 (2017 edition)
PPTX
From NodeJS to Rust
PPTX
A Slice Of Rust - A quick look at the Rust programming language
PDF
High Performance Rust UI.pdf
PDF
The Rust Programming Language
PDF
Rust All Hands Winter 2011
PDF
Rust: Systems Programming for Everyone
PPTX
Ingesting in Rust by Armin Ronacher from Sentry
Rust 101 (2017 edition)
From NodeJS to Rust
A Slice Of Rust - A quick look at the Rust programming language
High Performance Rust UI.pdf
The Rust Programming Language
Rust All Hands Winter 2011
Rust: Systems Programming for Everyone
Ingesting in Rust by Armin Ronacher from Sentry

Similar to openSUSE Asia 2024: Developing an application for GNOME in Rust (20)

PDF
EZRust: Z80 for the Web
PPTX
Rust Melbourne MeetUp - Rust Web Development
PPTX
MozillaPH Rust Hack & Learn Session 1
PPTX
GOSIM 2024 - GenUI: Declarative Rust Cross-platform Framework Based on Makepad
PPTX
PDF
Rust: Reach Further (from QCon Sao Paolo 2018)
PPTX
I believe in rust
PDF
Rust packaging: Cross-distro collaboration done right
PDF
The Newest JavaScript Technologies in GNOME
PDF
Lisbon rust lang meetup#1
PDF
Rust Web Development With warp tokio and reqwest 1st Edition Bastian Gruber
PDF
Is it time to rewrite the operating system in Rust?
PPTX
Rusty Python
PDF
Rusted Ruby
PPTX
Rust programming-language
PDF
Rust and Eclipse
PDF
Web application stores in GNOME (GUADEC 2012)
PDF
Guadec 2012 lt - web application stores in gnome
PPTX
When node meets rust
PDF
Rust in Action Systems programming concepts and techniques 1st Edition Tim Mc...
EZRust: Z80 for the Web
Rust Melbourne MeetUp - Rust Web Development
MozillaPH Rust Hack & Learn Session 1
GOSIM 2024 - GenUI: Declarative Rust Cross-platform Framework Based on Makepad
Rust: Reach Further (from QCon Sao Paolo 2018)
I believe in rust
Rust packaging: Cross-distro collaboration done right
The Newest JavaScript Technologies in GNOME
Lisbon rust lang meetup#1
Rust Web Development With warp tokio and reqwest 1st Edition Bastian Gruber
Is it time to rewrite the operating system in Rust?
Rusty Python
Rusted Ruby
Rust programming-language
Rust and Eclipse
Web application stores in GNOME (GUADEC 2012)
Guadec 2012 lt - web application stores in gnome
When node meets rust
Rust in Action Systems programming concepts and techniques 1st Edition Tim Mc...
Ad

More from Alessio Biancalana (7)

PDF
Linux schedulers for fun and profit with SchedKit
PDF
Observability and compliance: Trento checks engine under the hood
PDF
Open source & mobile development - Be open, and sleep well
PDF
TweetYourMEP: how we did this
PDF
Open source approach for companies: 5 keywords and 1 tip
PDF
Linux: different desktop environments
ODP
Arch Linux: una distribuzione Linux semplice e leggera
Linux schedulers for fun and profit with SchedKit
Observability and compliance: Trento checks engine under the hood
Open source & mobile development - Be open, and sleep well
TweetYourMEP: how we did this
Open source approach for companies: 5 keywords and 1 tip
Linux: different desktop environments
Arch Linux: una distribuzione Linux semplice e leggera
Ad

Recently uploaded (20)

PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Cloud computing and distributed systems.
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPT
Teaching material agriculture food technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Approach and Philosophy of On baking technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
A comparative analysis of optical character recognition models for extracting...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Per capita expenditure prediction using model stacking based on satellite ima...
Spectroscopy.pptx food analysis technology
Building Integrated photovoltaic BIPV_UPV.pdf
Spectral efficient network and resource selection model in 5G networks
Dropbox Q2 2025 Financial Results & Investor Presentation
Cloud computing and distributed systems.
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Teaching material agriculture food technology
MIND Revenue Release Quarter 2 2025 Press Release
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Electronic commerce courselecture one. Pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
sap open course for s4hana steps from ECC to s4
Approach and Philosophy of On baking technology
“AI and Expert System Decision Support & Business Intelligence Systems”
The AUB Centre for AI in Media Proposal.docx
Reach Out and Touch Someone: Haptics and Empathic Computing
Profit Center Accounting in SAP S/4HANA, S4F28 Col11

openSUSE Asia 2024: Developing an application for GNOME in Rust

  • 1. Developing an application for GNOME in Rust Alessio Biancalana Tokyo | November 3, 2024
  • 2. わたしはだれでしょう? Alessio Biancalana - dottorblaster - Principal Software Engineer @ SUSE - https://dottorblaster.it (Italian blog) - alessio@dottorblaster.it (E-Mail) - dottorblaster@fosstodon.org (Mastodon) - https://github.com/dottorblaster (GitHub) Alessio Biancalana - dottorblaster
  • 3. Once upon a time: React
  • 4. GTK is amazing… isn’t it?
  • 5. Things you’ll hate about GTK - It’s pretty old - The API is very imperative - Sometimes clogged - Really un-intuitive when compared to something like React - Usual UI elements are pretty basic in their capabilities - Template files separated from actual code that orchestrates business logic
  • 6. Things you’ll love about GTK - It’s everywhere - A lot of platforms supported (eg: with some portability you can run your app on a Mac or Windows) - GNOME - Elements available got really better with GTK4 - It can bind to every language, even Haskell (thanks @janvhs lol)
  • 8. Things you’ll hate about Rust - Other languages will give you a sense of productivity from day 1. Rust doesn’t. - You can’t outsmart the compiler - You can’t outsmart the borrow checker - You can’t outsmart clippy (the linter) - At first learning to trust the tools can be very challenging - At first learning to understand what the heck the compiler is telling you can be tricky
  • 9. Things you’ll love about Rust - The type system - Error handling and optional fields - Refactoring code is a breeze - Lots of tooling - Very broad ecosystem of libraries - Unit testing is just great (more on that later) - If it compiles (there’s a broad chance) it actually works
  • 11. Fixing the GTK ecosystem: libadwaita - Standard elements - Widely used in stock GNOME applications - Native feeling - Complex widgets ready to use - Honestly beautiful to see - Shared UX patterns shared across most apps, that we can reuse
  • 12. Fixing the GTK ecosystem: Relm4 - Declarative UI - Split and organize your code in separate components - Everything is (potentially) reactive: just annotate it - Centralized state management - Message-passing based state updates - Lots of examples - A very nice template project
  • 14. Relm4 advanced features - Async function calls in command spawns - Factories and vectors of factories - Conditional widgets
  • 15. Shortcomings - Unit testing the view layer T_T - Nothing similar to Jest, Jest-DOM and Jest-axe assertions (for now…) - Scattered documentation - Lots of open opportunities :-) - Undocumented patterns - Even better scaffolding - Dedicated tooling