Skip to content

Instantly share code, notes, and snippets.

@bjfish
Created Jan 21, 2019
Embed
What would you like to do?
Wasmer Wasm Sample App
// Defines functions to import from "env" namespace
extern "C" {
fn print_str(ptr: *const u8, len: usize);
}
#[no_mangle]
pub extern fn hello_wasm(){
let message = "Hello World";
unsafe {
print_str(message.as_ptr(), message.len());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment