The state of realtime graphics in Rust (February 2025 edition)
It is no surprise (see Choosing ot work with Common Lisp in 2023) that I've been trying to build my perfect creative coding framework for a while.
Something that:
- Feels like live coding in Extempore
- Is as flexible as OpenFrameworks (but with less duct-tape around it)
- Looks as elegant as https://github.com/inconvergent/weird
- Is crossplatform, or at least supports on Linux and macOS
Ideally, it might even have support for working in scene linear, like Nannou.
I'm currently at my 3rd iteration of this adventure. It's a pet project: I might work on it a few hours every several months, or a few intense days in a row; I don't care if it never sees the light of the day, at this stage I just work on it to fulfill an internal need.
I always wanted it to be written in Rust, and to be hackable via a higher level scripting language (first a declarative one, then Python via PyO3, and for v3 I'm exploring a small Scheme-like interpreter).
In those ~3 years that I embarked in this part-time adventure, I completely lost trust in wgpu (the crate) getting somewhat stable anytime soon, so now I'm rewriting the graphics backend to move away from the need to constantly play catch-up with wgpu
.
In this post I just try to piece together the puzzle of "how the realtime graphics Rust ecosystem looks like today", to understand where it makes sense to bet.
Premise
If only Rust sucked more and didn't provide such great tooling and developer experience, I would have already left this boat a long time ago. But after using Rust at my $dayjob for CLIs and backend work, I don't have any regrets: I'm very productive and doing bugfixing and refactoring is fun. I just wish for a year where the pace of "innovation" in the graphics arena just slows down a bit and we can start drawing our beautiful triangles on screen without the constant trauma of breaking changes in the underlying plumbing.
wgpu
- Last commit was 8 hours ago: https://github.com/gfx-rs/wgpu/commits/trunk.
- Last release was on Jan 22, 2025: https://github.com/gfx-rs/wgpu/releases/tag/v24.0.1
Still in its "moving fast and breaking things" phase, their first "v1" was v22, 7 months ago. See their post on Reddit: https://www.reddit.com/r/rust/comments/1e6j8sk/wgpu_22_released_our_first_major_release.
There's a good tutorial on the learn-wgpu website, but even there the author is struggling to keep up with the changes in winit
and friends, according to what they wrote in https://sotrh.github.io/learn-wgpu/beginner/tutorial1-window/#what-crates-are-we-using :
Note that we are using version 0.29 of winit. This is not the most recent version. The reason for this is version 0.30 and beyond include breaking changes that will require a lot of code changes. I've created a local branch to mess around with it, but there's a work around on the tracking issue (opens new window) if you absolutely need the latest version of winit.
ggez
- Last commit was on July 10, 2023: https://github.com/ggez/ggez/commits/master
- Last release was on July 10, 2023: https://github.com/ggez/ggez/releases/tag/0.9.3
Seems no longer "actively" maintained, but it's still one the most flexible framework that I worked with. It's inspired by LÖVE, a cute 2d framework written in Lua.
They're still using wgpu v0.16, which is now very old.. I can't even imagine how painful it would be to move back to v24 (source: https://github.com/ggez/ggez/blob/74ed4c7688cdd03a84c5c98f9c8650ec3947cf07/Cargo.toml#L39)
macroquad
- Last commit was on Feb 18, 2025: https://github.com/not-fl3/macroquad/commits/master
- Last post^ from the original maintainer: https://www.patreon.com/posts/on-buses-and-101117631
I guess it's somewhat maintained, but CBB. It depends on https://github.com/not-fl3/miniquad instead of wgpu, which for me has become a selling point. It has some soundness issues, if you care about that stuff: https://github.com/not-fl3/macroquad/issues/333
nannou
- Last commit was on Jan 16, 2024: https://github.com/nannou-org/nannou/commits/master
Lovely as a user end tool, but limiting if you're trying to use it a building block (e.g.: because of things like https://github.com/nannou-org/nannou/issues/793). I guess it's community maintened, these days?
They're building on top of wgpu v0.17.1, as far as I can see: https://github.com/nannou-org/nannou/blob/c8ac92d6c59b6dbd78bb903207a9c20013f7b7d1/nannou_wgpu/Cargo.toml#L17, so I also imagine that it's gonna "fun" porting their changes back to work with v24.
comfy
- Last commit was on Sep 8, 2024: https://github.com/darthdeus/comfy/commits/master
Currently archived, this is the engine behind the famous Leaving Rust gamedev after 3 years blog post.
flo_draw
- Last commit was on May 27, 2024: https://github.com/Logicalshift/flo_draw/commits/v0.4
I never used it, so I have no idea how well it works.
They're building of wgpu v0.18, as far as I can see: https://github.com/Logicalshift/flo_draw/blob/9f36d00f0232f2d72ff70a977f56c8217062ad3e/Cargo.toml#L13, but I believe it has also an OpenGL backend.
Extras
lyon
- Last commit was on Jan 16, 2025: https://github.com/nical/lyon/commits/main
- Last release was on Jul 12, 2022: https://github.com/nical/lyon/releases/tag/1.0.0
It's a great library for tessellation. I've used it in my previous attempts and it was easy to pick up.
Related articles
- Choosing an Engine, by Slow Rust Studios: https://www.slowrush.dev/news/engine-deliberations
- Polaris64 (a fellow Emacs user) blog post: https://blog.polaris64.net/post/verlet-physics-playground