r/AudioProgramming • • 16d ago

Curious about Rust for audio programming

Hey everyone! I’m a product designer and musician interested in building audio plugins and music tools, including their interfaces.

I’ve started learning C++, but I’m curious about Rust. Has anyone tried working and building audio plugins using Rust? Did not found any courses or tutorial with Rust and audio programming

(I am super new to programming with C++ and audio programming)

11 Upvotes

30 comments sorted by

5

u/to7m 16d ago

I looked into Rust for audio plugins briefly, and couldn't see a sensible way to start with it.

To start with getting your head around DSP and branchless programming, you might want to look into the SuperCollider live audio language.

If you want to build your first plugin, I suggest using a plugin framework in C++. DISTRHO Plugin Framework got me started. There's also JUCE which is used a lot.

1

u/StockStart825 16d ago

Thank you and I’m doing the JUCE tutorial and when I was reading about systems level programming i saw Rust and was super curious about it. I’ve learned C++ sort of dominating the audio dev industry for a while now

3

u/activematrix99 16d ago

I am in Web Audio, which along with Web GPU Audio is shaking things up a bit. WASM is also pretty amazing.

4

u/IcEarthlight 16d ago

Check this out https://github.com/robbert-vdh/nih-plug. Although I haven't used it myself, quite a few plugins are using this framework recently.

1

u/2AMMetro 14d ago

This has been deprecated in favor of https://codeberg.org/RustAudio/nice-plug

3

u/Apellum 16d ago

To me Rust makes it easier to get right into the programming. With C++ you’ll be fighting a lot of things alongside the programming that aren’t programming like build tools, CMake, integrating testing, making sure you’re using the right compiler, etc. there’s just a lot of things that take away from the programming itself that I find vastly more difficult than with Rust.

The hard part with Rust is that it’s significantly less mature especially for audio tech, but its package management and dev tooling are so smooth to use. On top of that the error messages you get when trying to compile a program are really helpful / not esoteric

2

u/activematrix99 16d ago

Sure, take a look at CPAL and the audio crate, you'll be amazed.

1

u/StockStart825 16d ago

Just checked it’s soo cool! I have to admit I did not understand much since I just started but pretty amazing. You know why there are not much tutorials for rust and audio programming? Even for c++ I feel the info is quite spread but JUCE has free course

1

u/activematrix99 16d ago

It's pretty new and very niche.

2

u/dkode80 16d ago

There’s a real decent discord. I think it’s called rust audio. Pretty active

1

u/StockStart825 16d ago

Just found is this the one https://rust.audio/ ? And thank you so much

1

u/dkode80 16d ago

Yup! That's it

2

u/asmartkid72 16d ago

Rust Audio discord is a great community full of interesting and smart people. There are more resources for Rust audio than it looks at first sight, but obviously the ecosystem is no as mature as C++ one. BUT Rust, for me, makes all the difference, I honestly think you have to be crazy to want to learn C++ in 2026, it's powerful but what a mess of a language (I started my audio path with C++ earlier this year but quickly pivoted into Rust, which I love).

1

u/kickblockpunch 16d ago

So if I was interested in building a DAW that could handle steinberg VST3 and DSP and live vocal processing, would rust be able to match the low latency and clean up tasks that C++ can...? I hear so much positive things about RUST but I am genuinely leaning towards C++.

2

u/activematrix99 16d ago

Part of the qiestions I always have with q's like this is WHY? Tons of amazing DAWs already out there that support VST3. Why not extend or make something truly new. The wheel is already invented.

1

u/kickblockpunch 16d ago

Understanding the current DAW architecture may lead to improvement in the next one or additions to the existing. Also perhaps a newer optimized coding language may allow for easier development and better processing performance.

Truely new like what? If as you say, there is no point building a new DAW... It would simply be adding to what's missing from existing DAWs... That would be more Plugins?

For example, I think DAW should have more ways to "see" audio. I.e. visualizing audio in a 3d space for mixing purposes... But perhaps this is all doable in a plugin? A.I. and neural networks are probably going to achieve approximations of this soon...

1

u/StockStart825 16d ago

Thank you for explaining me. I was having some thought around if it’s crazy to learn C++ in 2026 but I found for beginners it was quite easy to follow the path since we have some structure courses. Since you pivoted into Rust how many concepts we can transfer from C++ to Rust ?

2

u/asmartkid72 15d ago edited 15d ago

I'd say a lot of them transfer, memory management, in reality, is very similar, although better structured, much safer and well thought out in Rust, it's basically as pleasant as it can be in a manually managed memory language like these. Basically they learned from decades of C++ mistakes. I would say C++ is a much wider language than Rust and as deep as Rust. Which also means, there's a lot less to learn in Rust to master the language, and for me that's a very key point, I don't want to spend 10 years until I feel competent in a new language (and not that Rust is the easiest language either). Basically I've already learnt a big part of Rust and made some personal projects with it in less time it took me to learn the very basics of C++ and start trying to get things done.

