Nannou – A Creative Coding Framework for Rust
nannou.cc
nannou.cc
1. The initial setup and build time is perhaps a little long or complex for use in classrooms/workshops but it's fine for personal/professional use.
2. Rust's build time might not feel like a natural fit for creative coding. Even though initial build times are long (~3 minutes on an 8-core 2019 MBP), rebuilds are fast enough to create a short feedback loop. It's not as fluid as dynamic languages like Clojure/JavaScript, but it's good enough.
3. It's a nice way to learn Rust.
4. MacTuiTui is worth following for their Nannou sketches: https://www.instagram.com/mactuitui/
I recently wrote myself a software renderer in rust to learn the ropes and had a pretty big initial hill to climb.
Edit: Read through their doc, it seems the benefits over Processing is performance, and Nannou targets realtime audio/video which is where Processing performance can start to be too sluggish. And OpenFrameworks being C++ means less reliable to live performance piece, where you wouldn't want a segfault or memory race to show up, as well as just Rust can be said to be a nicer language, if you prefer its style.
I do recall Clojure/Quil being faster than Rust/Nannou in terms of the feedback loop, because once you’re running a REPL and you start to change and tweak things you can re-evaluate them live in the context of the running sketch.
Neither offers as fast a feedback loop as JS/P5.js, though, and for me Quokka gives much of the benefit of Clojure’s REPL but with less setup, faster boot, and consistency between editors.
As for the direct points (note that I am _not_ part of nannou's team, just one _heavy_ user):
1. That's sadly true, it's been a long time issue (not only nannou's problem to be fair, it's shared by all rust projects at the moment): https://github.com/nannou-org/nannou/issues/178
2. If you were following my talk at GitHub universe yesterday where I was livecoding (archive will be up "soon"), the rebuilds are fast enough I don't really care (simple stuff are <3s for me, even my latest dailies where I have heaps of extra stuff are averaging <6s rebuild time). The compiler (via lsp) catches most bugs beforehand, so I would say it is not very much an issue at this point. Using a cargo cache will make things far easier as well.
3. Exactly why I started using nannou (coming from using processing via scala)!
As for the "why nannou?", and sorry for being nerdy, but nannou is the only framework I know of that does color right: you are working "naturally" in LinSrgb with float16 precision per channel (if that does not speak to you, just look for gamma correction and go down the rabbit hole). The blending of color is exceptional if you're into that sort of things (I am: see for example in HQ https://superrare.co/artwork-v2/road-to-nowhere-12621 )
Nannou is also focused towards the future: there's been a couple of major backend rewrites from opengl to vulkan then webgpu (without any issues for the end-user if you were using the core nannou api functions): you get to play with the latest toys and finally you get access to your whole GPU. No need to stay in a OpenGL-centric state based workflow (that does not make any sense since years)! I've been able to run crazy compute shaders passes while making my own render pipelines _on top of what nannou does_. It's crazy powerful. Also I have to say the team behind nannou has been wonderful in dealing with my requests over the last two years, and they always provided help when I needed (to be honest, I chose nannou because the team was in Australia, and as I am in Japan, it made communication easy). Huge thanks to them. Have a look at the github issues to see how nice the team is.
And with cargo, I'm confident (not very confident, mind you, but optimistically confident) that I'll be able to get the thing building again in a few years.
So if your interest peaked a bit, please try it, if you have any questions, join the matrix chat and ask away!
I can live with the short rebuild times for the performance of Rust. Does Rust have a watch command to auto-rebuild sketches when files are changed? Last time I used Nannou it did not.
I look forward to checking out your GitHub Universe talk when the video’s live. (Guessing it’s this one? https://githubuniverse.com/Nannou-creative-coding-with-Rust/ )
$ cargo install cargo-watch
$ cargo watch
Not built in but accessible :) there’s a bunch of flags too.Still, do you have any idea on what the progress is in that department?
Does the Rust ecosystem provide specific alternatives for individual set-ups? For example, in my case I only care about video capture for Linux. I see that there is a v4l crate out there, as well as something for ffmpeg[1][2]. Is that easy to combine with Nannou? I have zero experience with Rust but if this is not too much hassle I might give it a shot.
[0] https://guide.nannou.cc/why_nannou.html#goals
[1] https://marketplace.visualstudio.com/items?itemName=filipesa...
There are some experiments with hot-reloading workflows in Rust:
https://fasterthanli.me/articles/so-you-want-to-live-reload-...
https://github.com/irh/rust-hot-reloading
https://github.com/porglezomp-misc/live-reloading-rs
It would be interesting to get this working with Nannou.
https://www.youtube.com/watch?v=A-Pkx37kYf4
Video sfw. Comments likely less so.
There are also application-based books (rather than "concept-based"), like Rust Programming by Example, and the upcoming Hands-on Rust. Also, a notable app-based tutorial is "Build your own JIRA with Rust" (I didn't try it, though).
I was also looking at using NAP [1] for creative coding. At the moment, I am playing with Raylib [2], a C game engine, but with lots of libraries to make some graphics with music. You can use any C library for audio creative coding.