Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRust 1.13 announcement #136
Conversation
rust-highfive
assigned
aturon
Nov 9, 2016
This comment has been minimized.
This comment has been minimized.
rust-highfive
commented
Nov 9, 2016
|
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
tomaka
reviewed
Nov 9, 2016
| !4 = !{i32 2, !"Debug Info Version", i32 3} | ||
| ``` | ||
|
|
||
| You're eyes don't deceive you. This crate contains no code at all, and it's not |
This comment has been minimized.
This comment has been minimized.
retep998
reviewed
Nov 9, 2016
|
|
||
| In some cases this results in dramatic improvements. Build times for the ndarray | ||
| crate [improved by 50%][ev2], and in the (unreleased) [winapi 0.3] crate, which | ||
| is nothing but inline functions, rustc now generates the following LLVM IR: |
This comment has been minimized.
This comment has been minimized.
retep998
Nov 9, 2016
Member
To clarify, it has plenty of things other than inline functions, its just that all the functions are inline.
michaelwoerister
reviewed
Nov 9, 2016
| the crate they are defined _unless_ they are called directly. This saves the | ||
| cost of rustc converting the function to LLVM IR and LLVM optimizing and | ||
| converting the function to machine code (TODO is this right about converting to | ||
| machine code - were these functions public before?). |
This comment has been minimized.
This comment has been minimized.
jonathandturner
reviewed
Nov 9, 2016
| GitHub. 1448 patches were landed in this release. | ||
|
|
||
| [install]: https://www.rust-lang.org/install.html | ||
| [notes]: |
This comment has been minimized.
This comment has been minimized.
| ### What's in 1.13.0 stable | ||
|
|
||
| The two big things in Rust 1.13 stable are compiler performance and a new | ||
| operator, `?`. As usual, there's also a number of library stabilizations and |
This comment has been minimized.
This comment has been minimized.
jonathandturner
Nov 9, 2016
Contributor
Wording a little awk. Maybe "Rust 1.13 comes with two big improvements: a new ? operator that makes error handling easier and fixes to compiler performance improvements of XX%"
| diagnostic](https://github.com/rust-lang/rust/issues/35946), we now have | ||
| the ability to do so. | ||
|
|
||
| #### Performance improvements |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| let mut f = match f { | ||
| Ok(file) => file, | ||
| Err(e) => return Err(e), | ||
| }; |
This comment has been minimized.
This comment has been minimized.
jonathandturner
Nov 9, 2016
Contributor
People would write this with try! today, right? Feels like we might as well just write the idiomatic Rust and then show how it got better.
This comment has been minimized.
This comment has been minimized.
brson
Nov 9, 2016
Contributor
I tried doing so, but this particular example is too simple, and doesn't look like a compelling justification of ? over try!. I have a more complex example here in comparison.
I do like that this current explains what ? does, not just that it's the same as try!.
| unwraps it and gives the inner value. If it was an `Err`, it returns from | ||
| the function you're currently in. | ||
|
|
||
| Seasoned Rustaceans may recongize that this is the same as the `try!` macro |
This comment has been minimized.
This comment has been minimized.
jonathandturner
Nov 9, 2016
Contributor
Can we do a quick search of crates.io to see how much try! is used? I'd assume people are using it, but if it's not often used, perhaps it needs this introduction.
This comment has been minimized.
This comment has been minimized.
| poor error messages, and is very ugly when chained together. Consider: | ||
|
|
||
| ```rust | ||
| try!(try!(try!(foo()).bar()).baz()) |
This comment has been minimized.
This comment has been minimized.
jonathandturner
Nov 9, 2016
Contributor
Do people write patterns like this? I'd assume this would be a bit more of an expanded form with unnecessary steps, like:
let f = try!(foo());
let g = try!(f.bar());
let h = try!(g.baz());
This comment has been minimized.
This comment has been minimized.
brson
Nov 9, 2016
Contributor
I wouldn't write that because it's so ugly. Now you can though because it's not ugly!
| !1 = !DIFile(filename: ".\5Csrc\5Clib.rs", directory: "C:\5Cmsys64\5Chome\5CPeter\5Cwinapi-rs") | ||
| !2 = !{} | ||
| !3 = !{i32 2, !"CodeView", i32 1} | ||
| !4 = !{i32 2, !"Debug Info Version", i32 3} |
This comment has been minimized.
This comment has been minimized.
jonathandturner
Nov 9, 2016
Contributor
Is this llvm? I don't think most people will be able to read this (I know it took me a while looking at it to figure out what was possibly going on). Is there another way we can show this, maybe?
This comment has been minimized.
This comment has been minimized.
brson
Nov 9, 2016
Contributor
I picked this because it's one of the interesting examples we had on hand, and I think a little technical peek under the hood is not too risky. Maybe it could be explained better, replaced with something else visually interesting, like an inline graph, or just removed.
This comment has been minimized.
This comment has been minimized.
|
Since @steveklabnik is out today I opened another PR with edits: #137. I have not yet addressed all @jonathandturner's comments. |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Do we want to talk about diagnostics? There are a few PRs with pretty pictures we could steal. |
This comment has been minimized.
This comment has been minimized.
|
@brson - true, I could try to dig around and see which new one landed in the beta |
This comment has been minimized.
This comment has been minimized.
|
@brson - here's an example that improved between stable and the beta: Before: After: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
I think the giant lists of library and cargo features are overwhelming, already produced in this form in the release notes themselves. Maybe we can just have a short section listing other notable stuff. |
futile
reviewed
Nov 9, 2016
| #### Performance improvements | ||
|
|
||
|
|
||
| There has bee a lot of focus on compiler performance lately. There's good news |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This has been moved to a fresh PR: #137 |


steveklabnik commentedNov 9, 2016
Based on a bunch of stuff @brson wrote
/cc @rust-lang/core
I have "allow edits from maintainers" on so you can just push changes to this branch if you'd like to make them.