Skip to content

Instantly share code, notes, and snippets.

@klutzy
Last active Apr 26, 2016
Embed
What would you like to do?
Rust with Emscripten
// emscripten uses le32-unknown-nacl triple but rustc doesn't know it now.
// So just use similar target instead.
// `rustc hello.rs --target=i686-unknown-linux --emit-llvm -S --cfg libc`
// `emcc hello.ll -o hello.js`
// no `extern mod`.
#[no_std];
#[feature(macro_rules)];
use core::container::Container;
// https://github.com/thestinger/rust-core
mod core;
fn main() {
core::io::stdout().write(bytes!("hello world"));
}
#[lang="start"]
fn start(_: *u8, _: int, _: **u8) -> int {
main();
0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment