A plugin framework for custom operators in Rust!

Hi all,

For the past $tooLong, I’ve been working on a framework to help facilitate building custom operators in Rust!

This has a number of features:

  1. Cross platform build system using Cargo
  2. A nice idiomatic Rust API
  3. Codegen for implementing plugin parameters and python functionality

There’s still many rough edges and more work to do (please pay attention to the warnings outlined in the project status, but this is mostly ready to start being experimented with by others to help find and fix bugs, particularly around the build system. If you’re interesting in contributing, please file an issue on GitHub and discuss any issues you run into!

You can read the development blog here, and see the plugins folder for some examples.

Thanks, and I hope there are other users here who are excited about Rust. :heart:

12 Likes

Wow. This is amazing, what a project, I applaud your work! Also like your blog writing style :wink:

2 Likes

the-it-crowd-it-crowd

This is just amazing, thank you so much for doing this!
Now I have a reason to start learning Rust :partying_face:

2 Likes

Custom Ops in Rust was in my list of to-do tinkering projects, but havent gotten around to starting yet…!!!

Im so excited to check out what youve got!

1 Like

Hey!

Awesome stuff, glad someone is already onto this! This will definitely be the tool to reach out for next time I wanna do something weird in TD

I’ve developed a rust ffgl plugin, for resolume. Nice sneaking rust into our favourite tools :slight_smile:

I ended up getting lost in the c++ stuff, ended up just manually handling the code from the header entry point for ffgl plugins (a single function with lots of possible parameters).

1 Like

This is something that autocxx helps substantially with. The target for our Rust code is basically just a thin header that serves as a target for autocxx’s codegen. Basically, we just need a simple wrapper that uses references instead of raw pointers, but otherwise we don’t have to write any C++. autocxx also generates safe Rust that ensures we are respecting const correctness, etc. I have been delighted with autocxx and highly recommend it for any future Rust/C++ interop you need.

Just wrote a short blog entry about using the async Rust ecosystem for writing operators that may depend on external resources. This one might require more familiarity with Rust async, but I’m pretty pleased with how this pattern turned out, and in my mind is a lot easier than handling concurrency in C++. The example here was based on calling a hosted ML model running somewhere else, but could also easily be used for things like hardware callbacks, etc.

1 Like