252 points · by Manishearth · 8y ago · 53 comments
Looking forward, the next two releases, 1.26 and 1.27, are going to have some major features that we've been working on for a long, long time, such as "impl trait" (which should allow for improved performance, simpler syntax for the typical use of generics, and greatly improve error messages for extensive use of generics), more ergonomic matching when dealing with references, 128-bit integers, stable SIMD library support, and others. This whole year is going to see the continued stabilization of the ergonomics intiatives from last year, so stay tuned for lots of welcome tweaks to make Rust easier to write and read. :)
(I should also mention that this release happened live from the Rust All-Hands happening in Berlin, which has been a massively productive time so far; keep an eye out for the eventual workweek recap which will hopefully enumerate the tons of improvements (e.g. reducing Rust binary sizes by 10%) and future initiatives (e.g. forming an official Verification Team) that have happened this week.)
This is great news. I just ran my usual benchmark and it seems a performance regression has been fixed and some performance added over that. I'm measuring the speed of loading a Sony A77 raw file in rawloader[1]. That includes TIFF parsing and then a tight loop that processes every pixel. Here's the version history:
1.17 - 95ms
1.18 - 80ms (-16%)
1.19 - 79ms (-16%)
1.20 - 80ms (-16%)
1.21 - 79ms (-17%)
1.22 - 79ms (-17%)
1.23 - 79ms (-17%)
1.24 - 84ms (-12%)
1.25 - 74ms (-22%)
I believe the jump in 1.18 was LLVM 4.0 and now LLVM 6.0 is giving me a new performance jump. No idea what happened in 1.24 though but it seems to be fixed now.
Oh, that's a huge one for me and I didn't even know it was in the pipeline, very happy to hear that. Now I'll have to complain about lack of stable inline ASM support instead!
> Now I'll have to complain about lack of stable inline ASM support instead!
This one is much, much harder.
I'm curious why that is, intuitively I'd have assumed that SIMD support would be trickier to stabilize (since you need a generic interface over a wide range of implementations) while inline ASM is pretty much "just copy-paste this bit of assembly in the middle of this function" which I assume is already something LLVM can do easily since it needs that for C/C++. Since nobody expects inline ASM to be portable you don't have to worry about making one single generic interface to it.
What's the catch?
https://doc.rust-lang.org/nightly/std/simd/ deserves mention, too, because it leapfrogs C and C++ (whereas std::arch brings Rust to parity).
So excited for that one single improvement, it's going to make many things so much easier. Especially working with Futures and Iterators.
YES!
YES!
WOOOOO!!!
That's basically my birthday present.
Was the lack of lld the only reason for the Windows installer to depend on the MSVC build tools, or are there others?
I'm most excited about LLD for hobby OS dev; with Rust and LLD it's now trivial to get going on any OS Rust supports. As a Windows user, I really appreciate it!
Just curious, but if you're already built on top of llvm, why not bundle clang for that? Licensing issues? I thought NCSA was pretty permissive.
fn foo_no(v: &[i32]) -> std::iter::Cloned<std::slice::Iter<i32>> {
v.iter().cloned()
}
fn foo_impl<'a>(v: &'a [i32]) -> impl Iterator<Item=i32> + 'a {
v.iter().cloned()
}
fn main() {
let v = vec![1, 2, 3];
let () = foo_no(&v);
let () = foo_impl(&v);
}
Given the let ()s, this will fail to compile for both. For the first, you get = note: expected type `std::iter::Cloned<std::slice::Iter<'_, i32>>`
for the second, you get = note: expected type `impl std::iter::Iterator`
The former gets longer and longer based on how many iterator chains you do, the latter will be the same no matter how many you add. It's also just generally way more clear, "I was expecting something implementing Iterator, and I didn't get it" vs "I was expecting this exact chain of nested iterators".Because if so I have an amazing excuse to finally learn rust
For example, get this $2 board http://wiki.stm32duino.com/index.php?title=Blue_Pill and use this library (see the examples!) https://github.com/japaric/stm32f103xx-hal
There probably will eventually be AVR implementations of https://github.com/japaric/embedded-hal so you could run mostly the same code on an Arduino board.
This is great. I often run cargo doc after adding new library dependencies or even for my own new interfaces to be able to click through the code. This is a wonderful tool, especially while IDEs are still coming up to speed.
Are IDEs using cargo doc? or are they reimplementing the markdown processing?
There is a recent blog series tracking the quite exciting progress being made at the moment (part vi, latest in the series): https://boats.gitlab.io/blog/post/2018-03-20-async-vi/
There is an experimental RFC tracking generators with an initial syntax design: https://github.com/rust-lang/rfcs/blob/master/text/2033-expe...
The networking WG just started literally today, and will be shepherding the work. I'm not yet sure where the best tracking issue is; if I find out soon I'll leave another comment.
(we had some issues with GH pages)
man, they work really hard to keep their language ugly & confusing