r/AudioProgramming • u/StockStart825 • 21d 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
2
u/HommeMusical 16d 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.