top of page

Engineering @ Synergy: Why Rust? Exploring a Potential Shift in Synergy DSP's Tech Stack

Writer: Leon M.Leon M.

Updated: Jan 6, 2024

Who Am I? A Personal Introduction

Hello, I'm the CEO and a driving force behind Synergy DSP, and my path to this point has been anything but conventional. As a disabled PhD student with a deep-rooted passion for technology and music, my journey intertwines diverse experiences and challenges.

I began coding in high school but took a hiatus to pursue a career in music — a decision that led me to become a music producer for Sony Music ATV and several Sony Orchard labels. This turn of my career, especially when the label I was signed with was taken over by Orchard in 2017, was an unexpected twist of fate. Alongside my music career, I dabbled in freelance web development, which kept me connected to the tech world.



The onset of COVID-19 marked a pivotal shift in my career. I leveraged my freelance experience to secure a senior software engineering position in 2021 and also contributed as a core OS developer at WordPress. These roles deepened my understanding and skills in software development, further fueling my passion for tech.


In the midst of my postgraduate year, just before embarking on my PhD, I founded Synergy DSP with three close friends from my undergraduate days. This venture was the culmination of our shared vision and enthusiasm for pushing the boundaries in DSP and AI.

On a more personal note, I'm a big fan of Neovim and Kinesis keyboards — my productivity tools of choice, thanks Prime (my favourite youtuber) for highlighting vim and kinesis. My love for Linux has been a constant in my tech journey, shaping my perspectives on software development and system design.


My eclectic background — from coding to music production, and from web development to leading tech roles — has instilled in me a unique blend of creativity and technical acumen. This fusion of experiences is at the heart of my leadership at Synergy DSP, where I aim to blend innovation with practicality, and ambition with inclusivity.

As we explore the transition to Rust, I bring this diverse perspective, aiming to create a framework and a company culture that is not only technologically advanced but also empathetic and inclusive, reflecting the varied paths and challenges we all face in our journeys.

Introduction: Setting the Context for Technological Evolution at Synergy DSP

As the CEO and a staff engineer at Synergy DSP, I have a profound appreciation for our current technology stack. It's a testament to our dedication to quality and performance, primarily revolving around JUCE and C++ in production, complemented by Max for Live (M4L) and Python. These technologies have been the backbone of our product development, enabling us to create high-quality digital signal processing (DSP) tools and AI applications.


I hold a deep respect for JUCE Team; they have been instrumental in our journey so far. My experience with these tools has been largely positive, given their power, flexibility, and the vast possibilities they offer. However, as someone who has closely worked with these technologies, I've also encountered a number of design decisions in JUCE and the inherent complexities of C++ that can be challenging, especially in the context of safety and modern coding practices.


In the dynamic world of technology, adaptation is not just a choice but a necessity for staying ahead. While C++ has been a cornerstone in our development, its complexities and safety challenges are areas where we seek improvement. The industry is evolving towards more secure and efficient coding practices, and as the leader of a startup driven by innovation, I inherently want to steer our company in a direction that not only embraces change but also sets new benchmarks in technology development.


This brings us to Rust, a language that has caught my attention and admiration. Rust stands out for its safety, performance efficiency, and modern approach to systems programming. Its growing reputation for combining safety with high performance makes it an ideal candidate for our next big leap. We're now considering the development of an in-house framework using Rust. This move aims to harness the strengths of Rust to elevate our products and solutions, pushing the boundaries of what we can achieve in DSP and AI.

Our exploration into Rust is not just about a change in our technology stack; it's a reflection of our commitment to innovation, safety, and excellence. Rust offers so much in terms of capabilities and aligns perfectly with our vision for the future of Synergy DSP. Join us as we delve into why Rust could be the key to unlocking a new era of innovation at our company.

Why Rust? Delving into the Reasons Behind Synergy DSP's Consideration

At Synergy DSP, our commitment to innovation is not just about adopting new technologies; it's about embracing solutions that significantly enhance our capabilities and product quality. This philosophy leads us to consider Rust for our future projects. There are several compelling reasons why Rust is gaining our attention:

1. Unparalleled Memory Safety

One of Rust's most lauded features is its memory safety. Unlike C++, Rust enforces strict memory management rules at compile time, virtually eliminating common bugs such as null pointer dereferences, buffer overflows, and memory leaks. This safety is critical in DSP and AI applications where a single memory error can not only cause system crashes but also lead to incorrect processing of audio signals or data.


 I cannot count the number of obscure bugs that led to segmentation faults I've encountered. These experiences, often involving lengthy debugging sessions, highlight the importance of a language that can preemptively mitigate such issues. In C++, while we have the flexibility and control over memory, it comes with the responsibility to manage it correctly, which is not a trivial task and can lead to elusive and critical bugs.


