Skip to content

Instantly share code, notes, and snippets.

View lachlansneff's full-sized avatar

Lachlan Sneff lachlansneff

View GitHub Profile
@lachlansneff
lachlansneff / main.rs
Last active February 25, 2019 21:42 — forked from bjfish/main.rs
Wasmer Rust Embedder App Example
use std::str;
use wasmer_runtime::{
imports,
func,
instantiate,
error,
Ctx,
};
@lachlansneff
lachlansneff / lib.rs
Last active January 21, 2019 18:39 — forked from bjfish/lib.rs
Wasmer Wasm Sample App
// Define a function that is imported into the module.
// By default, the "env" namespace is used.
extern "C" {
fn print_str(ptr: *const u8, len: usize);
}
// Define a string that is accessible within the wasm
// linear memory.
static HELLO: &'static str = "Hello, World!";