了解#
一般來說,要決定學習一門新語言之前,會先大致了解這門語言的特點和目前的發展情況。
這時,建議看 Rust 官網 https://rust-lang.org
Rust 官方文檔#
Rust 語言的學習或參考文檔大都列在 Rust 學習指引頁 和 Rust 官方文檔首頁 上,目前 Rust 官方團隊已經將相關文檔拆分到不同的倉庫上:
- 《Rust 程序設計語言》(The Rust Programming Language),對應 GitHub 倉庫
- 《通過例子學 Rust》(Rust by Example),對應 GitHub 倉庫
- Rust 版本指南(The Edition Guide),對應 GitHub 倉庫
- Cargo 幫助文檔,對應 GitHub 倉庫源文件
- rustdoc 幫助文檔,對應 GitHub 倉庫源文件
- rustc 幫助文檔,對應 GitHub 倉庫源文件
- Rust 編譯錯誤索引,對應 GitHub 倉庫源代碼
- 《Rust 語言參考》(The Rust Reference),對應 GitHub 倉庫
- The Rustonomicon,對應 GitHub 倉庫
還有其他更多官方或其他非官方相關的文檔:
- 使用 Rust 編寫命令行應用,對應 GitHub 倉庫地址
- Rust 和 WebAssembly 教程(WebAssembly Book),對應 GitHub 倉庫
- 嵌入式 Rust 教程,對應 GitHub 倉庫
- A Rust Cookbook,對應 GitHub 倉庫
- The Unstable Book,對應 GitHub 倉庫源代碼
- rustc 指引 ——Rust 編譯器的工作原理及如何參與貢獻(rustc-guide),對應 GitHub 倉庫
- rustup 命令說明,本翻譯項目會將
rustup的相關說明翻譯成中文 - Rust RFC——Rust 發展相關制定的文稿,對應 GitHub 倉庫
- mdBook 使用手冊,對應 GitHub 倉庫
- Rust API 指導原則,對應 GitHub 倉庫
- async-book,對應 GitHub 倉庫
上述文檔的源文件有些是放在 rust 和 cargo 的倉庫的子目錄中:Rust 文檔 和 cargo 文檔。
Rust 資源#
Rust 相關的中文資源,包括網站,或者國內的 Rust 的文章或書籍。
Rust 相關的中文網站#
以下列出目前搜集到的 Rust 中文網站:
Rust 語言中文社區:https://rust.cc/
Rust Wiki 網:https://rustwiki.org/
Rust 語言術語中英文對照表#
👉 部分來自 Rust 語言術語中英文對照表倉庫,收錄在此處,只是方便 Rust 學習者統一查閱,若是發現有任何錯誤或需要完善地方,請在原倉庫指出或修改錯誤。
| English 英文 | Chinese 中文 | Note 备注 |
|---|---|---|
| A | ||
| Abstract Syntax Tree | 抽象語法樹 | |
| ABI | 應用程序二進制接口 | Application Binary Interface 縮寫 |
| accumulator | 累加器 | |
| accumulator variable | 累加器變量 | |
| ahead-of-time compiled | 預編譯 | |
| ahead-of-time compiled language | 預編譯語言 | |
| alias | 別名 | |
| aliasing | 別名使用 | 參見 Wikipedia |
| angle brackets | 尖括號,“<” 和 “>” | |
| annotate | 標註,注明(動詞) | |
| annotation | 標註,注明(名詞) | |
| ARC | 原子引用計數器 | Atomic Referecne Counter |
| anonymity | 匿名 | |
| argument | 參數,實參,實際參數 | 不嚴格區分的話, argument(參數)和 parameter(參量)可以互換地使用 |
| argument type | 參數類型 | |
| assignment | 赋值 | |
| associated functions | 關聯函數 | |
| associated items | 關聯項 | |
| associated types | 關聯類型 | |
| asterisk | 星號(*) | |
| atomic | 原子的 | |
| attribute | 屬性 | |
| automated building | 自動構建 | |
| automated test | 自動測試,自動化測試 | |
| B | ||
| baroque macro | 巴洛克宏 | |
| benchmark | 基準 | |
| binary | 二進制的 | |
| binary executable | 二進制的可執行文件 | |
| bind | 綁定 | |
| block | 語句塊,代碼塊 | |
| boolean | 布爾型,布爾值 | |
| borrow check | 借用檢查 | |
| borrower | 借用者,借入者 | |
| borrowing | 借用 | |
| bound | 約束,限定,限制 | 此詞和 constraint 意思相近, constraint 在 C# 語言中翻譯成 “約束” |
| box | 箱子,盒子,裝箱類型 | 一般不譯,作動詞時翻譯成 “裝箱”, 具有所有權的智能指針 |
| boxed | 裝箱,裝包 | |
| boxing | 裝箱,裝包 | |
| brace | 大括號,“{” 或 “}” | |
| buffer | 緩衝,緩衝區,緩衝器,緩存 | |
| build | 構建 | |
| builder pattern | 創建者模式 | |
| C | ||
| call | 調用 | |
| caller | 調用者 | |
| capacity | 容器 | |
| capture | 捕獲 | |
| cargo | (Rust 包管理器,不譯) | 該詞作名詞時意思是 “貨物”, 作動詞時意思是 “裝載貨物” |
| cargo-fy | Cargo 化,使用 Cargo 創建項目 | |
| case analysis | 事例分析 | |
| cast | 類型轉換,轉型 | |
| casting | 類型轉換 | |
| chaining method call | 鏈式方法調用 | |
| channel | 信道,通道 | |
| closure | 閉包 | |
| coercion | 強制類型轉換,強制轉換 | coercion 原意是 “強制,脅迫” |
| collection | 集合 | 參見 Wikipedia |
| combinator | 組合算子,組合器 | |
| comma | 逗號,“,” | |
| command | 命令 | |
| command line | 命令行 | |
| comment | 註釋 | |
| compile | 編譯(動詞) | |
| compile time | 編譯期,編譯期間,編譯時 | |
| compilation | 編譯(名詞) | |
| compilation unit | 編譯單元 | |
| compiler | 編譯器 | |
| compiler intrinsics | 編譯器固有功能 | |
| compound | 複合(類型,數據) | |
| concurrency | 並發 | |
| conditional compilation | 條件編譯 | |
| configuration | 配置 | |
| constructor | 構造器 | |
| consumer | 消費者 | |
| container | 容器 | |
| container type | 容器類型 | |
| convert | 轉換,轉化,轉 | |
| copy | 複製,拷貝 | |
| crate | 包,包裝箱,裝包 | 一般不譯,crate 是 Rust 的基本編譯單元 |
| curly braces | 大括號,包含 “{” 和 “}” | |
| custom type | 自定義類型 | |
| D | ||
| dangling pointer | 懸垂指針 | use after free 在釋放後使用 |
| data race | 數據競爭 | |
| dead code | 死代碼,無效代碼,不可達代碼 | |
| deallocate | 釋放,重新分配 | |
| declare | 聲明 | |
| deep copy | 深拷貝,深複製 | |
| dependency | 依賴 | |
| deref coercions | 強制多態 | |
| dereference | 解引用 | Rust 文章中有時簡寫為 Deref |
| derive | 派生 | |
| designator | 指示符 | |
| destruction | 銷毀,毀滅 | |
| destructor | 析構器,析構函數 | |
| destructure | 解構 | |
| destructuring | 解構,解構賦值 | |
| desugar | 脫糖 | |
| diverge function | 發散函數 | |
| device drive | 設備驅動 | |
| directory | 目錄 | |
| dispatch | 分發 | |
| diverging functions | 發散函數 | |
| documentation | 文檔 | |
| dot operator | 點運算符 | |
| DST | 動態大小類型 | dynamic sized type,一般不譯, 使用英文縮寫形式 |
| dynamic language | 動態類型語言 | |
| dynamic trait type | 動態特質類型 | |
| E | ||
| enumeration | 枚舉 | |
| encapsulation | 封裝 | |
| equality test | 相等測試 | |
| elision | 省略 | |
| exhaustiveness checking | 窮盡性檢查,無遺漏檢查 | |
| expression | 表達式 | |
| expression-oriented language | 面向表達式的語言 | |
| explicit | 顯式 | |
| explicit discriminator | 顯式的辨別值 | |
| explicit type conversion | 顯式類型轉換 | |
| extension | 擴展名 | |
| extern | 外,外部 | 作關鍵字時不譯 |
| F | ||
| fat pointer | 胖指針 | |
| feature gate | 功能開關 | |
| field | 字段 | |
| field-level mutability | 字段級別可變性 | |
| file | 文件 | |
| fmt | 格式化,是 format 的縮寫 | |
| formatter | 格式化程序,格式化工具,格式器 | |
| floating-point number | 浮點數 | |
| flow control | 流程控制 | |
| Foreign Function Interface(FFI) | 外部語言函數接口 | |
| fragment specifier | 片段分類符 | |
| free variables | 自由變量 | |
| freeze | 凍結 | |
| function | 函數 | |
| function declaration | 函數聲明 | |
| functional | 函數式 | |
| G | ||
| garbage collector | 垃圾回收 | |
| generalize | 泛化,泛型化 | |
| generator | 生成器 | |
| generic | 泛型 | |
| generic type | 泛型類型 | |
| growable | 可增長的 | |
| guard | 守衛 | |
| H | ||
| handle error | 句柄錯誤 | |
| hash | 哈希,哈希值,散列 | |
| hash map | 散列映射,哈希表 | |
| heap | 堆 | |
| hierarchy | 層次,分層,層次結構 | |
| higher rank lifetime | 高階生命週期 | |
| higher rank trait bound | 高階特質約束 | |
| higher tank type | 高階類型 | |
| hygiene | 衛生 | |
| hygienic macro system | 衛生宏系統 | |
| I | ||
| ICE | 編譯內部錯誤 | internal comppiler error 的縮寫 |
| immutable | 不可變的 | |
| implement | 實現 | |
| implementor | 實現者 | |
| implicit | 隱式 | |
| implicit discriminator | 隱式的辨別值 | |
| implicit type conversion | 隱式類型轉換 | |
| import | 導入 | |
| in assignment | 在賦值(語句) | |
| index | 索引 | 英語複數形式:indices |
| infer | 推導(動詞) | |
| inference | 推導(名詞) | |
| inherited mutability | 承襲可變性 | |
| inheritance | 繼承 | |
| integrated development environment(IDE) | 集成開發環境 | 中文著作中通常直接寫成 IDE |
| integration-style test | 集成測試 | |
| interior mutability | 內部可變性 | |
| installer | 安裝程序,安裝器 | |
| instance | 實例 | |
| instance method | 實例方法 | |
| integer | 整型,整數 | |
| interact | 相互作用,相互影響 | |
| interior mutability | 內部可變性 | |
| intrinsic | 固有的 | |
| invoke | 調用 | |
| item | 項,條目,項目 | |
| iterate | 重複 | |
| iteration | 迭代 | |
| iterator | 迭代器 | |
| iterator adaptors | 迭代器適配器 | |
| iterator invalidation | 迭代器失效 | |
| L | ||
| LHS | 左操作數 | left-hand side 的非正式縮寫, 與 RHS 相對 |
| lender | 借出者 | |
| library | 庫 | |
| lifetime | 生存時間,壽命,生命週期 | |
| lifetime elision | 生命週期省略 | |
| link | 鏈接 | |
| linked-list | 鏈表 | |
| lint | (不譯) | lint 英文本義是 “紗布,絨毛”,此詞在 計算機領域中表示程序代碼中可疑和 不具結構性的片段,參見 Wikipedia |
| list | 列表 | |
| listener | 監聽器 | |
| literal | 數據,常量數據,字面值,字面量, 字面常量,字面上的 | 英文意思:字面意義的(內容) |
| LLVM | (不譯) | Low Level Virtual Machine 的縮寫, 是構建編譯器的系統 |
| loop | 循環 | 作關鍵字時不譯 |
| low-level code | 底層代碼 | |
| low-level language | 底層語言 | |
| l-value | 左值 | |
| M | ||
| main function | main 函數,主函數 | |
| macro | 宏 | |
| map | 映射 | 一般不譯 |
| match guard | 匹配守衛 | |
| memory | 內存 | |
| memory leak | 內存泄露 | |
| memory safe | 內存安全 | |
| meta | 原則,元 | |
| metadata | 元數據 | |
| metaprogramming | 元編程 | |
| metavariable | 元變量 | |
| method call syntax | 方法調用語法 | |
| method chaining | 方法鏈 | |
| method definition | 方法定義 | |
| modifier | 修飾符 | |
| module | 模塊 | |
| monomorphization | 單態 | mono: one, morph: form |
| move | 移動,轉移 | 按照 Rust 所規定的內容, 英語單詞 transfer 的意思 比 move 更貼合實際描述 參考:Rust by Example |
| move semantics | 移動語義 | |
| mutability | 可變性 | |
| mutable | 可變 | |
| mutable reference | 可變引用 | |
| multiple bounds | 多重約束 | |
| mutiple patterns | 多重模式 | |
| N | ||
| nest | 嵌套 | |
| Nightly Rust | Rust 開發版 | nightly 本意是 “每夜,每天晚上”, 指代碼每天都更新 |
| NLL | 非詞法生命週期 | non lexical lifetime 的縮寫, 一般不譯 |
| non-copy type | 非複製類型 | |
| non-generic | 非泛型 | |
| no-op | 空操作,空運算 | (此詞出現在類型轉換章節中) |
| non-commutative | 非交換的 | |
| non-scalar cast | 非標量轉換 | |
| notation | 符號,記號 | |
| numeric | 數值,數字 | |
| O | ||
| optimization | 優化 | |
| out-of-bounds accessing | 越界訪問 | |
| orphan rule | 孤兒規則 | |
| overflow | 溢出,越界 | |
| own | 占有,擁有 | |
| owner | 所有者,擁有者 | |
| ownership | 所有權 | |
| P | ||
| package manager | 包管理器,軟件包管理器 | |
| panic | (不譯) | 此單詞直接翻譯是 “恐慌”, 在 Rust 中用於不可恢復的錯誤處理 |
| parameter | 參量,形參,形式參量 | 不嚴格區分的話, argument(參數)和 parameter(參量)可以互換地使用 |
| parametric polymorphism | 參數多態 | |
| parent scope | 父級作用域 | |
| parentheses | 小括號,包括 “(” 和 “)” | |
| parse | 分析,解析 | |
| parser | (語法)分析器,解析器 | |
| pattern | 模式 | |
| pattern match | 模式匹配 | |
| phantom type | 虛類型,虛位類型 | phantom 相關的專有名詞: phantom bug 幻影指令 phantom power 幻象電源 參見:Haskell、Haskell/Phantom_type、 Rust/Phantom、stdlib/PhantomData |
| platform | 平台 | |
| polymorphism | 多態 | |
| powershell | (不譯) | Windows 系統的一種命令行外殼程序 和腳本環境 |
| possibility of absence | 不存在的可能性 | |
| precede | 預先?,在... 發生(或出現) | |
| prelude | (不譯) | 預先導入模塊,英文本義:序曲,前奏 |
| primitive types | 原生類型,基本類型,簡單類型 | |
| 打印 | ||
| process | 進程 | |
| procedural macros | 過程宏,程序宏 | |
| project | 項目,工程 | |
| prototype | 原型 | |
| R | ||
| race condition | 競態條件 | |
| RAII | 資源獲取即初始化(一般不譯) | resource acquisition is initialization 的縮寫 |
| range | 區間,範圍 | |
| range expression | 區間表達式 | |
| raw identifier | 原始標識符 | |
| raw pointer | 原始指針,裸指針 | |
| RC | 引用計數 | reference counted |
| Reader | 讀取器 | |
| recursive macro | 递归宏 | |
| reference | 引用 | |
| reference cycle | 引用循環 | |
| release | 發布 | |
| resource | 資源 | |
| resource leak | 資源泄露 | |
| RHS | 右操作數 | right-hand side 的非正式縮寫, 與 LHS 相對 |
| root directory | 根目錄 | |
| runtime | 運行時 | |
| runtime behavior | 運行時行為 | |
| runtime overhead | 運行時開銷 | |
| Rust | (不譯) | 一種編程語言 |
| Rustacean | (不譯) | 編寫 Rust 的程序員或愛好者的通稱 |
| rustc | (不譯) | Rust 語言編譯器 |
| r-value | 右值 | |
| S | ||
| scalar | 標量,數量 | |
| schedule | 調度 | |
| scope | 作用域 | |
| screen | 屏幕 | |
| script | 腳本 | |
| semicolon | 分號,“;” | |
| self | 自身,作關鍵字時不譯 | |
| shadow | 遮蔽,隱蔽,隱藏,覆蓋 | |
| shallow copy | 淺拷貝,淺複製 | |
| signature | 標記 | |
| slice | 切片 | |
| snake case | 蛇形命名 | 參見:Snake case |
| source file | 源文件 | |
| source code | 源代碼 | |
| specialization | 泛型特化 | |
| square | 平方,二次方,二次幂 | |
| square brackets | 中括號,“[” 和 “]” | |
| src | (不譯) | source 的縮寫,指源代碼 |
| stack | 堆 | |
| stack unwind | 堆解開、堆展開 | |
| statement | 語句 | |
| statically allocated | 靜態分配 | |
| statically allocated string | 靜態分配的字符串 | |
| statically dispatch | 靜態分發 | |
| static method | 靜態方法 | |
| string | 字符串 | |
| string literal | 字符串常量 | |
| string slices | 字符串片段 | |
| stringify | 字符串化 | |
| subscript notation | 下標 | |
| sugar | 糖 | |
| super | 父級,作關鍵字時不譯 | |
| syntax context | 語法上下文 | |
| systems programming language | 系統級編程語言 | |
| T | ||
| tagged union | 標記聯合 | |
| target triple | 多層次指標,三層 / 重 指標 / 目標 | triple 本義是 “三”,但此處虛指 “多”, 此詞翻譯需要更多討論 |
| terminal | 終端 | |
| testing | 測試 | |
| testsuit | 測試套件 | |
| the least significant bit (LSB) | 最低數字位 | |
| the most significant bit (MSB) | 最高數字位 | |
| thread | 線程 | |
| TOML | (不譯) | Tom's Obvious, Minimal Language 的縮寫,一種配置語言 |
| token tree | 令牌樹? | 待進一步斟酌 |
| trait | 特質 | 其字面上有 “特性,特徵” 之意 |
| trait bound | 特質約束 | bound 有 “約束,限制,限定” 之意 |
| trait object | 特質對象 | |
| transmute | (不譯) | 其字面上有 “變化,變形,變異” 之意, 不作翻譯 |
| trivial | 平凡的 | |
| troubleshooting | 疑難解答,故障診斷, 故障排除,故障分析 | |
| tuple | 元組 | |
| two's complement | 補碼,二補數 | |
| two-word object | 雙字對象 | |
| type annotation | 類型標註 | |
| type erasure | 類型擦除 | |
| type inference | 類型推導 | |
| type inference engine | 類型推導引擎 | |
| type parameter | 類型參量 | |
| type placeholder | 類型佔位符 | |
| type signature | 類型標記 | |
| U | ||
| undefined behavior | 未定義行為 | |
| uninstall | 卸載 | |
| unit-like struct | 類單元構造體 | |
| unit struct | 單元結構體 | |
| "unit-style" tests | 單元測試 | |
| unit test | 單元測試 | |
| unit type | 單元類型 | |
| universal function call syntax (UFCS) | 通用函數調用語法 | |
| unsized types | 不定長類型 | |
| unwind | 展開 | |
| unwrap | 解包 | 暫譯! |
| V | ||
| variable binding | 變量綁定 | |
| variable shadowing | 變量遮蔽,變量隱蔽, 變量隱藏,變量覆蓋 | |
| variable capture | 變量捕獲 | |
| variant | 變量 | |
| vector | (動態數組,一般不譯) | vector 本義是 “向量” |
| visibility | 可見性 | |
| vtable | 虛表 | |
| W | ||
| where clause | where 子句,where 從句,where 分句 | 在數據庫的官方手冊中多翻譯成 “子句”,英語語法中翻譯成 “從句” |
| wrap | 包裹 | 暫譯! |
| wrapped | 裝包 | |
| wrapper | 裝包 | |
| Y | ||
| yield | 產生 (收益、效益等),產出,提供 | |
| Z | ||
| zero-cost abstractions | 零開銷抽象 | |
| zero-width space(ZWSP) | 零寬空格 |