本文介绍了Rust语言在Windows下的环境安装,编译,执行。
简介
Rust是静态强类型的编译型语言,非动态解释型语言,无垃圾回收。
Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.
- zero-cost abstractions
- move semantics
- guaranteed memory safety
- threads without data races
- trait-based generics
- pattern matching
- type inference
- minimal runtime
- efficient C bindings
安装
进入Rust官网,首页会根据当前操作系统推荐下载安装包。
支持Windows(GUN ABI 与 MSVC ABI)、Linux以及Mac。
安装完成后,在命令行输入rustc
,如果有输出说明安装成功。
编写代码
1 | fn main() { |
编译
1 | rustc hello.rs |
执行
1 | >hello.exe |
代码
References: