|
| 1 | +Title: This Week in Rust 56 |
| 2 | +Date: 2014-11-10 |
| 3 | +Category: This Week in Rust |
| 4 | + |
| 5 | +Hello and welcome to another issue of *This Week in Rust*! |
| 6 | +[Rust](http://rust-lang.org) is a systems language pursuing the trifecta: |
| 7 | +safe, concurrent, and fast. This is a weekly summary of its progress and |
| 8 | +community. Want something mentioned? [Send me an |
| 9 | +email! ](mailto:[email protected]?subject=This%20Week%20in%20Rust%20Suggestion) |
| 10 | +Want to get involved? [We love |
| 11 | +contributions](https://github.com/mozilla/rust/wiki/Note-guide-for-new-contributors). |
| 12 | + |
| 13 | +# What's cooking on master? |
| 14 | + |
| 15 | +101 pull requests were [merged in the last week][1]. Woo! |
| 16 | + |
| 17 | +[1]: https://github.com/rust-lang/rust/pulls?q=is%3Apr+is%3Amerged+updated%3A2014-11-03..2014-11-10 |
| 18 | + |
| 19 | +## Breaking Changes |
| 20 | + |
| 21 | +* [Flexible target specification][flex] has finally landed. This makes |
| 22 | + it much easier to create custom toolchains for unsupported |
| 23 | + platforms. [RFC][flex-rfc]. |
| 24 | +* [Error interoperation][err] improves the ergonomics of error |
| 25 | + handling when multiple error types are involved. [RFC][err-rfc]. |
| 26 | +* The `rtio` abstraction layer that supported I/O on green threads |
| 27 | + [has been removed][rtio]. [RFC][rtio-rfc]. |
| 28 | +* There has been a minor breaking change to the [serialization of |
| 29 | + tuples][tup]. |
| 30 | +* Minor [changes to macro interpolation][mac] have resulted the |
| 31 | + removal the `$foo:matchers` type of `macro_rules!` argument. |
| 32 | +* Socket construction is now more flexibly done through a |
| 33 | + [ToSocketAddr] type. |
| 34 | +* Some changes have been made to the [BytesContainer], which is used |
| 35 | + to construct `Path`s, causing breakage is some cases. |
| 36 | +* The comparision types have been [updated for DST][cmp], resulting in |
| 37 | + changes to how they are invoked for references to unsized types |
| 38 | + (i.e. `&str` and `&[T]`). |
| 39 | +* As part of the recent [collections overhaul][coll-rfc], the prelude |
| 40 | + now contains a [repeat] function that returns an iterator that |
| 41 | + repeatedly yields the same value. |
| 42 | +* Some changes to make [overloaded operators][ops] behave more |
| 43 | + consistently will cause some previous code to break. |
| 44 | +* The collections crate has seen [major refactorings][coll1] and |
| 45 | + [updates][coll2] as part of the [collections |
| 46 | + overhaul][coll-rfc]. There was additional discussion about the |
| 47 | + impact on [reddit][coll-reddit]. |
| 48 | +* The json crate [works with string slices instead of strings][json], |
| 49 | + and now overloads the index operator. |
| 50 | +* A number of prelude traits have been [renamed and consolidated][pre] |
| 51 | + as fallout from DST and to conform to new [conventions]. This should |
| 52 | + not break much code as these traits are rarely named explicitly. |
| 53 | +* The rlibc crate, which provides a few libc functions expected to |
| 54 | + exist by LLVM's code generation, and is only useful for freestanding |
| 55 | + Rust projects, has been [moved out of the main rust |
| 56 | + distribution][rlibc], and now must be [installed via |
| 57 | + cargo][rlibc-cargo]. |
| 58 | + |
| 59 | +[flex]: https://github.com/rust-lang/rust/pull/16156 |
| 60 | +[flex-rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0131-target-specification.md |
| 61 | +[err]: https://github.com/rust-lang/rust/pull/17753 |
| 62 | +[err-rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0201-error-chaining.md |
| 63 | +[tup]: https://github.com/rust-lang/rust/pull/17595 |
| 64 | +[mac]: https://github.com/rust-lang/rust/pull/17830 |
| 65 | +[ToSocketAddr]: https://github.com/rust-lang/rust/pull/18462 |
| 66 | +[BytesContainer]: https://github.com/rust-lang/rust/pull/18463 |
| 67 | +[cmp]: https://github.com/rust-lang/rust/pull/18467 |
| 68 | +[coll1]: https://github.com/rust-lang/rust/pull/18519 |
| 69 | +[coll2]: https://github.com/rust-lang/rust/pull/18605 |
| 70 | +[coll-rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0235-collections-conventions.md |
| 71 | +[coll-reddit]: https://www.reddit.com/r/rust/comments/2ljfnd/warning_some_collection_methods_have_had_their/ |
| 72 | +[repeat]: https://github.com/rust-lang/rust/pull/18468 |
| 73 | +[ops]: https://github.com/rust-lang/rust/pull/18486 |
| 74 | +[json]: https://github.com/rust-lang/rust/pull/18544 |
| 75 | +[pre]: https://github.com/rust-lang/rust/pull/18559 |
| 76 | +[rlibc]: https://github.com/rust-lang/rust/pull/18625 |
| 77 | +[rlibc-cargo]: https://github.com/rust-lang/rlibc |
| 78 | +[rtio]: https://github.com/rust-lang/rust/pull/18557 |
| 79 | +[rtio-rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0230-remove-runtime.md |
| 80 | + |
| 81 | +## Other Changes |
| 82 | + |
| 83 | +* New [blanket impls] of the unboxed closure types allow them to |
| 84 | + interoperate. See |
| 85 | + [test](https://github.com/rust-lang/rust/blob/master/src/test/run-pass/unboxed-closures-fn-as-fnmut-and-fnonce.rs) |
| 86 | + [cases](https://github.com/rust-lang/rust/blob/master/src/test/run-pass/unboxed-closures-fnmut-as-fnonce.rs) |
| 87 | + for examples. |
| 88 | +* impls can now be [defined on trait objects][impltrait]. |
| 89 | +* P1start has been [converting][help] compiler messages that provide |
| 90 | + suggestions from 'notes' to 'help' messages. |
| 91 | +* The ['exceeding_bitshifts'][bitshift] lint catches overlong shifts |
| 92 | + (which are currently undefined behavior) of static size. Due to |
| 93 | + [bugs][bitshift-bugs] it is set to 'allow' be default. |
| 94 | +* Ariel [removed][unsafe-rustc] a bunch of unsafe code from the |
| 95 | + compiler. Yay! |
| 96 | +* A new `-l` [flag] to the compiler has been added to specify linkage |
| 97 | + to native libraries, primarily for use by cargo. In the same PR, |
| 98 | + `include!` was updated to expand its arguments, allowing cargo to do |
| 99 | + for more complex compile-time code generation. [RFC][flag-rfc]. |
| 100 | +* `#![cfg]` and `#[cfg_attr]` [can be applied to crates][cfg]. |
| 101 | +* On x86 Linux, random number generation now [prefers] the new |
| 102 | + [`getrandom`] syscall. |
| 103 | + |
| 104 | +[blanket impls]: https://github.com/rust-lang/rust/pull/18388 |
| 105 | +[impltrait]: https://github.com/rust-lang/rust/pull/18447 |
| 106 | +[help]: https://github.com/rust-lang/rust/pull/18132 |
| 107 | +[bitshift]: https://github.com/rust-lang/rust/pull/18206 |
| 108 | +[bitshift-bugs]: https://github.com/rust-lang/rust/pull/18593 |
| 109 | +[unsafe-rustc]: https://github.com/rust-lang/rust/pull/18318 |
| 110 | +[flag]: https://github.com/rust-lang/rust/pull/18470 |
| 111 | +[flag-rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0403-cargo-build-command.md |
| 112 | +[cfg]: https://github.com/rust-lang/rust/pull/18634 |
| 113 | +[prefers]: https://github.com/rust-lang/rust/pull/18664 |
| 114 | +[getrandom]: http://lwn.net/Articles/606141/ |
| 115 | + |
| 116 | +## New Contributors |
| 117 | + |
| 118 | +* Cristi Burcă |
| 119 | +* juxiliary |
| 120 | +* Nathan Zadoks |
| 121 | +* qwitwa |
| 122 | +* Sean Jensen-Grey |
| 123 | +* Subhash Bhushan |
| 124 | +* thiagopnts |
| 125 | +* tshakah |
| 126 | +* Vitali Haravy |
| 127 | +* Vladimir Matveev |
| 128 | +* whataloadofwhat |
| 129 | + |
| 130 | +# Approved RFC's |
| 131 | +* [Num reform](https://github.com/rust-lang/rfcs/blob/master/text/0418-struct-variants.md): Strips down `std::num` to minimally support generic primitive numbers, without supporting a full mathematical hierarchy. |
| 132 | +* [Higher-ranked trait bounds](https://github.com/rust-lang/rfcs/blob/master/text/0387-higher-ranked-trait-bounds.md): Add the ability to have trait bounds that are polymorphic over lifetimes. Necessary for unboxed closures. |
| 133 | +* [un-feature-gating struct variants](https://github.com/rust-lang/rfcs/blob/master/text/0418-struct-variants.md): Woo! |
| 134 | +* [Multiple lifetime bounds](https://github.com/rust-lang/rfcs/blob/master/text/0192-bounds-on-object-and-generic-types.md): Removes special cases from the type system and allows more complex lifetime relationships to be expressed that were previously only inferable. |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | +# New RFC's |
| 139 | +* [Macro reform](https://github.com/rust-lang/rfcs/pull/453): Prepares macros for 1.0 stabilization. Renames `macro_rules!` to `macro!`, and introduces more robust support for module importing and exporting. |
| 140 | +* [Change integer fallback RFC to suggest `i32` instead of `int` as the fallback](https://github.com/rust-lang/rfcs/pull/452): Changes the fallback for performance and portability. |
| 141 | +* [Un-feature-gate if let and tuple indexing](https://github.com/rust-lang/rfcs/pull/450): The features are well-behaved and used by many projects; ship 'em! |
| 142 | +* [Prohibit unused type parameters in impls](https://github.com/rust-lang/rfcs/pull/453): Require that every impl type parameter appears textually within the input type parameters of the trait reference or the impl self type. |
| 143 | +* [ES6-style unicode string escaping](https://github.com/rust-lang/rfcs/pull/446): Remove `\u203D` and `\U0001F4A9` unicode string escapes, and add ECMAScript 6-style `\u{1F4A9}` escapes instead. Strong positive feedback, some concern with how it interacts with format strings. |
| 144 | +* [extension trait conventions](https://github.com/rust-lang/rfcs/pull/445): Establishes a definition and naming convention for extension traits: traits which aren't intended for generic programing, but instead extending existing types. If extending a `Foo`, use `FooExt`. If Extending a `Foo` when it impls another trait like `Add`, use `FooAddExt`. |
| 145 | +* [cmp and ops reform](https://github.com/rust-lang/rfcs/pull/439): Refactors `Cmp` and the operator overloading traits. Generally positive feedback. Highlights include: |
| 146 | + * Make basic unary and binary operators work by value and use associated types. |
| 147 | + * Generalize comparison operators to work across different types; drop Equiv. |
| 148 | + * Refactor slice notation in favor of range notation so that special traits are no longer needed. |
| 149 | + * Add IndexSet to better support maps. |
| 150 | + * Clarify ownership semantics throughout. |
| 151 | +* [Change precedence of `+` in type grammar](https://github.com/rust-lang/rfcs/pull/438): Update type grammar to make `+` have lower precedence, consistent with the expression grammar, resolving a grammatical ambiguity. |
| 152 | +* [Relocate and improve c_str](https://github.com/rust-lang/rfcs/pull/435): |
| 153 | + * Move the c_str module out of std to rid the latter of type dependencies on libc. |
| 154 | + * Split the current CString into a low-level type CStrBuf and a length-aware CString to make computation costs explicit. |
| 155 | + * Provide custom destructors and purpose-specific, mnemonically named constructors. |
| 156 | + * Add some methods and trait implementations to make the types more useful. |
| 157 | + * Remove the Clone implementation due to lack of purpose. |
| 158 | +* [rename `lifetime` to `scope`](https://github.com/rust-lang/rfcs/pull/431): Highly controversial. Some community members argue that this change in terminology has been much more effective when introducing the actual concepts to newbies. Others argue that scope is already a well established concept in programming languages. |
| 159 | +* [Finalizing more naming conventions](https://github.com/rust-lang/rfcs/pull/430): finalizes a few long-running de facto conventions, including capitalization/underscores, and the role of the unwrap method. Generally positive feedback, some discussion of naming consts like enum variants. |
| 160 | +* [Reserve macro identifiers](https://github.com/rust-lang/rfcs/pull/456): Preemptively reserve a class of $ identifiers for allowing backwards compatible improvements to the macro system. |
| 161 | + |
| 162 | + |
| 163 | +# Community |
| 164 | + |
| 165 | +## From the Team |
| 166 | + |
| 167 | +* [Weekly-meetings/2014-11-04 (macros; multiple lifetime bounds; macro invocation syntax; higher-ranked trait bounds; pub trait methods; out-of-sync nightlies; struct variants; numerics)](https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2014-11-04.md) |
| 168 | + * [Discuss](https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2014-11-04.md) |
| 169 | + * [Reddit](http://www.reddit.com/r/rust/comments/2lrt7b/weeklymeetings20141104_macros_multiple_lifetime/) |
| 170 | +* [Weekly-meetings/2014-10-30 (error conventions; cargo; namespaced enums; trait-based error handling; macro unification; coercions; dynamic linking, byte literals, failing dtors)](https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2014-10-30.md) |
| 171 | + * [Discuss](http://discuss.rust-lang.org/t/weekly-meetings-2014-10-30-error-conventions-cargo-namespaced-enums-trait-based-error-handling-macro-unification-coercions-dynamic-linking-byte-literals-failing-dtors/734) |
| 172 | + * [Reddit](http://www.reddit.com/r/rust/comments/2kuppu/weeklymeetings20141030_error_conventions_cargo/) |
| 173 | +* [IRC notifications now going to #rust-bots](http://discuss.rust-lang.org/t/irc-notifications-now-going-to-rust-bots/735): If you have a bot you'd like to post here (which would be awesome!) please add a description and contact to [the wiki page](https://github.com/rust-lang/rust/wiki/IRC-notifications-channel). |
| 174 | + |
| 175 | +## Videos |
| 176 | + |
| 177 | +* [An introduction to Servo](https://air.mozilla.org/an-introduction-to-servo/): Lars Bergstrom from the Research team provides an overview of the Servo project, demonstrates its current status, and shows how to contribute to it. |
| 178 | +* [November's Bay Area meetup](https://air.mozilla.org/bay-area-rust-meetup-november-2014/) happened |
| 179 | + on Thursday, featuring five presentations about Servo and browser architecture. |
| 180 | + |
| 181 | +## Blog Posts |
| 182 | + |
| 183 | +* [This Week In Servo (10)](http://blog.servo.org/2014/11/04/twis-10/). |
| 184 | +* [Rewriting Rust Serialization, Part 2: Performance](http://erickt.github.io/blog/2014/11/03/performance/): A quick look at how Rust's JSON serialization performance compares to other languages and protocols. |
| 185 | +* [Improved Error Handling in Rust](http://lucumr.pocoo.org/2014/11/6/error-handling-in-rust/): Some discussion of how Rust currently and theoretically handles erroes. |
| 186 | +* [Don't Panic! The Hitchhiker's Guide to Unwinding](http://lucumr.pocoo.org/2014/10/30/dont-panic/): A nice discussion of the challenges of safe and ergonomic error handling, and how it relates to stack unwinding. |
| 187 | +* [Let's build a browser engine! Part 7: Painting 101](http://limpet.net/mbrubeck/2014/11/05/toy-layout-engine-7-painting.html): Part of a longer series on writing a browser engine in Rust. *In this article, I will add very basic painting code.* |
| 188 | +* [On pattern matching performance in Rust](http://www.cjqed.com/blog/rust-pattern-matching-performance/): A quick look at how the `match` statement can produce really efficient code. |
| 189 | +* [Rust and Go](https://medium.com/@adamhjk/rust-and-go-e18d511fbd95): A quick look at Rust and Go from the perspective of a sysadmin used to high-level programming languages. [Reddit](https://www.reddit.com/r/rust/comments/2lmhpd/rust_and_go/). [Hacker News](http://news.ycombinator.com/item?id=8574184) |
| 190 | +* [Learning Rust](http://foon.uk/rust.html): *Inspired by Artyom's Learning Racket series, I've decided to log my efforts in learning Rust. I'm going to document my learning process as I go about trying to build a roguelike in Rust. I've downloaded the compiler, skimmed the getting started guide, and written “Hello World”. So let's get started!* |
| 191 | + |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | +## Discuss |
| 196 | + |
| 197 | +* [Pre-RFC: placement box with Placer |
| 198 | + trait](http://discuss.rust-lang.org/t/pre-rfc-placement-box-with-placer-trait/729/6): |
| 199 | + Add user-defined placement box expression (more succinctly, "a box |
| 200 | + expression"), an operator analogous to "placement new" in C++. This |
| 201 | + provides a way for a user to specify (1.) how the backing storage |
| 202 | + for some datum should be allocated, (2.) that the allocation should |
| 203 | + be ordered before the evaluation of the datum, and (3.) that the |
| 204 | + datum should preferably be stored directly into the backing storage |
| 205 | + (rather than temporary storage on the stack and then copying the |
| 206 | + datum from the stack into the backing storage). |
| 207 | +* [Forbid -(unsigned integer)](http://discuss.rust-lang.org/t/forbid-unsigned-integer/752): the eternal struggle continues. It's super handy when you want it, but also a common error to make. |
| 208 | +* [Moving all built-in macros to plugins](http://discuss.rust-lang.org/t/moving-all-built-in-macros-to-plugins/737): Another proposal to handle some of the issues with macros for 1.0. May make it easier to bootstrap changes to the compiler. |
| 209 | +* [Lifetime Notation](http://discuss.rust-lang.org/t/lifetime-notation/751): `&'a` -> `a&`. Some discussion of tradeoffs and details. |
| 210 | +* [Poll: `Foo::new()` vs `Foo()` as the default constructor](http://discuss.rust-lang.org/t/poll-foo-new-vs-foo-as-the-default-constructor/758/29) |
| 211 | + |
| 212 | + |
| 213 | + |
| 214 | + |
| 215 | +## Reddit |
| 216 | + |
| 217 | +* [Warning! Some collection methods have had their semantics changed transparently!](http://www.reddit.com/r/rust/comments/2ljfnd/warning_some_collection_methods_have_had_their/) |
| 218 | +* [Error interoperation now available in the nightlies](https://www.reddit.com/r/rust/comments/2l98pn/error_interoperation_now_available_in_the/) |
| 219 | +* [Trait-based Exception handling RFC postponed until after 1.0](http://www.reddit.com/r/rust/comments/2l8x2a/traitbased_exception_handling_rfc_postponed_till/) |
| 220 | +* [Cargo now supports build-scripts!](http://www.reddit.com/r/rust/comments/2lgyne/cargo_now_support_build_scripts_xpost_rrust/) |
| 221 | +* [What libraries would you like to see implemented in Rust?](https://www.reddit.com/r/rust/comments/2lmt99/what_libraries_would_you_like_to_see_implemented/) |
| 222 | +* [How good do you think the market for Rust developers will be 5 years from now, and in what area of programming?](http://www.reddit.com/r/rust/comments/2l3l07/rust_is_undoubtedly_one_of_the_upandcoming_big/) |
| 223 | +* [I think Rust and I were made for each other](http://www.reddit.com/r/rust/comments/2ljrp2/i_think_rust_and_i_were_meant_for_each_other/) |
| 224 | +* [How does the Rust community feel about FFI?](https://www.reddit.com/r/rust/comments/2lmkjw/how_does_the_rust_community_feel_about_ffi/) |
| 225 | +* [How do you refactor Rust code?](https://www.reddit.com/r/rust/comments/2lo21r/how_do_you_refactor_rust_code/) |
| 226 | +* [I may start contributing to Rust...can I get a few pointers?](http://www.reddit.com/r/rust/comments/2lduv6/i_may_start_contributing_to_rustcan_i_get_a_few/) |
| 227 | + |
| 228 | + |
| 229 | + |
| 230 | + |
| 231 | +## New Projects |
| 232 | + |
| 233 | +* [this-week-in-rust](https://github.com/cmr/this-week-in-rust): This Week in Rust's content is now publicly hosted in a Github repo! If you find any errors, just submit a PR to the relevant markdown file in `/content`! If you'd like to help out, please contact cmr, brson, or Gankro on Github/Reddit/IRC. |
| 234 | +* [rustaceans.org](http://rustaceans.org/): *This website is for finding Rustaceans. Wondering who is behind that GitHub username or IRC nick? Here is where to find out.* |
| 235 | +* [rust-modifier](https://github.com/reem/rust-modifier): *Convenient chaining APIs for free* |
| 236 | +* [dockerfiles](https://github.com/schickling/dockerfiles): *Collection of lightweight and ready-to-use docker images* |
| 237 | +* [Window Tiling For The Win](https://github.com/Kintaro/wtftw): *A tiling window manager written in Rust* |
| 238 | +* [cxx2rs](https://github.com/manuels/cxx2rs): *A rust-binding generator for C/C++ files* |
| 239 | +* [sorting-rs](https://github.com/wackywendell/sorting-rs): *This is a set of sorting algorithms, written in Rust.* |
| 240 | +* [rust-chatserver](https://github.com/BytePrelude/rust-chatserver): *A barebone command line TCP chatserver written in Rust*. [Looking for feedback](https://www.reddit.com/r/rust/comments/2lpsj8/tcp_chatserver_written_in_rust_looking_for/). |
| 241 | +* [rust-irc](https://github.com/viperscape/rust-irc): *A simple example irc implementation*. [Looking for feedback](https://www.reddit.com/r/rust/comments/2lpw9k/rust_irc_example_looking_for_feedback/) |
| 242 | +* [rusqlite](https://github.com/jgallagher/rusqlite): *Ergonomic, semi-safe bindings to SQLite for Rust* |
| 243 | + |
| 244 | + |
| 245 | +## Upcoming Meetups |
| 246 | + |
| 247 | +* [Rust Bay Area: Cryptography and Rust, December 18th](http://www.meetup.com/Rust-Bay-Area/events/210632582/) |
| 248 | + |
0 commit comments