Rust
閱讀設定
編程範式 | 編譯語言、並行計算、 函數式、指令式、 物件導向、結構化 |
---|---|
設計者 | Graydon Hoare |
編程員 | Mozilla |
第一次出現 | 2010年 |
穩定版本 | 1.83.0[1]
/ 2024年11月28號,18個鐘頭之前 |
類型系統 | 靜態類型、強型別、 類型推論、結構類型 |
操作系統 | Linux、macOS、Windows FreeBSD、Android、iOS等[2] |
軟件授權 | Apache許可證2.0及MIT許可證[3] |
副檔名 | .rs、.rlib |
網站 | rust-lang.org |
啟發語言 | |
Alef[4]、C#[4]、C++[4]、Cyclone[4][5] Erlang[4]、Haskell[4]、Hermes[4]、Limbo[4] Newsqueak[4]、NIL[4]、OCaml[4]、Ruby[4] Scheme[4]、Standard ML[4]、Swift[4][6] | |
影響語言 | |
C# 7[7]、Elm[8]、Idris[9]、Swift[10] |
Rust係由Mozilla主導開發嘅通用、編譯型程式語言。設計準則係「安全、並行、實用」,行到函數式、並行式、程序式同埋物件導向嘅程式設計風格。
生態系統
[編輯]除咗編譯器同埋標準庫,Rust生態系統仲包括用喺軟件開發嘅額外組件。官方推薦用Rustup,一個Rust工具鏈安裝程序嚟管理呢啲組件。
Cargo
[編輯]Cargo係Rust嘅軟件包管理器,用嚟下載同構建依賴關係。Cargo仲做咗Clippy同其他Rust組件嘅封裝器。佢要求項目遵循一定嘅目錄結構。[11]
Cargo.toml文件指定咗項目所需嘅依賴同版本嘅要求,話畀Cargo知邊啲版本嘅依賴關係同嗰個包兼容。Cargo預設喺crates.io入面獲取依賴,但Git倉庫同埋本地文件系統入面嘅包都可以作為依賴。[12]
參考
[編輯]- ↑ "Announcing Rust 1.83.0" (英文). 2024年11月28號. 喺2024年11月28號搵到.
- ↑ "Rust Platform Support". 原著喺2018-02-13歸檔. 喺2017-03-17搵到.
- ↑ "COPYRIGHT". Rust compiler source repository. 喺2012-12-17搵到.
- ↑ 4.00 4.01 4.02 4.03 4.04 4.05 4.06 4.07 4.08 4.09 4.10 4.11 4.12 4.13 4.14 "The Rust Reference: Appendix: Influences". 原先內容歸檔喺2015-03-26. 喺2015-03-25搵到.
Rust is not a particularly original language, with design elements coming from a wide range of sources. Some of these are listed below (including elements that have since been removed): SML, OCaml [...] C++ [...] ML Kit, Cyclone [...] Haskell [...] Newsqueak, Alef, Limbo [...] Erlang [...] Swift [...] Scheme [...] C# [...] Ruby [...] NIL, Hermes
- ↑ "Note Research: Type System". 2015-02-01. 原先內容歸檔喺2019-02-17. 喺2015-03-25搵到.
Papers that have had more or less influence on Rust, or which one might want to consult for inspiration or to understand Rust's background. [...] Region based memory management in Cyclone [...] Safe memory management in Cyclone
- ↑ "RFC for `if let` expression". 原先內容歸檔喺2016-03-04. 喺2014-12-04搵到.
The `if let` construct is based on the precedent set by Swift, which introduced its own `if let` statement.
- ↑ "Discussion - Patterns and Records". 2015-03-25. 原先內容歸檔喺2015-08-19. 喺2015-03-25搵到.
Sources of Inspiration: [...] Rust
- ↑ "Command Optimizations?". 2014-06-26. 原先內容歸檔喺2019-07-08. 喺2014-12-10搵到.
I just added the outline of a Result library that lets you use richer error messages. It's like Either except the names are more helpful. The names are inspired by Rust's Result library.
- ↑ "Uniqueness Types". 2014-08-22. 原著喺2014-12-25歸檔. 喺2014-10-27搵到.
They are inspired by linear types, Uniqueness Types in the Clean programming language, and ownership types and borrowed pointers in the Rust programming language.
- ↑ Lattner, Chris (2014-06-03). "Chris Lattner's Homepage". Chris Lattner. 原先內容歸檔喺2018-12-25. 喺2014-06-03搵到.
The Swift language is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas, and an incredibly important internal dogfooding group who provided feedback to help refine and battle-test ideas. Of course, it also greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list.
- ↑ "Why Cargo Exists - The Cargo Book". doc.rust-lang.org. 喺2022-02-01搵到.
- ↑ "Specifying Dependencies - The Cargo Book". doc.rust-lang.org. 喺2022-02-01搵到.