Nannou – An open-source creative-coding framework for Rust
nannou.cc
nannou.cc
[1] https://github.com/nannou-org/nannou/tree/master/nature_of_c...
https://github.com/chaosprint/glicol
A music live coding language and a DSP library written in Rust.
Perhaps you're comparing with languages outside of the domain like node or python? In that case it's actually not that far off in terms of usability.
Values semantics and only fixed size stack variables.
I guess there is a lot of copy happening under the hood (cf the source for Draw) but the result is a very straightforward syntax. I might give it a try instead of going back to P5.
As someone who’s generally pretty scatter-brained I really love the strictness of Rust.
You didn't mention this in your list of good features. I think these are the main hurdles preventing full on popularity.
It's arguably not a "hurdle" per say but it is preventing popularity imo.
Personally I find the borrow checker to be a useful guardrail as I would certainly write code with all kinds of memory related bugs without it.
It increases safety at the expense of modularity and expressivity by a huge amount. The trap door to get around it, is to implement the copy trait, but the point of rust is to minimize this action as much as possible for speed.
Why people keep asking that? Rust is a very good language even if you don't care about safety at all and barely care about the speed. Value semantics gives you completely unique capabilities when working with complex objects. It fits all applications.
draw.ellipse() .color(STEELBLUE) .w(300.0) .h(200.0) .x_y(200.0, -100.0);
This seems promising! The creative coding folks I know mostly use WebGL which is obviously a way, way less user friendly syntax, though the tooling itself is much simpler and available. I’ll also note that the majority of the “best” creative coders I’ve met (biggest online following, largest shows) were not SWEs and generally didn’t code much outside of their preferred creative environment.
All that to say that the other commenters are right, and that what is trivial to us (build and run a rust project) is a multi day affair for the technical non-programmer.
I wonder if the author would consider shipping a desktop app with a preview window, simple text editor, and play button. All the pieces are obviously there, it’s just be a bit of a pain in the ass supporting three platforms and certainly less fun that working on the library itself :)
Cannot resist plugging a Nim wrapper for p5js (although it’s a bit early stage), in case other are interested in doing p5/processing stuff in a niche but fun (and easy to pick up) language: https://github.com/pietroppeter/p5nim
Nannou – A Creative Coding Framework for Rust - https://news.ycombinator.com/item?id=25343356 - Dec 2020 (25 comments)
Nannou: Creative Coding Toolkit for Rust - https://news.ycombinator.com/item?id=20147764 - June 2019 (30 comments)
It's worth taking a look at OPENRNDR, which is a framework based on Kotlin. Personally, I think it achieves a good balance between performance and accessibility.
OPENRNDR: https://openrndr.org/
Rust can run fast and thus is attractive for this kind of thing.
The networks you get are huge. And understanding them, after a month e.g., becomes tedious at best.
The creation may seem more artist friendly but understanding/modifying are very much less so when a certain complexity threshold is reached.
Code is simply easier to read when you reach that aforementioned threshold.
Writing code is also a different experience than using a node-based editor but that's more philosophical than pertaining to what is better when.
My experience is mostly with Houdini in VFX.
Whenever I have to touch a complex node graph, my own after a while, or someone else's -- the more nodes just containing plain VEX or Python code are in there, the easier it is usually to understand (vs someone making a sub network with another 30 nodes for what could be expressed with 10 lines of VEX).
Possibly it would work best in a functional language like haskell or elixir.
Sadly OpenFrameworks development seems kind of stalled. Nannou + Rust could be a good or even better alternative:
1) painless cross-compilation to different platforms
2) plugins installation via cargo
3) more up-to-date plugins as tiny wrappers around CPAL [1] (audio I/O), nokhwa [2] (video i/o), opencv-rust[3] (video I/O and processing), rust-sdl2 [4](IMU sensors + game controllers), egui [5] (immediate mode gui + plotting)
4) better errors and more modern language
[0] https://openframeworks.cc/ [1] https://github.com/RustAudio/cpal/ [2] https://github.com/l1npengtul/nokhwa [3] https://github.com/twistedfall/opencv-rust [4] https://github.com/Rust-SDL2/rust-sdl2 [5] https://github.com/emilk/egui
Also those "plugins" are kind of limited to compile time, not really what plugin infrastructure is about. Nothing that can be dynamically loaded into an existing installation.
At very least I would expect something like DAWs or COM make available.
Also, the bureaucracy.
Better use a language with surprises, like C++.
Having reasonable compilation errors is tempting.
There could be some complicate cases of trait bounds using some 3rd party libraries. However one will hardly encounter that while playing with Nannou.
Having rust-analyzer is also huge plus.
for example https://github.com/nannou-org/nannou/blob/master/examples/dr... gives this funky rainbow sine wave (which seems to change as the user moves the mouse): https://camo.githubusercontent.com/edb74faf7b0d79c9e1918335e...
this seems to focus on iterative visuals (basically it's a rendering loop), there are a few music oriented frameworks too
This seems like a requirement you personally came up with that does not mesh with reality. Throughout history the greatest creative achievement have been made using absurdly difficult to use non-interactive mediums.
Also Rust compile times are not as slow as you imagine them to be.
No, it's actually pretty obvious, if you actually take a moment to think about it. Creativity is about making things in reality, which necessitates the construction of new things, which means that you either need to keep design details entirely in your head while you work (which is infeasible for many things and challenging for most things) or you need to work with a medium (paint, clay, code) as you create, which means that the medium (and tool) need to be interactive.
> Throughout history the greatest creative achievement have been made using absurdly difficult to use non-interactive mediums.
This is completely absurd. Most, if not all, of the classical arts have used highly interactive media. Painting? Interactive medium. Sculping? Interactive. Mechanical devices, like the steam engine and the plane? Interactive. In almost every single creative field, you get the opportunity to work with things incrementally.
Unfortunately, for historical reasons (namely their C lineage), most languages are non-interactive batch-processed monstrosities which inhibit creativity, and Rust is no exception.
> Also Rust compile times are not as slow as you imagine them to be.
I've used Rust, and the compile times are exactly what I remember them to be - tens of minutes for large programs, and tens of seconds for incremental compiles, which is tens of seconds too long.
Also, while cold compile times can be very slow of you have a lot of dependencies with macros etc, incremental compile time is often very fast. Rust has one of the most advanced incremental compilers out there. So for experimenting, tweaking and updating code, that's not going to have a long cycle.
> incremental compile time is often very fast
I tried Rust a few years ago and got incremental compile times in the tens of seconds for medium-sized projects, which is excruciatingly slow. Unless compile times are sub-second, it's not fast enough, unless the REPL is somehow faster.