|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "One year of Rust" |
| 4 | +author: Aaron Turon |
| 5 | +description: "Rust's trajectory one year after 1.0" |
| 6 | +--- |
| 7 | + |
| 8 | +Rust is a language that gives you: |
| 9 | + |
| 10 | +- uncompromising performance and control; |
| 11 | +- prevention of entire categories of bugs, including [classic concurrency pitfalls]; |
| 12 | +- ergonomics that often rival languages like [Python] and [Ruby]. |
| 13 | + |
| 14 | +It's a language for writing highly reliable, screamingly fast software—and |
| 15 | +having fun doing it. |
| 16 | + |
| 17 | +[classic concurrency pitfalls]: http://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.html |
| 18 | +[Python]: http://lucumr.pocoo.org/2015/5/27/rust-for-pythonistas/ |
| 19 | +[Ruby]: http://diesel.rs/ |
| 20 | + |
| 21 | +And yesterday, Rust turned one year old. |
| 22 | + |
| 23 | +### Rust in numbers |
| 24 | + |
| 25 | +A lot has happened in the last 365 days: |
| 26 | + |
| 27 | +- 11,894 [commits] by 702 contributors added to the core repository; |
| 28 | +- 88 [RFCs] merged; |
| 29 | +- 18 compiler targets introduced; |
| 30 | +- 9 releases shipped; |
| 31 | +- 1 year of [stability delivered]. |
| 32 | + |
| 33 | +On an **average week** this year, the Rust community merged two RFCs and |
| 34 | +published 53 brand new [crates]. Not a single day went by without at least one |
| 35 | +new Rust library hitting the central package manager. And Rust topped the |
| 36 | +"[most loved] language" in this year's StackOverflow survey. |
| 37 | + |
| 38 | +> Speaking of numbers: we recently launched a [survey] of our own, and want to |
| 39 | +> hear from you whether you are an old hat at Rust, or have never used it. |
| 40 | +
|
| 41 | +One place where our numbers are not where we want them to be: community |
| 42 | +diversity. We've had ongoing local outreach efforts, but the Rust community team |
| 43 | +will soon be launching a coordinated, global effort following the [Bridge] model |
| 44 | +(e.g. RailsBridge). If you want to get involved, or have other ideas for |
| 45 | +outreach, please let [the community team] know. |
| 46 | + |
| 47 | +[survey]: http://blog.rust-lang.org/2016/05/09/survey.html |
| 48 | + |
| 49 | +[most loved]: https://stackoverflow.com/research/developer-survey-2016 |
| 50 | + |
| 51 | +[commits]: https://github.com/rust-lang/rust/commits/master |
| 52 | +[RFCs]: https://github.com/rust-lang/rfcs |
| 53 | +[stability delivered]: http://blog.rust-lang.org/2014/10/30/Stability.html |
| 54 | +[crates]: https://crates.io/ |
| 55 | + |
| 56 | +[Bridge]: http://bridgefoundry.org/ |
| 57 | +[the community team]: mailto:[email protected] |
| 58 | + |
| 59 | +### Rust in production |
| 60 | + |
| 61 | +This year saw more companies [betting on Rust]. Each one has a story, but two |
| 62 | +particularly resonated. |
| 63 | + |
| 64 | +[betting on Rust]: https://www.rust-lang.org/friends.html |
| 65 | + |
| 66 | +First, there's Dropbox. For the last several years, the company has been |
| 67 | +secretively working on a move |
| 68 | +[away from AWS and onto its own infrastructure][dropbox]. The move, which is now |
| 69 | +complete, included developing custom-build hardware and the software to drive |
| 70 | +it. While much of Dropbox's back-end infrastructure is historically written in |
| 71 | +Go, for some key components the memory footprint and lack of control stood in |
| 72 | +the way of achieving the server utilization they were striving for. They rewrote |
| 73 | +those components in Rust. In the [words of Jamie Turner][dropbox quote], a lead |
| 74 | +engineer for the project, "the advantages of Rust are many: really powerful |
| 75 | +abstractions, no null, no segfaults, no leaks, yet C-like performance and |
| 76 | +control over memory." |
| 77 | + |
| 78 | +[dropbox]: http://www.wired.com/2016/03/epic-story-dropboxs-exodus-amazon-cloud-empire/ |
| 79 | +[dropbox quote]: https://news.ycombinator.com/item?id=11283688 |
| 80 | + |
| 81 | +Second, there's Mozilla. They've long been developing [Servo] as a research |
| 82 | +browser engine in Rust, but their first *production* Rust code shipped through a |
| 83 | +different vehicle: Firefox. In Firefox 45, without any fanfare, Rust code for |
| 84 | +[mp4 metadata parsing] went out to OSX and 64-bit Linux users; it will hit |
| 85 | +Windows in version 48. The code is currently running in test mode, with its |
| 86 | +results compared against the legacy C++ library: 100% correctness on |
| 87 | +[1 billion reported executions]. But this code is just the tip of the iceberg: |
| 88 | +after laying a lot of [groundwork for Rust integration], Firefox is poised to |
| 89 | +bring in significant amounts of new Rust code, including components from |
| 90 | +Servo—and not just in test mode. |
| 91 | + |
| 92 | +[Servo]: https://github.com/servo/servo/ |
| 93 | +[mp4 metadata parsing]: https://github.com/mozilla/mp4parse-rust |
| 94 | +[1 billion reported executions]: https://telemetry.mozilla.org/new-pipeline/dist.html#!cumulative=0&end_date=2016-04-07&keys=__none__!__none__!__none__&max_channel_version=release%252F45&measure=MEDIA_RUST_MP4PARSE_SUCCESS&min_channel_version=null&product=Firefox&sanitize=1&sort_keys=submissions&start_date=2016-03-03&table=0&trim=1&use_submission_date=0 |
| 95 | +[groundwork for Rust integration]: http://wiki.mozilla.org/Oxidation |
| 96 | + |
| 97 | +In both of these cases, the people involved were hardened C++ devs who knew its |
| 98 | +downsides—and Rust's upsides—in their bones. But there's another |
| 99 | +kind of story we [hear a lot] from smaller shops putting Rust into production: |
| 100 | +that they would never dream of shipping C++ code, but that Rust provides the |
| 101 | +leverage to go head-to-head with larger organizations that *do* use C++, giving |
| 102 | +them competitive performance and much greater agility. Rust helps you punch |
| 103 | +above your weight. |
| 104 | + |
| 105 | +[hear a lot]: http://confreaks.tv/videos/rustcamp2015-using-rust-from-c-or-any-language |
| 106 | + |
| 107 | +These are just a few stories of Rust in production, but we'd love to [hear yours]! |
| 108 | + |
| 109 | +[hear yours]: https://github.com/rust-lang/rust-www/issues/new?title=New+Website+Logo%3A+[insert+name]%0A&body=To+list+your+organization%27s+logo+on+the+Rust+website%2C+fill+out+the+following+information+and+click+%22submit+new+issue%22.+Alternately%2C+you+may+edit+_data%2Fusers.yml+as+described+therein+and+submit+a+pull+request.%0D%0A%0D%0A-+Organization+name%3A+%28as+you+want+it+displayed%29%0D%0A-+Homepage+url%3A+%28homepage%2Fprimary+entry+point+for+users%29%0D%0A-+Logo+url%3A+%28svg+if+possible%2C+pngs+over+400x200px+with+transparent+backgrounds+are+also+acceptable%29%0D%0A-+How+you+are+using+Rust%3A+%28one+sentence+describing+your+use+of+Rust%29%0D%0A-+Url+describing+Rust+usage%3A+%28optional+link+to+e.g.+blog+post+explaining+how+you+use+Rust%29%0D%0A-+Organization+contact%3A+%28name+and+email.+we+may+contact+you+when+updating+this+page.+alternately+you+may+email+this+information+to+user-logos%40rust-lang.org+and+it+will+be+kept+secret%29.%0D%0A |
| 110 | + |
| 111 | +### Rust, improved |
| 112 | + |
| 113 | +Of course, Rust itself hasn't been standing still. The focus in its first year |
| 114 | +has been growing and polishing its ecosystem and tooling: |
| 115 | + |
| 116 | +- **Ecosystem**. The standard library has steadily expanded, with growth focused |
| 117 | + on [filesystem access], [networking], [time], and [collections] APIs—and |
| 118 | + dramatically better documentation coverage. There's good support for working |
| 119 | + with C libraries via the [libc], [winapi], and [gcc] crates. And new libraries |
| 120 | + for [low-level async io][mio], [easy parallelism][rayon], |
| 121 | + [lock-free data structures][crossbeam], |
| 122 | + [Rails-like object-relational mapping][diesel], [regular expressions][regex], |
| 123 | + and several [parsing][nom] [libraries][lalrpop], including [html5ever], a |
| 124 | + unique HTML5 parser that leverages Rust's macro system to make the code |
| 125 | + resemble the spec as closely as possible. These are just scratching the |
| 126 | + surface, of course, and ecosystem growth, curation and |
| 127 | + coherence—particularly around async IO and the web stack—will |
| 128 | + continue to be a major focus in the coming year. |
| 129 | + |
| 130 | +[filesystem access]: http://static.rust-lang.org/doc/master/std/fs/index.html |
| 131 | +[networking]: http://static.rust-lang.org/doc/master/std/net/index.html |
| 132 | +[time]: http://static.rust-lang.org/doc/master/std/time/index.html |
| 133 | +[collections]: http://static.rust-lang.org/doc/master/std/collections/index.html |
| 134 | +[libc]: https://github.com/rust-lang/libc |
| 135 | +[winapi]: https://github.com/retep998/winapi-rs |
| 136 | +[gcc]: https://github.com/alexcrichton/gcc-rs |
| 137 | +[mio]: https://github.com/carllerche/mio/ |
| 138 | +[rayon]: http://smallcultfollowing.com/babysteps/blog/2015/12/18/rayon-data-parallelism-in-rust/ |
| 139 | +[crossbeam]: http://aturon.github.io/blog/2015/08/27/epoch/ |
| 140 | +[regex]: https://github.com/rust-lang-nursery/regex |
| 141 | +[diesel]: http://diesel.rs/ |
| 142 | +[nom]: https://github.com/Geal/nom |
| 143 | +[lalrpop]: http://smallcultfollowing.com/babysteps/blog/2015/09/14/lalrpop/ |
| 144 | +[html5ever]: https://kmcallister.github.io/talks/rust/2014-rust-macros/slides.html |
| 145 | + |
| 146 | +- **Platforms and targets**. Rust's footprint is not much bigger than C's, which |
| 147 | + makes it ideal for using in all kinds of places. Over the last year, Rust |
| 148 | + gained the ability to work directly with the native [MSVC toolchain] on |
| 149 | + Windows, to target [musl] (thereby creating a binary that can be used with |
| 150 | + zero dependencies on *any* variety of Linux), to target Android and ARM |
| 151 | + devices, and [many more platforms][platforms]. The new [rustup tool] makes it |
| 152 | + a breeze to manage and compile to these various targets. As of |
| 153 | + [Rust 1.6][no_std], you can use Rust without its full standard library, |
| 154 | + limiting to a core library that does not require any OS services (and hence is |
| 155 | + suitable for [writing OSes](http://os.phil-opp.com/) |
| 156 | + [in Rust][intermezzos]). Finally, there are an increasing number of libraries |
| 157 | + for embedding Rust code into other contexts, like [node.js][neon], |
| 158 | + [Ruby][helix] and [Go][rure-go]. |
| 159 | + |
| 160 | +[MSVC toolchain]: https://github.com/rust-lang/rust/pull/25350 |
| 161 | +[MUSL]: https://www.musl-libc.org/ |
| 162 | +[platforms]: https://forge.rust-lang.org/platform-support.html |
| 163 | +[rustup tool]: http://blog.rust-lang.org/2016/05/13/rustup.html |
| 164 | +[no_std]: http://blog.rust-lang.org/2016/01/21/Rust-1.6.html |
| 165 | +[intermezzos]: https://intermezzos.github.io/ |
| 166 | +[neon]: http://calculist.org/blog/2015/12/23/neon-node-rust/ |
| 167 | +[helix]: http://blog.skylight.io/introducing-helix/ |
| 168 | +[rure-go]: https://github.com/BurntSushi/rure-go |
| 169 | + |
| 170 | +- **Tools**. Because Rust looks just like C on the outside, it's instantly |
| 171 | + usable with a wide range of existing tools; it works out of the box with |
| 172 | + [lldb], [gdb], [perf], [valgrind], [callgrind], and many, many more. Our |
| 173 | + focus has been to [enrich the experience] for these tools by adding |
| 174 | + [Rust-specific hooks][gdb] and [workflows][cargo profile]. Another major |
| 175 | + priority is providing full IDE support, in part by providing daemonized |
| 176 | + services from the compiler; we made [good progress][IDEs] on that front this |
| 177 | + year, and thanks to the [Racer] project, [numerous IDE plugins] are already |
| 178 | + providing some semantic support for Rust. At the same time, the [rustfmt] code |
| 179 | + formatting tool has matured to the point that the Rust community is ready to |
| 180 | + produce an [official style]. And the beating heart of Rust's workflow, |
| 181 | + [Cargo], gained numerous abilities this year, most notably the |
| 182 | + [install subcommand]. |
| 183 | + |
| 184 | +[lldb]: http://lldb.llvm.org/ |
| 185 | +[gdb]: https://www.gnu.org/software/gdb/ |
| 186 | +[perf]: https://perf.wiki.kernel.org/index.php/Main_Page |
| 187 | +[valgrind]: http://valgrind.org/ |
| 188 | +[callgrind]: https://kcachegrind.github.io/html/Home.html |
| 189 | +[enrich the experience]: https://michaelwoerister.github.io/2015/03/27/rust-xxdb.html |
| 190 | +[gdb]: https://sourceware.org/ml/gdb-patches/2016-04/msg00570.html |
| 191 | +[cargo profile]: http://www.suchin.co/2016/05/11/Introducing-Cargo-Profiler/ |
| 192 | +[IDEs]: https://www.rust-lang.org/ides.html |
| 193 | +[Racer]: https://github.com/phildawes/racer |
| 194 | +[numerous IDE plugins]: https://areweideyet.com/ |
| 195 | +[rustfmt]: https://github.com/rust-lang-nursery/rustfmt |
| 196 | +[official style]: https://github.com/rust-lang/rfcs/pull/1607 |
| 197 | +[Cargo]: http://blog.rust-lang.org/2016/05/05/cargo-pillars.html |
| 198 | +[install subcommand]: http://blog.rust-lang.org/2015/12/10/Rust-1.5.html |
| 199 | + |
| 200 | +- **Compiler**. We've seen some [across-the-board improvements] to compile |
| 201 | + times, and now offer [parallelized code generation][parallel codegen] for |
| 202 | + further speedups. But the biggest wins will come from the ongoing work on |
| 203 | + [incremental compilation], which will minimize the amount of work the needed |
| 204 | + when recompiling code after editing it. A vital step here was the move to a |
| 205 | + [custom intermediate representation][MIR], which has many other benefits as |
| 206 | + well. Another focus has been errors, including |
| 207 | + [detailed explanations of most errors][error index], and ongoing work to |
| 208 | + [improve the clarity and focus of errors][error format]. Expect to hear more |
| 209 | + on both fronts soon. |
| 210 | + |
| 211 | +[across-the-board improvements]: http://blog.rust-lang.org/2015/06/25/Rust-1.1.html |
| 212 | +[parallel codegen]: http://blog.rust-lang.org/2015/08/06/Rust-1.2.html |
| 213 | +[incremental compilation]: https://github.com/rust-lang/rfcs/pull/1298 |
| 214 | +[MIR]: http://blog.rust-lang.org/2016/04/19/MIR.html |
| 215 | +[error index]: https://doc.rust-lang.org/error-index.html |
| 216 | +[error format]: https://internals.rust-lang.org/t/new-error-format/3438 |
| 217 | + |
| 218 | +- **Core language**. We've kept one list purposefully short this year: growth in |
| 219 | + the core language. While we have some important features in the pipeline (like |
| 220 | + [more flexible borrowing rules] and [specialization]), [Rust users] by and |
| 221 | + large are happy with the core language and prefer the community to focus on |
| 222 | + the ecosystem and tooling. |
| 223 | + |
| 224 | +[Rust users]: https://internals.rust-lang.org/t/production-user-research-summary/2530 |
| 225 | +[more flexible borrowing rules]: http://smallcultfollowing.com/babysteps/blog/2016/04/27/non-lexical-lifetimes-introduction/ |
| 226 | +[specialization]: https://github.com/rust-lang/rfcs/pull/1210 |
| 227 | + |
| 228 | +There's a lot more to say about what's happened and what's coming up in the Rust |
| 229 | +world—over the coming months, we'll be using this blog to say it. |
| 230 | + |
| 231 | +### Rust in community |
| 232 | + |
| 233 | +It turns out that people like to get together and talk Rust: |
| 234 | + |
| 235 | +- August 2015: a sold-out [RustCamp]; |
| 236 | +- September 9-10, 2016: the first [RustConf] in Portland, OR, USA; |
| 237 | +- September 17, 2016: [RustFest], the European community conference, in Berlin, Germany; |
| 238 | +- October 27-18, 2016: [Rust Belt Rust], a Rust conference in Pittsburgh, PA, USA; |
| 239 | +- 71 Rust-related [meetup] groups worldwide. |
| 240 | + |
| 241 | +[RustCamp]: http://rustcamp.com/ |
| 242 | +[RustConf]: http://rustconf.com/ |
| 243 | +[RustFest]: http://www.rustfest.eu/blog/happy-birthday-announcing-rustfest |
| 244 | +[Rust Belt Rust]: http://rust-belt-rust.com/ |
| 245 | +[meetup]: http://rust.meetup.com/ |
| 246 | + |
| 247 | +And that's no surprise. From a personal perspective, the best part about working |
| 248 | +with Rust is its [community]. It's hard to explain quite what it's like to be |
| 249 | +part of this group, but two things stand out. First, its sheer *energy*: so much |
| 250 | +happens in any given week that [This Week in Rust] is a vital resource for |
| 251 | +anyone hoping to keep up. Second, its *welcoming spirit*. Rust's core message is |
| 252 | +one of empowerment—you can write systems code even if you would never have |
| 253 | +dared write C++—and that's reflected in the community. We're all here to |
| 254 | +learn how to be better programmers, and support each other in doing so. |
| 255 | + |
| 256 | +[This Week in Rust]: https://this-week-in-rust.org/ |
| 257 | +[community]: https://www.rust-lang.org/community.html |
| 258 | + |
| 259 | +There's never been a better time to get started with Rust, whether through |
| 260 | +attending a local [meetup], saying hello in the [users forum], watching |
| 261 | +[a talk], or reading [the book]. No matter how you find your way in, we'll be |
| 262 | +glad to have you. |
| 263 | + |
| 264 | +[users forum]: https://users.rust-lang.org/ |
| 265 | +[a talk]: http://www.infoq.com/presentations/rust-thread-safety |
| 266 | +[the book]: https://doc.rust-lang.org/book/ |
| 267 | + |
| 268 | +Happy birthday, Rust! |
0 commit comments