rust

根据百度百科的解释:Rust是Mozilla开发的注重安全、性能和并发性的编程语言。rust官网: https://www.rust-lang.org/

1. 安装
从官网下载安装包,我这里下载的安装包名字是:rust-1.6.0-x86_64-unknown-linux-gnu.tar.gz

然后解压,进入rust目录,根据README提示,执行sudo ./install.sh命令来安装rust。

2. hello
hello world源码:
// This is a comment, and will be ignored by the compiler
// You can test this code by clicking the "Run" button over there ->
// or if prefer to use your keyboard, you can use the "Ctrl + Enter" shortcut

// This code is editable, feel free to hack it!
// You can always return to the original code by clicking the "Reset" button ->

// This is the main function
fn main() {
    // The statements here will be executed when the compiled binary is called

    // Print text to the console
    println!("Hello World!");
}

然后编译,编译使用rustc命令:
rustc hello.rs

运行:
$ ./hello
Hello World!

参考: http://rustbyexample.com/hello.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值