2014-04-24 13:20 GMT+02:00 Stéphane Wirtel <[email protected]>: > On 24 Apr 2014, at 13:16, Henri Sivonen wrote: > > The documentation for the FFI seems focused on using C code in a >> program whose main() is in Rust. Can Rust be used for implementing a >> shared library that implements a C ABI for use by programs whose >> main() is not in Rust (i.e. the caller sees a C ABI and doesn't know >> about Rust)? If yes, can a C program use multiple such libraries so >> that their Rust runtime bits don't conflict? Is there a tool for >> generating .h files for C-callable Rust functions and their argument >> data types? >> > > Yes, normally you can create a shared lib with Rust and extern the code > with the C convention ( sorry, I don't remember the right name). > and via this convention, you can use your Rust lib in Python/Ruby or an > other languages. > > Here's a very tiny and simple example: https://github.com/FlaPer87/rust-asterisk-example
Hope it helps, -- Flavio (@flaper87) Percoco http://www.flaper87.com http://github.com/FlaPer87
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
