EMCT: COMPUTING MAJOR PROJECT

Part 4: Abandoning Rust for C++

Rusty
3 min readAug 4, 2023

Leaving Rust behind for my audio processing project and instead opting to use C++.

Initially embracing the exciting challange of creating audio tools from scratch led me to try Rust, an uncoventional choice but one I thought could open up doors for me. It was a voyage of curisioty and discovery. However, it quickly became clear to me Rust and I were never meant to be. At least not for this project. Despite it’s many advantages I couldn’t help running into endless resources in my familiar friend C++.

The world of audio effects is a complex and one that lacks the resources compared to other creative programming disciplines, like gaming or digital art. I’ve realised that my project is more focussed on quantifying the underlying principles of audio effects and exemplifiying these underlying features as well as understanding industry stadard practices and how they’re implemented. I’ve realised Rust isn’t actually a part of that story.

It’s no doubt I was intrigued by Rust when starting this project. Its safety guarantees and powerful in built features made it an appealing option. I figured using it would force to me to improve my programming skills and a nickname of mine in school was “Rust” or “Rusty”, giving a little bit of a comedic element to my decision to learn the language. I had seen Rust hailed as the ‘future of systems programming’. I thought: “Could this new and powerful language help me with this project?”.

Rust offers several compelling features for systems programming, like memeory management without garbage cllection , zero-cost abstraction and an intricate type system. I thought these could translate well to the intricasies of build a highly-efficient audio plugins.

However, as my journey with Rust continues I found myself struggling with the scarcity of resources for learning and implemeneting audio processing in Rust. Unlike C++ which has decades of accumulated knowledge, tutorials and vast already established community of developers in the audio processing field. Rust lacked that, at least within the audio space.

Additionally, Rust, while innovative and unique, created a steeper learning curve when compared to the more familiar C++. The hours spent learning new syntax and ideas seemed to grow exponentially. An issue that should have been a quick fix could stump me for days simply because of a misunderstanding of the type system for example. This was all time that could have been spent further undertsanding audio programming, not rust.

This eventually led to the epiphamy, Rust was not worth it. Not for this project. My difficulty with the language combined with the lack of libraries for audio DSP as well as constantly broken packages, led to my re-evaluation of my systems language choice.

So, I returned to the path of C++. Its established libraries, endless resources, C compatibility, wealth of community knowledge and my own comfort with the language, led me back to the realm of the familiar. I realised sometimes, sticking to the traditional path isn’t a retreat but a strategic decision.

Looking forward I plan to leverage my strong understanding of C++ to explore the world of audio development at large. I’m keen to delve into DSP algorithms, develop an understanding of run-time structure as well as auduo data management. My foray in Rust was not in vain however, it has provided me with a solidiefied understanding of what my project required. Sometimes, it takes a detour to realise where you’re supposed to be and sometimes an initial idea is not one you have to stick with. Rust has been a learning experience and one I believe has strengthened my system programming skills. And with that, my the project continues, now in a more familiar langauge poised for audio programming.

Written: Apr 23, 2023

--

--

Rusty

Audio, Coding, Technology and Music --- Educational blog posts on a variety of creative computing works.