Official web sites:
- https://www.rust-lang.org/ - Official Rust Lang Website
- https://rustup.rs/ - Install Rust Toolchain
- https://github.com/rust-lang Github Group Follows: rust-lang - Offical Rust Lang Github Repo
- https://twitter.com/rustlang - Offical Rust Lang Twitter
- https://www.youtube.com/channel/UCaYhcUwRBNscFNUKTjgPFiA - Offical Rust Lang Youtube

Unofficial web sites:
- https://blessed.rs/ - An unofficial guide to the Rust ecosystem


Rust 是一个系统级编程语言,Rust 最早是由 Mozilla 工程师 Graydon Hoare(https://github.com/graydon) 于 2006 年开始开发的。后来提交给了 Mozilla ,2010年对外公布过 0.1.0 版本,最早由 Ocmal 语言编写。他形容 Rust 是一种线程安全的支持并发的实用型的编程语言,支持函数式编程与命令式编程。

Rust 是一门强调安全、性能和并发性的系统编程语言。它为了达到这几个目的,甚至没有一个垃圾收集器。这也使 Rust 能够应用到其他语言做不到的地方:嵌入到其他语言,有指定空间和时间需求的程序,写底层代码(如设备驱动程序和操作系统)。针对当前的其他编程语言,Rust 做到了没有运行时(Runtime),没有数据竞争。 Rust 也致力于实现“零成本抽象”,尽管这些抽象给人的感觉像一个高级的语言。即使是这样,Rust 仍然可以做到像一个低级的语言那样的精确控制。

从 2016 年 至 2022 年,连续 7 年 Stack Overflow 开发人员调查中,Rust 被评比为 “最受欢迎的编程语言” 之一。

首个 Rust 编译器 叫做 rustboot,始于 2010 年,是用 OCaml 编写的,它最终目的是被用于构建第二个由 Rust 实现的编译器 rustc,并由此开启了 Rust 自举的历程。除了基于 Rust 编写之外,rustc 还使用了 LLVM 作为后端来生成机器代码,来代替之前 rustboot 的手写 x86 代码生成器。Rust 第一次自举构建是在 2011 年 4 月 20 日。该过程总共花了一个小时。

Why is it called “Rust”?

TL;DR: Rust is named after a fungus that is robust, distributed, and parallel.

Also, calling Rust a research language is funny to me because – as its name reflects – we've tried hard to avoid incorporating new technology into it. We haven't always succeeded at failing to be novel, but we have a rule of thumb of not including any ideas in the language that are new as of the past ten years of programming language research. The field of programming language is full of old technology that hasn't been put to use in solving problems that it's exactly suited for. The goals with Rust were to avoid reinventing wheels, and see what the past had to teach us. I can't blame anyone for thinking Rust is a research language, though, since it is being developed by Mozilla Research.

核心设计原则

Rust 的核心设计原则:

- 实用性(Practicality) :它应该是一种可以在现实世界中使用的语言;
- 务实(Pragmatism):它应该是符合人性化体验,并且能与现有系统方便集成的语言;
- 内存安全性(Memory-safety) :它必须加强内存安全,不允许出现段错误和其他类似的内存访问违规操作;
- 高性能(Performance) :它必须拥有能和 C++ 比肩的性能;
- 高并发(Concurrency) :它必须为编写并发代码提供现代化的解决方案。

Foundation

https://foundation.rust-lang.org/ - Rust Foundation

Members: AWS, Google, Huawei, Microsoft, Mozilla

Rust 基金会的目的是使 Rust 维护人员可以快乐地把工作做到最好。Rust 核心团队相信最好的Rust 将由快乐者维护,将基金会的工作重点放在维护者身上,将为所有人提供更好的 Rust。

高性能

Rust 速度惊人且内存利用率极高。由于没有运行时和垃圾回收,它能够胜任对性能要求特别高的服务,可以在嵌入式设备上运行,还能轻松和其他语言集成。

可靠性

Rust 丰富的类型系统和所有权模型保证了内存安全和线程安全,让您在编译期就能够消除各种各样的错误。

生产力

Rust 拥有出色的文档、友好的编译器和清晰的错误提示信息, 还集成了一流的工具 —— 包管理器和构建工具, 智能地自动补全和类型检验的多编辑器支持, 以及自动格式化代码等等。

Pros

  • a uniform compiler from Rust developers with a built-in package builder and manager, test system and documentation generator
  • Safe memory management that helps to avoid segmentation errors
  • An ability to use abstractions, which makes manual memory control easier
  • Fix suggestions for most common compile errors, plus clear and concise pattern errors
  • Pointers could only be used in unsafe code – safe code only includes links to objects guaranteed to exist
  • Great compatibility with Mac and Unix-like systems

Cons

  • Lack of classes and succession, which makes writing object-oriented code harder
  • Very strict compiler that sometimes polices memory addresses too much

Online Installation

Official site: https://rustup.rs/, install:

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Update Rust:

$ rustup update stable


Rustup Mirror:

export RUSTUP_DIST_SERVER="https://rsproxy.cn"
export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup"

curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh

~/.cargo/config config:

[source.crates-io]
replace-with = 'rsproxy-sparse'
[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"
[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"
[net]
git-fetch-with-cli = true

Offline Installation

Other Rust Installation Methods:

https://forge.rust-lang.org/infra/other-installation-methods.html

Play Rust Online

Just open https://play.rust-lang.org/ or https://play.integer32.com/

Compile with Rustc

Edit file:

% vi helloworld.rs
fn main() {
    println!("Hello world!");
}

Compile:

% rustc helloworld.rs

Run:

% ./helloworld
Hello world!

Create Project with Cargo

New project:

% cargo new helloworld
% cd helloworld

Edit file:

% vi src/main.rs
fn main() {
    println!("Hello world!");
}

Build:

% cargo build

Run:

% ./target/debug/helloworld
Hello world!

Install Crates with Cargo

Cargo install can install many tools registered on crates.io, like:

$ cargo install just

More tools: https://ruststack.org/rust-tools/

Check Code with Cargo

Check a local package and all of its dependencies for errors

% cargo check

Lint Code with Cargo

Checks a package to catch common mistakes and improve your Rust code.

% cargo clippy

Learn Rust

Course for Rust learner from Microsoft:

std - Rust

https://doc.rust-lang.org/std/

docs.rs

https://docs.rs/ - Docs.rs

- intellij-rust.github.io - IntelliJ Rust
- visualstudio.com/items/rust-lang.rust - Visual Studio Code>Programming Languages>Rust
- visualstudio.com/items/matklad.rust-analyzer - Visual Studio Code>Programming Languages>rust-analyzer
- eclipse.org/projects/tools.corrosion - Eclipse Corrosion: the Eclipse IDE for Rust

See more: https://areweideyet.com/

Read books, please click Rust Books

Rustup doc

Cargo docs:

$  cargo doc --open

Show Rust docs:

$ rustup doc [--book]
--alloc           The Rust core allocation and collections library
--book            The Rust Programming Language book
--cargo           The Cargo Book
--core            The Rust Core Library
--edition-guide   The Rust Edition Guide
--embedded-book   The Embedded Rust Book
--nomicon         The Dark Arts of Advanced and Unsafe Rust Programming
--path            Only print the path to the documentation
--proc_macro      A support library for macro authors when defining new macros
--reference       The Rust Reference
--rust-by-example A collection of runnable examples that illustrate various Rust concepts and standard libraries
--rustc           The compiler for the Rust programming language
--rustdoc         Generate documentation for Rust projects
--std             Standard library API documentation
--test            Support code for rustc's built in unit-test and micro-benchmarking framework
--unstable-book   The Unstable Book

Online Study

https://tourofrust.com/ - Tour of Rust - Hello, Rust

Algorithms

https://github.com/TheAlgorithms/Rust Github Repo Stars: TheAlgorithms/Rust - All Algorithms implemented in Rust
https://rust-algo.club/ - Rust Algorithm Club

Other

http://intorust.com/ - into_rust(): screencasts for learning Rust
https://www.hackertouch.com/ - Rust Tutorial - Learn Rust Programming Language from the Basics with Code Examples
https://github.com/developer-learning/learning-rust Github Repo Stars: developer-learning/learning-rust
https://rustcc.com/ - Rust语言中文社区索引站
https://resource.rs/ - Resource.rs - 旨在提供一站式的 Rust 学习资源
https://github.com/brson/my-rust-lists Github Repo Stars: brson/my-rust-lists - Lightly organized personal notes about Rust
https://github.com/mre/idiomatic-rust Github Repo Stars: mre/idiomatic-rust - A peer-reviewed collection of articles/talks/repos which teach concise, idiomatic Rust

https://github.com/rust-unofficial/awesome-rust Github Repo Stars: rust-unofficial/awesome-rust - Awesome Rust
https://github.com/rustcc/awesome-rust Github Repo Stars: rustcc/awesome-rust - Rust框架、库和资源的汇总, Rust中文社区
https://awesome-rust.com/ - Awesome Rust[GitHub] Github Repo Stars: awesome-rust-com/awesome-rust
https://github.com/rust-embedded/awesome-embedded-rust Github Repo Stars: rust-embedded/awesome-embedded-rust - Awesome Embedded Rust
https://github.com/PuzzledAlien/awesome-rust-cn Github Repo Stars: PuzzledAlien/awesome-rust-cn - Awesome Rust资源列表 中文版
https://github.com/jetli/awesome-yew Github Repo Stars: jetli/awesome-yew - Awesome Yew
https://github.com/rust-in-blockchain/awesome-blockchain-rust Github Repo Stars: rust-in-blockchain/awesome-blockchain-rust - Awesome Blockchain Rust
https://github.com/rust-cc/awesome-cryptography-rust - Awesome Cryptography Rust
https://cryptography.rs/ - Awesome Rust Cryptography[GitHub] Github Repo Stars: The-DevX-Initiative/RCIG_Coordination_Repo
https://github.com/vaaaaanquish/Awesome-Rust-MachineLearning Github Repo Stars: vaaaaanquish/Awesome-Rust-MachineLearning - This repository is a list of machine learning libraries written in Rust
https://github.com/ctjhoa/rust-learning Github Repo Stars: ctjhoa/rust-learning - A bunch of links to blog posts, articles, videos, etc for learning Rust
https://github.com/zzy/awesome-rust-zh-cn Github Repo Stars: zzy/awesome-rust-zh-cn - Rust棒棒哒!资源大全中文版
https://github.com/TaKO8Ki/awesome-rewrite-it-in-rust Github Repo Stars: TaKO8Ki/awesome-rewrite-it-in-rust - A curated list of replacements for existing software written in Rust
https://github.com/KernelErr/awesome-rust-zh Github Repo Stars: KernelErr/awesome-rust-zh - Rust资源汇总 中文版
https://github.com/rustwasm/awesome-rust-and-webassembly Github Repo Stars: rustwasm/awesome-rust-and-webassembly - Awesome Rust and WebAssembly projects, libraries, tools, and resources
https://rustrepo.com/ - Awesome Rust Repositories | RustRepo

- https://crates.io/ - Crates.io
- https://docs.rs/ - Docs.rs
- https://lib.rs/ - Lib.rs

Goto Rust Crates

https://napi.rs/ - NAPI-RS is a framework for building pre-compiled Node.js addons in Rust

https://caniuse.rs/ - caniuse.rs | Rust feature search

- https://areweideyet.com/ - Are we (I)DE yet?
- https://areweasyncyet.rs/ - Are we async yet? 🎉 Yes! 🎉
- https://www.arewewebyet.org/ - Are we web yet? 🎉 Yes! 🎉
- https://www.areweguiyet.com/ - Are we GUI Yet?
- https://areweaudioyet.com/ - Are We Audio Yet?
- http://www.arewelearningyet.com/ - Are we learning yet?
- https://arewegameyet.rs/ - Are we game yet?

https://wiki.mozilla.org/Areweyet - Areweyet

JavaScript Web 应用程序很难获得,并保持可靠的性能。JavaScript 的动态类型系统和垃圾回收暂停没有帮助。如果您不小心徘徊在 JIT 的快乐路径上,看似很小的代码更改可能导致严重的性能退化。

Rust 为程序员提供了低层控制和可靠的性能。它不受 JavaScript 的非确定性垃圾收集暂停的影响。程序员可以以间接,单态化和内存布局,去控制。

WASM projects: https://www.arewewebyet.org/topics/webassembly/

WASM Github groups:
- https://github.com/bytecodealliance Github Group Follows: bytecodealliance
- https://github.com/wasmerio Github Group Follows: wasmerio
- https://github.com/rustwasm Github Group Follows: rustwasm


Learn more: https://wasm.cloudbook.wiki/

https://rustcc.cn/ - Rust语言中文社区
https://learnku.com/rust - Rust 技术论坛 | Rust 语言技术论坛 - 优质的 Rust 开发者学习社区

  1. PingCAP(TiKV)
  2. Facebook(version control)
  3. Dropbox
  4. Firefox
  5. Discord
  6. Linkerd
  7. Google(fuschia)
  8. Microsoft(windows-rs)
  9. AWS(Firecracker)
  10. Huawei(C2Rust)

Official list: Production users
Thirdparty company list: https://github.com/omarabid/rust-companies Github Repo Stars: omarabid/rust-companies

Announcing KataOS and Sparrow - To prove-out a secure ambient system in its entirety, we're also building a reference implementation for KataOS called Sparrow, which combines KataOS with a secured hardware platform.
https://deno.land/ - Deno[GitHub] Github Repo Stars: denoland/deno
https://www.diem.com/ - Diem[GitHub] Github Repo Stars: diem/diem
https://tikv.org/ - TiKV[GitHub] Github Repo Stars: tikv/tikv
https://github.com/cswinter/LocustDB Github Repo Stars: cswinter/LocustDB - LocustDB
https://teaclave.apache.org/ - Apache Teaclave (Incubating)[GitHub] Github Repo Stars: apache/incubator-teaclave
https://www.redox-os.org/ - OS written in Rust[GitLab]
https://www.tockos.org/ - TockOS[GitHub] Github Repo Stars: tock/tock
https://firecracker-microvm.github.io/ - Firecracker[Github] Github Repo Stars: firecracker-microvm/firecracker
https://fuchsia.dev/ - Fuchsia
https://github.com/rcore-os/zCore Github Repo Stars: rcore-os/zCore - zCore
https://chromium.googlesource.com/chromiumos/platform/crosvm/ - Chrome OS Virtual Machine Monitor



Trending

Create your *.cli.rs web site, access https://cli.rs/ [GitHub] Github Repo Stars: zackify/cli.rs

https://github.com/rust-secure-code Github Group Follows: rust-secure-code - Rust Secure Code Working Group
https://github.com/rust-secure-code/cargo-supply-chain Github Repo Stars: rust-secure-code/cargo-supply-chain - Gather author, contributor and publisher data on crates in your dependency graph

https://github.com/Rust-GCC/gccrs Github Repo Stars: Rust-GCC/gccrs GCC Front-End for Rust
https://github.com/thepowersgang/mrustc Github Repo Stars: thepowersgang/mrustc - Alternative rust compiler (re-implementation)
https://github.com/uwplse/crust Github Repo Stars: uwplse/crust - A compiler from Rust to C, and a checker for unsafe code
https://github.com/immunant/c2rust Github Repo Stars: immunant/c2rust - Migrate C code to Rust

https://github.com/rustcc/writing-an-os-in-rust Github Repo Stars: rustcc/writing-an-os-in-rust - 《使用Rust编写操作系统》

Rust for {Ruby, Haskell, C, …} programmers
https://github.com/mre/rust-for-x Github Repo Stars: mre/rust-for-x

Rust for JS Developers
https://rustforjs.dev/

Rust for Java Developers
Rust for Java Developers @YouTube

https://github.com/dtolnay/rust-faq Github Repo Stars: dtolnay/rust-faq - Frequently Asked Questions · The Rust Programming Language

https://www.rustjobs.dev/ - Find Rust Jobs