News for hackers. Stuff that matters.
Re:Rust 1.0: Scheduling the trains by scanr on Friday December 12, 2014 @11:20AM (#8740895)
I really, really hope that abstract return types make it in or are not considered a breaking change for a future release:

https://stackoverflow.com/questions/26329231/returning-a-sim...

https://github.com/rust-lang/rfcs/pull/105

Re:Rust 1.0: Scheduling the trains by aalvarado on Friday December 12, 2014 @11:43AM (#8741065)
Yup, seeing method signatures like these is discouraging:

``` core::iter::Zip<core::iter::FilterMap<'_, (&std::collections::hash::set::HashSet<attr::Attribute>, &attr::Attribute), &attr::Attribute, core::iter::Zip<core::iter::Repeat<&std::collections::hash::set::HashSet<attr::Attribute>>, core::iter::Map<'_, (&attr::Attribute, &()), &attr::Attribute, std::collections::hash::map::Entries<'_, attr::Attribute, ()>>>>, core::iter::FilterMap<'_, (&std::collections::hash::set::HashSet<attr::Attribute>, &attr::Attribute), &attr::Attribute, core::iter::Zip<core::iter::Repeat<&std::collections::hash::set::HashSet<attr::Attribute>>, core::iter::Map<'_, (&attr::Attribute, &()), &attr::Attribute, std::collections::hash::map::Entries<'_, attr::Attribute, ()>>>>> ``

Re:Rust 1.0: Scheduling the trains by kibwen on Friday December 12, 2014 @11:45AM (#8741081)
Ha, we hate them too, which is why we're so eager to finalize their design so that we can replace all of that hideous garbage with just `impl Iterator`. :)

And who knows, it might happen for 1.0 if enough people push on the design and are willing to put in the legwork of implementing it.

Re:Rust 1.0: Scheduling the trains by aalvarado on Friday December 12, 2014 @11:52AM (#8741143)
thanks for your hard work. Sometimes we take simplicity for granted!
Re:Rust 1.0: Scheduling the trains by jimbokun on Friday December 12, 2014 @01:53PM (#8741960)
What is that, if I may ask?
Re:Rust 1.0: Scheduling the trains by mitchmindtree on Friday December 12, 2014 @05:59PM (#8743232)
That particular type is an Iterator over two HashSet intersections zipped together. I'm looking forward to getting rid of it!
Re:Rust 1.0: Scheduling the trains by bjz_ on Friday December 12, 2014 @07:02PM (#8743439)
This is a huge ergonomic issue that the team is very aware of. There are plans to fix it post 1.0.
Re:Rust 1.0: Scheduling the trains by kibwen on Friday December 12, 2014 @11:26AM (#8740935)
Anonymized return types will sadly not be a blocker for 1.0, though they will be an enormously high priority post-1.0.

In particular, the biggest pain point for the lack of anonymized return types won't be the use case mentioned in that SO thread (which is heinously ugly and leaks implementation details, but at least it's possible), but will rather be the fact that without anonymized return types it will be impossible for a function to construct a closure and then return that closure without stuffing it into a box (though note that it will still be possible for functions to return unboxed closures if it accepted that closure as a parameter to the function).

Re:Rust 1.0: Scheduling the trains by scanr on Friday December 12, 2014 @11:52AM (#8741134)
Great to hear that folk are aware of this and that it's not considered a breaking change for a future release. Where is the best place to get updates on these kinds of features? I was following the github ticket until it closed and it wasn't clear where to go afterwards.
Re:Rust 1.0: Scheduling the trains by steveklabnik on Friday December 12, 2014 @11:53AM (#8741147)
Language changes are proposed through our RFC process, which is at this repository: https://github.com/rust-lang/rfcs

Open issues start a discussion, and then morph to a more formal proposal.

Re:Rust 1.0: Scheduling the trains by scanr on Friday December 12, 2014 @12:18PM (#8741318)
Thanks, Steve. I was following the previous RFC but it got closed. Do you know if there is a new one for abstract / anonymous return types?

This was the previous one for abstract return types:

https://github.com/rust-lang/rfcs/pull/105

Re:Rust 1.0: Scheduling the trains by steveklabnik on Friday December 12, 2014 @12:22PM (#8741357)
It appears that (at least with my searching) we don't have an issue on the RFC repo, so I opened one. https://github.com/rust-lang/rfcs/issues/518
Re:Rust 1.0: Scheduling the trains by scanr on Friday December 12, 2014 @06:25PM (#8743319)
Awesome. Thank you.
Re:Rust 1.0: Scheduling the trains by arthursilva on Friday December 12, 2014 @11:26AM (#8740933)
Since it's not a breaking change it's not coming in 1.0, probably shortly after it though.
Re:Rust 1.0: Scheduling the trains by kzrdude on Friday December 12, 2014 @11:52AM (#8741142)
it looks like a breaking change, say if you change the return type of `fn iter()` on a slice.
Re:Rust 1.0: Scheduling the trains by arthursilva on Friday December 12, 2014 @12:24PM (#8741369)
It seems to me it's inference so the type will stay the same, just inferred.
Re:Rust 1.0: Scheduling the trains by kibwen on Friday December 12, 2014 @12:37PM (#8741474)
It actually does have the potential to break things, because to do this today requires you to explicitly list out all the types of the return type (which should really be considered implementation details). If a user of your function accidentally relies on one of these details, their code would be broken once you switch from the fully-specified return type to an anonymized return type.
Re:Rust 1.0: Scheduling the trains by arthursilva on Friday December 12, 2014 @12:47PM (#8741541)
Well, if you take advantage of it may break stuff. Although this doesn't really qualify as a breaking change since older code is going to compile when it's introduced.
Re:Rust 1.0: Scheduling the trains by kzrdude on Friday December 12, 2014 @01:48PM (#8741933)
Older code that uses specific features of that iterator will break. The slice iterator has its own methods (turn it into a slice), it's clonable and it is Copy.
Re:Rust 1.0: Scheduling the trains by Gankro on Friday December 12, 2014 @05:39PM (#8743147)
It's only a breaking change to one's API to actually use the functionality, though. I don't think there's anywhere in std's public APIs where we would suddenly change from returning a concrete iterator to an "abstract" one.