2017年7月19日水曜日

Rust install mac

https://www.rustup.rs/ にしたがって、
curl https://sh.rustup.rs -sSf | sh
とやる。なにか.bash_profile とか書き換えているようで、ちょっと嫌な感じ。cargoなど一切合切ツールチェーンもインストールされる。
$ rustc --version
rustc 1.18.0 (03fc9d622 2017-06-06)
無事インストールできたようだ。
fn main() {
    println!("Hello, world!");
}
をtest.rs としてセーブして、
$ rustc test.rs
とやると test というバイナリができる。
これを実行すると
$ ./test
Hello, world!
となる。a.out になったりしないあたりが偉い。
$ ls -al test
-rwxr-xr-x  1 XXXXXX  staff  400552 Jul 19 16:22 test
400Kbytesもある。いまどきこんなもんか。

0 件のコメント: