Adding Julia and C++ examples

This commit is contained in:
timmonfette1
2018-02-24 17:30:21 -05:00
parent f12fbd3e42
commit 30999d4c78
9 changed files with 86 additions and 0 deletions

4
julia-to-rust/src/lib.rs Normal file
View File

@@ -0,0 +1,4 @@
#[no_mangle]
pub extern fn double_input(input: i32) -> i32 {
input * 2
}

View File

@@ -0,0 +1,7 @@
input = Int32(10)
output = ccall((:double_input, "target/debug/libdouble_input"),
Int32, (Int32,), input)
print(input)
print(" * 2 = ")
println(output)