Rust’s approach to memory management significantly reduces these risks. By catching potential errors at compile time, it offers a more robust development process, particularly in the areas of DSP and AI where reliability and accuracy are paramount. The peace of mind that comes from knowing that a whole class of bugs is off the table is invaluable. It allows engineers to focus more on the core functionality and innovation in their projects, rather than being bogged down by complex memory management issues.


This shift in memory management paradigm is one of the key reasons why Rust is an appealing choice for the future of Synergy DSP. It's not just about adopting a new programming language; it's about embracing a tool that enhances our ability to produce reliable, high-quality software while minimizing the potential for critical errors that have been all too familiar in our past development experiences.

2. Performance Efficiency

Performance is paramount in DSP and AI. Rust offers performance comparable to C++, which is crucial for real-time audio processing and large-scale AI computations. Its efficient handling of memory and resources means that we can achieve high performance without compromising on safety, a balance we've been striving for.


This code snippet demonstrates an optimized audio filtering process, a common operation in DSP. Rust's performance characteristics ensure that such operations are fast and efficient, crucial for real-time audio processing.

3. Modern Tooling and Language Features

Rust brings modern programming language features and tooling that can streamline our development process. Features like pattern matching, option and result types, and powerful concurrency primitives make Rust code more robust and easier to maintain. Additionally, Rust's package manager, Cargo, and its build system simplify managing dependencies and building projects, which can enhance our development workflow.

4. Concurrency Without Fear

Concurrency is a necessity in modern DSP and AI applications. Rust’s approach to concurrency is both safe and efficient, ensuring that data races and other concurrency issues are caught at compile time. This aspect allows us to develop more reliable multi-threaded applications, which is crucial for handling complex audio processing and AI algorithms.

5. Growing Ecosystem and Community

The Rust ecosystem is rapidly growing, with a strong community and an increasing array of libraries and tools. This growth indicates a promising future for Rust in various domains, including DSP and AI. By adopting Rust, we can leverage this vibrant ecosystem to enhance our capabilities further.

6. Potential for an In-House Framework

Considering these advantages, Rust presents itself as a prime candidate for developing an in-house framework tailored to our specific needs in DSP and AI. Such a framework could lead to more efficient and safer code, driving the innovation and quality of our products to new heights.

Rust's Alignment with DSP and AI Development: A Closer Look

The unique features of Rust, particularly its renowned borrow checker, align remarkably well with the intricate needs of Digital Signal Processing (DSP) and Artificial Intelligence (AI) development. Let's delve into how these features can significantly enhance the performance, reliability, and scalability of our projects at Synergy DSP.


Borrow Checker: Ensuring Memory Safety and Efficiency

  • Precision in Memory Management: Rust’s borrow checker is a standout feature that ensures memory safety without the overhead of a garbage collector. In DSP and AI, where precise memory management is crucial for processing large data sets or real-time audio signals, this feature guarantees both safety and efficiency.

  • Prevention of Data Races: The borrow checker enforces rules that prevent data races in concurrent programming. For our DSP applications, this means we can confidently handle multiple streams of audio data in parallel without the risk of memory corruption or unexpected behavior.



This example demonstrates Rust’s borrow checker in action. The process_audio function safely accesses and modifies the audio buffer in place, ensuring no other part of the code can simultaneously modify the buffer, thus preventing data races.

Enhanced Performance for Real-Time Processing

  • Efficiency in High-Performance Scenarios: Rust's zero-cost abstractions allow us to write low-level code without sacrificing performance, a critical aspect in real-time DSP applications. This capability ensures that our signal processing algorithms are fast and responsive, vital for real-time audio applications.

  • Optimization Opportunities: Rust's advanced compiler optimizations help in squeezing out extra performance, essential for computationally intensive tasks in AI algorithms.


This code uses a Rust FFT library to perform a fast Fourier transform, a key operation in DSP for real-time processing. Rust's efficiency is critical for such computations that demand high performance.

Reliability in Complex Systems

  • Robust Error Handling: Rust's approach to error handling encourages us to handle potential errors explicitly, leading to more reliable and robust code. In the complex world of AI, where unexpected data or situations can arise, this results in more stable and predictable systems.

  • Compile-Time Guarantees: The strong type system and compile-time checks of Rust mean many bugs are caught early in the development process. For DSP and AI applications, where debugging can be exceptionally challenging, this is a significant advantage.


This example shows Rust's approach to error handling, which is essential for building reliable DSP systems. Functions return a Result type, making error handling explicit and robust.


Scalability with Confidence

  • Ease in Managing Complex Systems: Rust's features like ownership and lifetimes facilitate better management of resources, which is crucial as our DSP and AI projects grow in complexity.

  • Future-Proofing: By using Rust, we're not only addressing our current needs but also future-proofing our tech stack. Rust's scalability and growing ecosystem ensure that our solutions remain relevant and adaptable to future advancements in DSP and AI.


