Using Rust 🦀 for VCV Rack modules

Disclaimers

  • This is NOT a how-to…
  • I was just interested in if using Rust instead of C++ was even possible.
  • I am not a C or Rust expert, I used Gemini Pro 3 & Claude Sonnet 4.5 AI coding agents to help me get it working, and then to annotate the code.
  • I wrote the code on MacOS ARM, no other platforms have been tested, I thoroughly failed to get this to link in my Windows 11 MSYS2 MinGW64 environment.
  • I make no assertions that using Rust for Rack modules is desirable, efficient, wise or even moral. :innocent:
  • In short, don’t blame me, blame the AI, I was just having fun hacking on some code

With that out of the way, I present a little GitHub repo that I made which uses Rust to implement the DSP code for a mono and poly sine wave oscillator.

The mono version uses the Rust crate fundsp

The poly version uses a Taylor-like polynomial & Bhaskara’s sine approximation.


As mentioned above, this currently only works on MacOS ARM, if you happen to get it working on another platform, or have any other fixes for that matter, please do create a PR.

edit: forgot to mention, Rust core::simd is not stable yet, so this code uses the nightly channel, this potentially could be a stumbling block for other platforms, even though it is supposed to be portable_simd

1 Like

FWIW for VCV 3, for a number of reasons, Andrew is working on making it a completely “C” API.

This moves it from being strictly C++ and a specific known compiler and toolchain, to a standardized and portable ABI that can easily be used from any language that supports the “C” ABI. These include Rust, Zig, C, C++, C# – basically any modern compiled language.

4 Likes

Yeah, i saw some of that in the discord livestream, it was probably an unconscious influence in me creating this experiment, it’s quite exciting actually…