cffi + rust

Basic example to call a rust function with the helps of CFFI Package. :

// Specifies the type of crate.
#![crate_type = "dylib"]
// Specifies the crate name.
#![crate_name = "rust2cffi"]
// Disables symbol name encoding.
// compile: rustc

pub extern fn mul(value1: i32, value2: i32) -> i32 {
    value1 * value2


package require cffi

cffi::Wrapper create RUST2CFFI librust2cffi[info sharedlibextension]
# call rust function...
RUST2CFFI function mul int {value1 int value2 int}

puts [mul 3 3]