This example uses the Rayon crate for parallel processing, demonstrating Rust’s ability to handle large-scale, scalable DSP operations efficiently.

The Journey to an In-House Rust Framework: A Future Endeavor

As we delve into the possibilities Rust offers for Synergy DSP, particularly in DSP and AI, the idea of developing an in-house framework emerges as an exciting yet long-term goal. The creation of such a framework is not an overnight task; it's a journey that spans years. Let's explore why this endeavor, while promising, requires a significant investment of time and resources.

1. Framework Development Criteria

For our in-house Rust framework to be successful, it must meet several key criteria, ensuring it aligns with our company’s needs and industry standards:

- Support for VST, LV2, and AU Plugins
  • Comprehensive Plugin Compatibility: The framework must provide comprehensive support for various plugin formats, including VST, LV2, and AU. This is crucial for ensuring our products are versatile and compatible with a wide range of host applications and platforms.

- Portability Across Platforms
  • Cross-Platform Functionality: A core requirement is the framework’s ability to operate seamlessly across different platforms. Portability is key to catering to a broad user base, whether they are on Windows, macOS, or Linux.

- Developer Experience (DX) Comparable to JUCE

In the world of software development, the term 'Developer Experience' (DX) is often used, but its interpretation can vary. In my opinion, DX is a relative term, shaped by the specific needs and contexts of different projects and teams. When I refer to DX in the context of adopting Rust at Synergy DSP, I'm particularly thinking about the structural aspects of JUCE that we have come to appreciate.

  • Intuitive and Efficient Development Process:

2. Framework Design and Development

  • In-depth Planning: Designing an in-house framework that caters to our specific needs in DSP and AI requires meticulous planning. It involves understanding our current and future requirements and how Rust can best meet those needs.

  • Iterative Development: Building a framework is an iterative process. It starts with a basic structure, which then evolves based on testing, user feedback, and changing requirements.

3. Mastery of Rust’s Complexities

  • Learning Curve: Rust is known for its steep learning curve, especially for teams accustomed to languages like C++, Python, or JavaScript. Gaining proficiency in Rust's unique features, such as ownership, borrowing, and lifetimes, takes time.

  • Team Training and Adaptation: Transitioning our engineering team to Rust involves comprehensive training and a period of adaptation. This is a gradual process to ensure everyone is comfortable and efficient in using Rust.

4. Ecosystem and Community Contributions

  • Dependency on the Rust Ecosystem: As the Rust ecosystem continues to grow, especially in areas pertinent to DSP and AI, we plan to leverage and contribute to this evolution. This includes waiting for necessary libraries and tools to mature, which is a factor in our timeline.

5. Integration and Compatibility Challenges

  • Interfacing with Existing Systems: Integrating a new Rust-based framework with our existing systems, which are primarily built on C++ and other technologies, poses compatibility challenges. Ensuring seamless integration is a time-consuming task that requires careful engineering.

6. Testing and Quality Assurance

  • Extensive Testing: A framework, especially one used for complex DSP and AI tasks, must be rigorously tested. This encompasses unit testing, integration testing, and real-world scenario testing to ensure reliability and performance.

  • Iterative Quality Improvements: Post-launch, the framework will undergo continuous improvements and refinements based on real-world use and evolving requirements.

7. Scalability and Future-Proofing

Building for Scalability: We aim to create a framework that's not just functional but also scalable. This involves planning for future advancements in technology and scalability needs, which adds to the development timeline.

Conclusion: My Vision for Synergy DSP's Future with Rust

As we stand on the brink of a new era in digital signal processing and artificial intelligence at Synergy DSP, I see the potential integration of Rust into our technology stack as a significant step forward in our journey towards innovation and excellence. This journey towards developing an in-house Rust framework is indeed a long-term endeavor, but it is one that perfectly aligns with my vision of advancing the frontiers of DSP and AI technology.

For me, this path is not just about adopting a new programming language; it's about fostering a culture of safety, efficiency, and forward-thinking within our team. The meticulous process of mastering Rust, designing a tailored framework, and ensuring its seamless integration and scalability is a testament to our dedication to quality and our commitment to delivering unparalleled solutions in the world of DSP and AI.

Embarking on this ambitious journey, I understand that great things take time. Our exploration of Rust is more than a technological shift; it’s a strategic move towards future-proofing our technology, enhancing our capabilities, and setting new benchmarks in the industry. It's still early days, and the path forward may evolve as we progress. Adopting Rust is a strong possibility, but we remain adaptable, ready to adjust our strategies to ensure the best outcomes for our projects and our team.

I look forward to sharing our experiences, learnings, and milestones with you as we navigate this exciting path. Your support, feedback, and engagement are invaluable to us as we continue to innovate and lead in this dynamic and ever-evolving field. Thank you for joining us on this remarkable journey.


 
 
 

Recent Posts

See All

Comments


bottom of page