Skip to content

Instantly share code, notes, and snippets.

@bjfish
Created January 21, 2019 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bjfish/4381be789be802e9f6c7c481f451a60e to your computer and use it in GitHub Desktop.
Save bjfish/4381be789be802e9f6c7c481f451a60e to your computer and use it in GitHub Desktop.
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