<div dir="ltr"><div>Nice work Alex,</div><div><br></div><div>Look fwd to digging through these on my return from holidays.</div><div><br></div><div>All the best,</div><div><br></div><div>Julian<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 30 Jul 2019 at 16:57, x nor <<a href="mailto:x37v.alex@gmail.com">x37v.alex@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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" target="_blank">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" target="_blank">https://github.com/pure-data/externals-howto</a></div><div><a href="https://github.com/x37v/puredata-rust/tree/develop/examples" target="_blank">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" target="_blank">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" target="_blank">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>
_______________________________________________<br>
Pd-dev mailing list<br>
<a href="mailto:Pd-dev@lists.iem.at" target="_blank">Pd-dev@lists.iem.at</a><br>
<a href="https://lists.puredata.info/listinfo/pd-dev" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-dev</a><br>
</blockquote></div>