Last active
April 26, 2016 19:15
-
-
Save klutzy/7819231 to your computer and use it in GitHub Desktop.
Rust with Emscripten
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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