<div dir="ltr"><div>This is very much still a work in progress, but recently I've been working on writing pure data externals in Rust and I figured I'd share:</div><div><br></div><div><a href="https://github.com/x37v/puredata-rust">https://github.com/x37v/puredata-rust</a></div><div><br></div><div>Rust can create dynamic libraries that can be loaded in C based projects without the need for any external build tools, building simply uses rusts `cargo` build system (and package manager).</div><div>I've setup the automatic binding to `m_pd.h` (puredata-sys), some ease of use classes for creating externals, and a macro that generates a bunch of boiler plate code so you don't have to.<br></div><div><br></div><div>With this I've created Rust versions of the 4 example externals from the HOWTO: <br></div><div><a href="https://github.com/pure-data/externals-howto">https://github.com/pure-data/externals-howto</a></div><div><a href="https://github.com/x37v/puredata-rust/tree/develop/examples">https://github.com/x37v/puredata-rust/tree/develop/examples</a></div><div><br></div><div>With the help of a macro and attributes, beyond the dependency setup, this is all you need to write a signal external:<br></div><div><a href="https://github.com/x37v/puredata-rust/blob/develop/examples/xfade/src/lib.rs">https://github.com/x37v/puredata-rust/blob/develop/examples/xfade/src/lib.rs</a></div><div>or a control external:</div><div><a href="https://github.com/x37v/puredata-rust/blob/develop/examples/complex_counter/src/lib.rs">https://github.com/x37v/puredata-rust/blob/develop/examples/complex_counter/src/lib.rs</a></div><div><br></div><div>Anyways, I figured I'd share in case anyone else is interested, maybe wants to contribute or just use it themselves.<br></div><div>I'm tired/done with c/c++ and Rust has presented itself as a great alternative for a lot of situations.</div><div>It was fun to discover that I can generate pure data externals with Rust and its build system.<br></div><div><br></div><div>--Alex<br></div></div>