rust尝鲜

官网 http://www.rust-lang.org/

下载链接 http://static.rust-lang.org/dist/rust-0.10-i686-unknown-linux-gnu.tar.gz

 rust有mac,windows,mac版本 ,试了windows和linux版本,windows可以下载一个msi安装程序,但是还是需要安装gcc,所以相对麻烦,但是linux比较方便,下载了一个gz文件,解压,里面一个install.sh安装即可

fn main() {
    println!("hello?");
}

比较特殊的一点println后面有一个感叹号,如果没有的话会导致一个语法错误

cd ~/src
touch hello.rs # 写入上面的源码
rustc hello.rs  # 会在当前目录生成名为hello的可执行文件
原文地址:https://www.cnblogs.com/code-style/p/3717898.html