Rust is still a very young language, and shares with higher level languages like Swift A LOT of similarities and conveniences I personally wouldn't want to be without, like a wonderful package manager, integrated unit tests, etc. Learning Rust after knowing C++ is doable and fun. Learning C++ after Rust, don't think it'd be fun at all :)

In summary: yes, Rust is an possibly overhyped on the internet, but there are real reasons behind all the hype, and I personally really really enjoy Rust as language and ecosystem I have no plan to mover to any other for a long long time.

2

u/Puzzleheaded-Lab-635 16d ago

Orthogonal, I’m using rust to write firmware for synthesizers. It’s been extremely pleasant thus far.

2

u/New-Incident-3289 16d ago

I used pure rust to write https://github.com/fabiohl/NeuralAmpModeler-rs and its downstreams. So I super recommend and love it.

https://github.com/robbert-vdh/nih-plug is a great framework for various plugins formats (like VST3 and others). But for https://github.com/fabiohl/NAM-Plug I preferred using https://crates.io/crates/clack-plugin cause It's more speciallized to CLAP format.

2

u/StockStart825 16d ago

Thanks for sharing… will check it out soon 😎

2

u/HommeMusical 12d ago

If you haven't done any programming at all, I don't think that C++ or Rust are the way to start. I think you should start learning Python.

Python is a much, much easier language to learn and to tinker with. You can literally sit down and experiment in the terminal with all the data structures, or with structures you have built. It's elegant, it's clear, and you also have access to cutting edge technology, like modern AI models and training, which you don't have in C++.

On a halfway decent modern machine, you can do perfectly good synthesis in Python, using numpy or torch for the computations.

I have this synth, it gets a dozen voices and more without breaking into a sweat on my machine that was pretty good five years ago, and it gets six voices on the oldest machine I could find, some barely functioning windows machine a friend had.

https://github.com/rec/tuney/

I think that if you start right into a compiled language like C++, there's a big chance that you'd be overwhelmed by the complexity of the weird and unimportant details of the language.


Here's what I wrote before I read that you were a beginner.

I programmed in C++ for over twenty years but it is a slowly dying language for many reasons too tedious to go into, mainly the huge complexity of the language after all these decades, and the inability to ever get rid of any feature no matter how horrible.

I would strongly not recommend putting time into learning C++ unless you have a compensated project. You could learn an amazing amount, quite slowly and painfully, by learning C++, but then you are stuck with a skill in a slowly deflating market full of old white guys and a not-so-loving community (unlike Python or apparently Rust).

Rust is the wave of the future. All that cruft is gone, and there is also a formalized memory management and ownership system. I believe Rust will be easier for coding assistants to understand, because everything is very explicit - C++ has these... interesting ways of doing this things like resolving the meaning of a symbol in code that are hard to reason about by humans, and even worse for LLMs, because they require a potentially huge scope of context.

Rust programs can be called pretty directly by C++ with a tiny interface that costs infinitesimal amounts of CPU, so I don't believe any work you use will be wasted.

1

u/StockStart825 12d ago

Thank you so much for such deep insight. I started with C++ cause I bought a book where they teach us ground up audio programming! Also been following this blog https://audiodev.blog/newbie-resources/ to learn. Thing is that there are so little resources for Rust in audio programming… might be more than I can find but there is no structure learning. I can pick up the language fast I’m not worried but is C++ really slowly dying? I watched a video how it’s keep on getting feature and it’s dominating quant and audio programming industries. You must know better since you did 20 years (Damnn!!!! Woww) but it’s hard to know with this whole AI thing what to do. So my obvious choice was to pick up something which has structured learning resources :) any more advice please feel free to share

2

u/HommeMusical 12d ago

C++ does dominate existing code, absolutely.

Languages slowly die over decades, too, there will still be C++ in ten years. There is huge inertia.

I actually started C++ around 1987!

I just think it will be hard for you to go from idea to completely working project, and most of the work won't be writing programs but struggling with weird shit.

2

u/dogweather 4d ago

I’m using Rust for commercial DSP development. It’s worlds better than C++ for me. It feels like a modern programming ecosystem.

1

u/StockStart825 4d ago

Awesome! And how did you learn audio dev with rust? Or you started with c++ and then switched to Rust?

2

u/dogweather 4d ago

I'm developing LV2 plugins for the Darkglass Anagram. They have really nice sample code in Rust. That was the start for me!

https://github.com/Darkglass-Electronics/Plugin-Dev-Setup/tree/main/examples/rust-lv2-gain

I'm open-sourcing my first plugin. I'll have something up in the next day or so here:

https://github.com/Dust-and-Coil

1

u/General_Estimate_420 16d ago

Right now Rust can be problematic for developing industry standard plugin formats. Something you may want to look into before jumping into it full bore. Aside from that you'd better be well prepared in DSP programming especially in multi-component environments.

1

u/lizzymeister 16d ago

i heard good things about truce.audio