Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust 1.13 announcement #136

Closed

Conversation

@steveklabnik
Copy link
Member

steveklabnik commented Nov 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.

Rust 1.13 announcement
Based on a bunch of stuff @brson wrote
@rust-highfive

This comment has been minimized.

Copy link

rust-highfive commented Nov 9, 2016

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

!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.

@tomaka

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.

@retep998

retep998 Nov 9, 2016

Member

To clarify, it has plenty of things other than inline functions, its just that all the functions are inline.

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.

@michaelwoerister

michaelwoerister Nov 9, 2016

Contributor

Yes, that's correct.

GitHub. 1448 patches were landed in this release.

[install]: https://www.rust-lang.org/install.html
[notes]:

This comment has been minimized.

@jonathandturner

jonathandturner Nov 9, 2016

Contributor

TODO: add notes link

### 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.

@jonathandturner

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.

@jonathandturner

jonathandturner Nov 9, 2016

Contributor

Needs a graph or two in the release announcement, I think.

This comment has been minimized.

@brson

brson Nov 9, 2016

Contributor

There's a graph linked, but yeah it would be better to be inline.

let mut f = match f {
Ok(file) => file,
Err(e) => return Err(e),
};

This comment has been minimized.

@jonathandturner

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.

@brson

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.

@jonathandturner

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.

@brson

brson Nov 9, 2016

Contributor

I can do that.

poor error messages, and is very ugly when chained together. Consider:

```rust
try!(try!(try!(foo()).bar()).baz())

This comment has been minimized.

@jonathandturner

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.

@brson

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.

@jonathandturner

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.

@brson

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.

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Nov 9, 2016

Since @steveklabnik is out today I opened another PR with edits: #137.

I have not yet addressed all @jonathandturner's comments.

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Nov 9, 2016

try! appears 99757 times on crates.io

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Nov 9, 2016

Do we want to talk about diagnostics? There are a few PRs with pretty pictures we could steal.

@jonathandturner

This comment has been minimized.

Copy link
Contributor

jonathandturner commented Nov 9, 2016

@brson - true, I could try to dig around and see which new one landed in the beta

@jonathandturner

This comment has been minimized.

Copy link
Contributor

jonathandturner commented Nov 9, 2016

@brson - here's an example that improved between stable and the beta:

Before:

screen shot 2016-11-09 at 3 26 28 pm

After:

screen shot 2016-11-09 at 3 26 38 pm

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Nov 9, 2016

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Nov 9, 2016

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.

#### Performance improvements


There has bee a lot of focus on compiler performance lately. There's good news

This comment has been minimized.

@futile
@aturon

This comment has been minimized.

Copy link
Member

aturon commented Nov 9, 2016

This has been moved to a fresh PR: #137

@aturon aturon closed this Nov 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.