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:

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

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

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

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

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

Currently archived, this is the engine behind the famous Leaving Rust gamedev after 3 years blog post.

flo_draw

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

It's a great library for tessellation. I've used it in my previous attempts and it was easy to pick up.

Related articles