From fa49e0bf71ccd4bc98df0fa83546250c1b849e2e Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sun, 11 Apr 2021 03:37:32 +0200 Subject: simple ffi with rust and haskell so far, only calling rust from haskell, not the other way round. --- rusty-haskell/rust/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 rusty-haskell/rust/src/lib.rs (limited to 'rusty-haskell/rust/src') diff --git a/rusty-haskell/rust/src/lib.rs b/rusty-haskell/rust/src/lib.rs new file mode 100644 index 0000000..d954f2b --- /dev/null +++ b/rusty-haskell/rust/src/lib.rs @@ -0,0 +1,11 @@ + + +#[no_mangle] +pub extern fn double_input(x: i32) -> i32 { + 2 * x +} + +#[no_mangle] +pub extern fn print_hello() { + println!("hello, world, from rust!"); +} -- cgit v1.2.3