为什么学习Rust?

安装和首次运行 Getting Started

https://www.rust-lang.org/learn/get-started

Linux

管理工具:Cargo

Cargo: the Rust build tool and package manager

简单教程和一些说明:

https://polarisxu.studygolang.com/posts/rust/rust-tutorial-02/

https://polarisxu.studygolang.com/posts/rust/rust-tutorial-03/

https://polarisxu.studygolang.com/posts/rust/rust-tutorial-04/

https://polarisxu.studygolang.com/posts/rust/rust-tutorial-05/

https://polarisxu.studygolang.com/posts/rust/rust-tutorial-06/

https://polarisxu.studygolang.com/posts/rust/rust-tutorial-07/

https://polarisxu.studygolang.com/posts/rust/rust-tutorial-08/

https://polarisxu.studygolang.com/posts/rust/rust-tutorial-09/

**Rust 程序设计语言 中文翻译**

https://kaisery.github.io/trpl-zh-cn/ch03-00-common-programming-concepts.html

https://kaisery.github.io/trpl-zh-cn/ch04-01-what-is-ownership.html

https://kaisery.github.io/trpl-zh-cn/ch05-00-structs.html

语法规范

let 关键字创建变量并绑定一个值。


Rust函数和变量名使用snake case 规范:小写字母,下户线分割单词

参数:函数签名的一部分parameters形参 必须声明参数类型;具体值argument由定义中或调用函数时传入。

语句statements 是指令,无返回值;表达式expressions计算并产生返回值。表达式可以作为函数返回值(不用写return),表达式不需要结尾加分号。


控制流 control flow 结构(if和循环)

所有权 ownship

所有权系统管理内存,编译器在编译时检查内存(运行时不损耗)。

Rust无需垃圾回收garbage collector 即可保障内存安全。