Content deleted Content added
Update no_mangle attribute for modern Rust (it's been this way for years) |
link style |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 68:
}}
'''Rust''' is a [[General-purpose programming language|general-purpose]] [[programming language]]. It is noted
Rust supports multiple [[programming paradigm]]s. It was influenced by ideas from [[functional programming]], including [[Immutable object|immutability]], [[higher-order function]]s, [[algebraic data type]]s, and [[pattern matching]]. It also supports [[object-oriented programming]] via structs, [[Union type|enums]], traits, and methods. Rust is noted for enforcing memory safety (i.e., that all [[Reference (computer science)|references]] point to valid memory) without a conventional [[Garbage collection (computer science)|garbage collector]]; instead, memory safety errors and [[data race]]s are prevented by the "borrow checker", which tracks the [[object lifetime]] of references [[Compiler|at compile time]].
Software developer Graydon Hoare created Rust
Rust has been noted for its adoption in many software projects, especially [[web
==Etymology==
Rust was named for the [[Rust (fungus)|group of fungi]] that are "over-engineered for survival".<ref name="MITTechReview"/>
The Rust logo was developed in 2011 based on a bicycle [[Crankset#Chainring|chainring]].<ref>{{cite web |title=Rust logo |url=https://bugzilla.mozilla.org/show_bug.cgi?id=680521 |website=[[Bugzilla]] |access-date=2 February 2024 |archive-date=2024-02-02 |archive-url=https://web.archive.org/web/20240202045212/https://bugzilla.mozilla.org/show_bug.cgi?id=680521 |url-status=live }}</ref>
== History ==
=== 2006–2009: Early years ===
[[File:MozillaCaliforniaHeadquarters.JPG|thumb|right|Mozilla Foundation headquarters, 650 Castro Street in [[Mountain View, California]], June 2009]]
Rust began as a personal project by [[Mozilla]] employee Graydon Hoare in 2006.<ref name="MITTechReview">{{cite web |url=https://www.technologyreview.com/2023/02/14/1067869/rust-worlds-fastest-growing-programming-language/ |title=How Rust went from a side project to the world's most-loved programming language |last=Thompson |first=Clive |date=2023-02-14 |website=MIT Technology Review |language=en |access-date=2023-02-23 |archive-date=2024-09-19 |archive-url=https://web.archive.org/web/20240919102849/https://www.technologyreview.com/2023/02/14/1067869/rust-worlds-fastest-growing-programming-language/ |url-status=live }}</ref> Hoare started the project due to his frustration with a broken elevator in his apartment building.<ref name="MITTechReview"/>
During the early years, the Rust [[compiler]] was written in about 38,000 lines of [[OCaml]].<ref name=Klabnik2016ACMHistory/>{{rp|at=15:34}}<ref name=OCamlCompiler>{{Cite web |last=Hoare |first=Graydon |title=Rust Prehistory (Archive of the original Rust OCaml compiler source code) |website=[[GitHub]] |date=November 2016 |url=https://github.com/graydon/rust-prehistory/tree/master |access-date=2024-10-29 }}</ref> Early Rust contained features such as explicit [[object-oriented programming]] via an {{code|obj}} keyword (later removed),<ref name=Klabnik2016ACMHistory/>{{rp|at=10:08}} and a [[typestate analysis|typestates]] system that would allow variables of a type to be tracked along with state changes (such as going from uninitialized to initialized, also removed).<ref name=Klabnik2016ACMHistory/>{{rp|at=13:12}}
=== 2009–2012: Mozilla sponsorship ===
Mozilla officially sponsored the Rust project in 2009.<ref name="MITTechReview"/> [[Brendan Eich]] and other executives, intrigued by the possibility of using Rust for a safe [[web browser]] [[browser engine|engine]], placed engineers on the project including Patrick Walton, Niko Matsakis, Felix Klock, and Manish Goregaokar.<ref name="MITTechReview"/> A conference room taken by the project developers was dubbed "the nerd cave," with a sign placed outside the door.<ref name="MITTechReview"/>
During this time period, work had shifted from the initial OCaml compiler to a [[Self-hosting (compilers)|self-hosting compiler]], ''i.e.'', written in Rust, based on [[LLVM]].<ref name=Rust0.1>{{Cite web |title=0.1 first supported public release Milestone · rust-lang/rust |url=https://github.com/rust-lang/rust/milestone/3?closed=1 |access-date=2024-10-29 |website=[[GitHub]] |language=en}}</ref>{{refn|group=note|The list of Rust compiler versions (referred to as a bootstrapping chain) has history going back to 2012.<ref name=Nelson2022RustConf>{{Cite AV media |url=https://www.youtube.com/watch?v=oUIjG-y4zaA |last=Nelson |first=Jynn |title=RustConf 2022 - Bootstrapping: The once and future compiler |publisher=Rust Team |date=2022-08-05 |access-date=2024-10-29 |___location=Portland, Oregon |via=YouTube}}</ref>}} The Rust ownership system was also in place by 2010.<ref name="MITTechReview"/>
The first public release, Rust 0.1, was released on January 20, 2012<ref name=Rust0.1a>{{Cite mailing list |last=Anderson |first=Brian |date=2012-01-24 |title=[rust-dev] The Rust compiler 0.1 is unleashed |url=https://mail.mozilla.org/pipermail/rust-dev/2012-January/001256.html |mailing-list=rust-dev |access-date=2025-01-07 |archive-url=https://web.archive.org/web/20120124160628/https://mail.mozilla.org/pipermail/rust-dev/2012-January/001256.html |archive-date=January 24, 2012 }}</ref> for Windows, Linux, and MacOS.<ref name=ExtremeTechRust0.1>{{Cite web |last=Anthony |first=Sebastian |date=2012-01-24 |title=Mozilla releases Rust 0.1, the language that will eventually usurp Firefox's C++ |url=https://www.extremetech.com/internet/115207-mozilla-releases-rust-0-1-the-language-that-will-eventually-usurp-firefoxs-c |access-date=2025-01-07 |website=ExtremeTech |language=en}}</ref> The early 2010s saw increasing involvement from open source volunteers outside of Mozilla and outside of the United States. At Mozilla, executives would eventually employ over a dozen engineers to work on Rust full time over the next decade.<ref name="MITTechReview"/>
=== 2012–2015: Evolution ===
The years from 2012 to 2015 were marked by substantial changes to the Rust [[type system]],
According to Rust
Graydon Hoare stepped down from Rust in 2013.<ref name="MITTechReview"/>
According to Andrew Binstock writing for ''[[Dr. Dobb's Journal]]'' in January 2014, while Rust was "widely viewed as a remarkably elegant language", adoption slowed because it radically changed from version to version.<ref>{{cite news |last=Binstock |first=Andrew |date=January 7, 2014 |title=The Rise And Fall of Languages in 2013 |website=[[Dr. Dobb's Journal]] |url=https://www.drdobbs.com/jvm/the-rise-and-fall-of-languages-in-2013/240165192 |url-status=dead |archive-url=https://web.archive.org/web/20160807075745/http://www.drdobbs.com/jvm/the-rise-and-fall-of-languages-in-2013/240165192 |archive-date=2016-08-07 |access-date=2022-11-20}}</ref> Rust development at this time was focused on finalizing the language features and moving towards 1.0 so it could begin promising [[backward compatibility]].<ref name=Klabnik2016ACMHistory/>{{rp|at=41:26}}
Line 108 ⟶ 111:
The development of the [[Servo (software)|Servo browser engine]] continued in parallel with Rust, jointly funded by Mozilla and [[Samsung]].<ref>{{cite news|last=Lardinois|first=Frederic|date=2015-04-03|title=Mozilla And Samsung Team Up To Develop Servo, Mozilla's Next-Gen Browser Engine For Multicore Processors|work=[[TechCrunch]]|url=https://techcrunch.com/2013/04/03/mozilla-and-samsung-collaborate-on-servo-mozillas-next-gen-browser-engine-for-tomorrows-multicore-processors/|access-date=2017-06-25|archive-date=2016-09-10|archive-url=https://web.archive.org/web/20160910211537/https://techcrunch.com/2013/04/03/mozilla-and-samsung-collaborate-on-servo-mozillas-next-gen-browser-engine-for-tomorrows-multicore-processors/|url-status=live}}</ref> The teams behind the two projects worked in close collaboration; new features in Rust were tested out by the Servo team, and new features in Servo were used to give feedback back to the Rust team.<ref name=Klabnik2016ACMHistory/>{{rp|at=5:41}} The first version of Servo was released in 2016.<ref name="MITTechReview"/> The [[Firefox]] web browser shipped with Rust code as of 2016 (version 45),<ref name=Klabnik2016ACMHistory/>{{rp|at=53:30}}<ref>{{Cite web |title=Firefox 45.0, See All New Features, Updates and Fixes |url=https://www.mozilla.org/en-US/firefox/45.0/releasenotes/ |access-date=2024-10-31 |website=Mozilla |language=en |archive-date=2016-03-17 |archive-url=https://web.archive.org/web/20160317215950/https://www.mozilla.org/en-US/firefox/45.0/releasenotes/ |url-status=live }}</ref> but components of Servo did not appear in Firefox until September 2017 (version 57) as part of the [[Gecko (software)|Gecko]] and [[Gecko (software)#Quantum|Quantum]] projects.<ref>{{Cite web |last=Lardinois |first=Frederic |date=2017-09-29 |title=It's time to give Firefox another chance |url=https://techcrunch.com/2017/09/29/its-time-to-give-firefox-another-chance/ |access-date=2023-08-15 |website=[[TechCrunch]] |language=en-US |archive-date=2023-08-15 |archive-url=https://web.archive.org/web/20230815025149/https://techcrunch.com/2017/09/29/its-time-to-give-firefox-another-chance/ |url-status=live }}</ref>
Improvements were made to the Rust toolchain ecosystem during the years following 1.0 including [[#Rustfmt|Rustfmt]], [[integrated development environment]] integration,<ref name=Klabnik2016ACMHistory/>{{rp|at=44:56}} and a regular compiler testing and release cycle
The earliest known adoption outside of Mozilla was by individual projects at Samsung, [[Facebook]] (now [[Meta Platforms]]), [[Dropbox]], and
=== 2020–present: Mozilla layoffs and Rust Foundation ===
In August 2020, Mozilla laid off 250 of its 1,000 employees worldwide, as part of a corporate restructuring caused by the [[COVID-19 pandemic]].<ref>{{cite web |url=https://www.zdnet.com/article/mozilla-lays-off-250-employees-while-it-refocuses-on-commercial-products/ |title=Mozilla lays off 250 employees while it refocuses on commercial products |last=Cimpanu |first=Catalin |website=[[ZDNET]] |access-date=2020-12-02 |date=2020-08-11 |archive-date=March 18, 2022 |archive-url=https://web.archive.org/web/20220318025804/https://www.zdnet.com/article/mozilla-lays-off-250-employees-while-it-refocuses-on-commercial-products/ |url-status=live}}</ref><ref>{{cite web |url=https://www.engadget.com/mozilla-firefox-250-employees-layoffs-151324924.html |title=Mozilla lays off 250 employees due to the pandemic |website=[[Engadget]] |last=Cooper |first=Daniel |access-date=2020-12-02 |date=2020-08-11 |archive-date=2020-12-13 |archive-url=https://web.archive.org/web/20201213020220/https://www.engadget.com/mozilla-firefox-250-employees-layoffs-151324924.html |url-status=live}}</ref> The team behind Servo was disbanded. The event raised concerns about the future of Rust
On February 8, 2021, the formation of the [[#Rust Foundation|Rust Foundation]] was announced by five founding companies: [[Amazon Web Services]], [[Google]], [[Huawei]], [[Microsoft]], and [[Mozilla]].<ref>{{Cite web |date=2020-02-08 |title=Hello World! |url=https://foundation.rust-lang.org/news/2021-02-08-hello-world/ |access-date=2022-06-04 |website=Rust Foundation |language=en |archive-date=April 19, 2022 |archive-url=https://web.archive.org/web/20220419124635/https://foundation.rust-lang.org/news/2021-02-08-hello-world/ |url-status=live}}</ref><ref>{{Cite web|date=2021-02-09|title=Mozilla Welcomes the Rust Foundation |website=Mozilla Blog |url=https://blog.mozilla.org/blog/2021/02/08/mozilla-welcomes-the-rust-foundation |archive-url=https://web.archive.org/web/20210208212031/https://blog.mozilla.org/blog/2021/02/08/mozilla-welcomes-the-rust-foundation/|archive-date=2021-02-08|access-date=2021-02-09|url-status=live}}</ref> The foundation, led by Shane Miller for its first two years, offered $20,000 grants and other support for programmers working on major Rust features.<ref name="MITTechReview"/> In a [[blog]] post published on April 6, 2021, Google announced support for Rust within the [[Android Open Source Project]] as an alternative to C/C++.<ref>{{Cite web|last=Amadeo|first=Ron|date=2021-04-07 |title=Google is now writing low-level Android code in Rust |url=https://arstechnica.com/gadgets/2021/04/google-is-now-writing-low-level-android-code-in-rust/ |access-date=2021-04-08|website=Ars Technica|language=en-us|archive-date=2021-04-08|archive-url=https://web.archive.org/web/20210408001446/https://arstechnica.com/gadgets/2021/04/google-is-now-writing-low-level-android-code-in-rust/|url-status=live}}</ref>
On November 22, 2021, the Moderation Team, which was responsible for enforcing the community code of conduct, announced their resignation "in protest of the Core Team placing themselves unaccountable to anyone but themselves".<ref name="moderation">{{Cite news |first=Tim |last=Anderson |title=Entire Rust moderation team resigns |url=https://www.theregister.com/2021/11/23/rust_moderation_team_quits/ |date=2021-11-23 |access-date=2022-08-04 |website=[[The Register]] |language=en |archive-date=2022-07-14 |archive-url=https://web.archive.org/web/20220714093245/https://www.theregister.com/2021/11/23/rust_moderation_team_quits/ |url-status=live }}</ref> In May 2022, the Rust Core Team, other lead programmers, and
The Rust Foundation posted a draft for a new trademark policy on April 6, 2023
On February 26, 2024, the U.S. [[White House]]
== Syntax and features ==
|