Rust

出自維基百科,自由嘅百科全書
跳去導覽 跳去搵嘢
Rust
Rust programming language black logo.svg
編程範式編譯語言並行計算
函數式指令式
物件導向結構化
設計者Graydon Hoare
編程員Mozilla
第一次出現2010年
穩定版本
1.62.0[1] 喺維基數據度改 / 2022年6月30號,38個鐘頭之前
類型系統靜態類型強型別
類型推論結構類型英文Structural type system
操作系統LinuxmacOSWindows
FreeBSDAndroidiOS[2]
軟件授權Apache許可證2.0及MIT許可證[3]
副檔名.rs、.rlib
網站rust-lang.org
啟發語言
Alef英文Alef (programming language)[4]C#[4]C++[4]Cyclone英文Cyclone (programming language)[4][5]
Erlang[4]Haskell[4]Hermes英文Hermes (programming language)[4]Limbo[4]
Newsqueak[4]NIL英文NIL (programming language)[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]

參考[編輯]

  1. "Announcing Rust 1.62.0 (English)".
  2. "Rust Platform Support". 原著喺2018-02-13歸檔. 喺2017-03-17搵到.
  3. "COPYRIGHT". Rust compiler source repository. 喺2012-12-17搵到.
  4. 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
  5. "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
  6. "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.
  7. "Discussion - Patterns and Records". 2015-03-25. 原先內容歸檔喺2015-08-19. 喺2015-03-25搵到. Sources of Inspiration: [...] Rust
  8. "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.
  9. "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.
  10. 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.
  11. "Why Cargo Exists - The Cargo Book". doc.rust-lang.org. 喺2022-02-01搵到.
  12. "Specifying Dependencies - The Cargo Book". doc.rust-lang.org. 喺2022-02-01搵到.

出面網頁[編輯]