13 ms·
Rust 1.0: Scheduling the trains
- seren 12y agoWhat is the roadmap after 1.0 ? Is it going to evolve quickly ? Or will it be the right time to join since things are going to be more stable ? My question sounds obvious but depending on the project 1.0 can mean very different things.
- arthursilva 12y agoSomething in the middle, check this post http://blog.rust-lang.org/2014/10/30/Stability.html http://blog.rust-lang.org/2014/10/30/Stability.html
- kibwen 12y ago1.0 only means "code that you've written against a stable release won't break on future stable releases". Rust will still be evolving quickly for quite a while, though we'll at least be free of this nonstop update-your-broken-code treadmill that we've been on for years. :)
- scanr 12y agoI 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-simpler-iterator-interface-instead-of-a-map-in-rust https://stackoverflow.com/questions/26329231/returning-a-sim... https://github.com/rust-lang/rfcs/pull/105 https://github.com/rust-lang/rfcs/pull/105
- arthursilva 12y agoSince it's not a breaking change it's not coming in 1.0, probably shortly after it though.
- kzrdude 12y agoit looks like a breaking change, say if you change the return type of `fn iter()` on a slice.
- arthursilva 12y agoIt seems to me it's inference so the type will stay the same, just inferred.
- kibwen 12y agoIt 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.
- arthursilva 12y agoWell, 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.
- kzrdude 12y agoOlder 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.
- Gankro 12y agoIt'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.
- kibwen 12y agoAnonymized 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).
- scanr 12y agoGreat 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.
- steveklabnik 12y agoLanguage changes are proposed through our RFC process, which is at this repository: https://github.com/rust-lang/rfcs https://github.com/rust-lang/rfcs Open issues start a discussion, and then morph to a more formal proposal.
- scanr 12y agoThanks, 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 https://github.com/rust-lang/rfcs/pull/105
- steveklabnik 12y agoIt 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 https://github.com/rust-lang/rfcs/issues/518
- aalvarado 12y agoYup, 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, ()>>>>> ``
- kibwen 12y agoHa, 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.
- aalvarado 12y agothanks for your hard work. Sometimes we take simplicity for granted!
- jimbokun 12y agoWhat is that, if I may ask?
- mitchmindtree 12y agoThat particular type is an Iterator over two HashSet intersections zipped together. I'm looking forward to getting rid of it!
- bjz_ 12y agoThis is a huge ergonomic issue that the team is very aware of. There are plans to fix it post 1.0.
- asb 12y agoI do wonder if Rust 1.0 is being branched just a little bit too early. I understand that you have to draw a line in the sand somewhere, and the rolling release model means new features can be rolled out quickly. On the other hand, I'm rather disappointed that the ergonomics of error handling may change substantially after 1.0. This is something that is going to affect every single Rust program written, and people may be surprised if 'the best way' to do this changes after 1.0. https://github.com/rust-lang/rfcs/pull/243 https://github.com/rust-lang/rfcs/pull/243
- saosebastiao 12y agoI worry about that too. In addition, I haven't seen any confidence that HKT can be implemented in a backwards compatible way, and that is one of the most-requested features (along with Async IO). I would hate to have to wait around for a 2.0 for this stuff.
- kibwen 12y ago> I haven't seen any confidence that HKT can be implemented > in a backwards compatible way Because nobody has ever managed to propose a design for HKT. How can you possibly future-proof against a feature with no clear idea as to its shape?
- aturon 12y agoThe team has actually been pretty careful to design in a HKT-compatible way. While there isn't a fully-fleshed out design yet for Rust, there are designs in other languages, and we've looked at their pitfalls to make sure we can avoid them. For example, see https://github.com/rust-lang/rfcs/pull/213#issuecomment-65756753 https://github.com/rust-lang/rfcs/pull/213#issuecomment-6575...
- kibwen 12y agoThere's always going to be some feature that would make something nicer and that seems worth waiting for. At the limit we'd be holding off 1.0 until Rust has higher-kinded types (which has never had a concrete proposal nor is anyone really sure it can be incorporated nicely with the rest of Rust's type system), and that's a feature that would absolutely change the paradigm of error handling overnight. The time is soon. I as much as anyone want error handling to be flawless, but I don't think that's enough of a reason to hold back the rest of the language. If we have to evolve our approach to error handling a ways down the road, so be it. Other languages have endured similar paradigm shifts. However, this issue will be inherently subjective... all I can say for sure is, if nobody at all were saying "no, it's too early!", it would certainly be too late. :)
- Sir_Cmpwn 12y agoI'm getting less optimistic about Rust. At first, I liked that they were willing to make breaking changes pre-1.0 to get the language right. However, leading up to 1.0 they've decided to leave cruft in, in the name of getting the release out. For example, the current build system is functionally equivalent to #including a bunch of C files in your C project and only passing one file to cc. I brought this up and had a long discussion about it and how it might be improved with the community, but then when core contributors showed up, the discussion was shut down with the justification that "1.0 comes in a month". I've heard other stories about poor management of the project and I'm just not as excited about Rust as I used to be.
- steveklabnik 12y agoI'm... not sure what you mean by this. Something like #include technically exists, but is absolutely not used everywhere, and is certainly not the 'default build system'.[1] Where was this discussion held? 1: http://doc.rust-lang.org/std/macro.include_str!.html http://doc.rust-lang.org/std/macro.include_str!.html is what I'm thinking of here.
- Sir_Cmpwn 12y ago"Functionally equivalent" to, not identical to. I'm talking about the module system. You could literally replace any instance of: mod mod_name; With: #include "path/to/mod_name" and then run it through the C preprocessor and it'd work exactly the same. The discussion was held on IRC.
- steveklabnik 12y agoThis is absolutely not true. Rust has no textual substitution like the C preprocessor does, and includes a module system, which has namespacing.
- Sir_Cmpwn 12y agoI put together a small demonstration for you: https://github.com/SirCmpwn/rust-poc https://github.com/SirCmpwn/rust-poc
- alexandre_m 12y agoI predict some confusion about Rust crates.io and this project https://crate.io/ https://crate.io/
- Jemaclus 12y agoI'm pretty stoked about this. I've been following Rust since 0.4, and it's been super fun to play around with. I have two major problems with it, but none of them are Rust's fault -- purely flaws of my own: 1) I have no idea what to do with it. I'm primarily a web developer, and I really want to get into systems programming, but I have no idea what to do with it or where to start. I wound up implementing about 50 different Rosetta Code things in Rust 0.9 and 0.10, but I still never came up with a really solid use-case that I could start and finish. That said, I've been really impressed by rust-doom (https://github.com/cristicbz/rust-doom https://github.com/cristicbz/rust-doom) and the new Iota editor (https://github.com/gchp/iota https://github.com/gchp/iota), and I wish I had the know-how to even start down that path. 2) Given that the last time I touched systems programming was in college (15 years ago), I've found it difficult to wrap my head around some of the concepts (ownership in particular). I actually hung out in the IRC chat room for awhile, but I felt more than a few times that people were treating me like an idiot because of my questions ("Ha! You did X? Why in the world would you do that??"), so I wound up not really going back. I'm sure it was all my imagination and that I'm just being sensitive, but I think it would be very helpful to have more people interested in getting new people on board -- specifically people like me, with over a decade of programming experience in higher-level languages. I guess the TLDR of this is: I love Rust, but I don't know what to do with it. Congrats to the Rust team, though. 1.0 is a huge milestone. Good job!
- deleted 12y ago[deleted]
- steveklabnik 12y agoThanks so much! For 1, it's true that it's not clear Rust is going to be great for web development. http://arewewebyet.com http://arewewebyet.com sums things up. That said, Rust does run the backend of Crates.io, and I've been toying around with it as an Ember backend, so we'll see :) 2) I'd love to hear your thoughts on my new ownership guide, which landed last weekish: http://doc.rust-lang.org/guide-ownership.html http://doc.rust-lang.org/guide-ownership.html thoughts very welcome, either here, email, or on the issue tracker. Ownership is the one concept in Rust that hasn't really existed at the language level before, so it's the most unusual thing to grok. > I felt more than a few times that people were treating me like an idiot because of my questions Sorry to hear that. :/ We try to keep it 100% welcoming, but sometimes, people slip through the cracks.
- swetland 12y agoThe biggest question I have regarding rust-1.0, is what's the likelyhood of small/standalone binaries being possible? Last time I looked, while there was talk about lightweight core libraries on the website, but the basic hello world binary was 2MB+ and depended on a bunch of shared libraries. I spent a little time trying to figure out how to build static/smaller binaries without much luck.
- kibwen 12y agoRust's runtime is actually undergoing a dramatic overhaul and is being almost entirely removed as we speak: https://github.com/rust-lang/rust/pull/19654 https://github.com/rust-lang/rust/pull/19654 This is incredibly exciting in that it means that you won't need to do any ceremony to link in Rust libraries from other languages (previously you had to opt out of the stdlib and reimplement lang items as needed). But it also means that static libs should be much smaller, due to no runtime being necessary (which should also make LTO more able to strip unused symbols, shrinking binary size further).
- swetland 12y agoThat definitely sounds encouraging! Looking forward to this.
- steveklabnik 12y agoIt shouldn't be _both_ 2MB _and_ depend on a bunch of shared libraries, it should only be glibc and libgcc. And you can make it smaller by asking Rust to do dynamic linking rather than static linking. The smallest known Rust binary is 151 bytes: http://www.reddit.com/r/rust/comments/2iwtjh/151byte_static_binary_for_x8664_linux_in_rust/ http://www.reddit.com/r/rust/comments/2iwtjh/151byte_static_... My sibling also has great info.
- buster 12y agoTo be fair, it's not possible to tell cargo to do that (yet) (refering to https://github.com/rust-lang/cargo/issues/60 https://github.com/rust-lang/cargo/issues/60 )
- jaredonline 12y agoThis is incredibly exciting. Way to go Rust team!
- piokoch 12y agoNow Rust needs some killer app. Maybe a message broker, something like Apache Kafka, maybe even with Java Messaging Service compatybility as an option. Rust with its low level I/O and efficient memory management should enable creating something very performant.
- does_not_matter 12y agoLie #3: Code is more important than data This is the biggest lie of all. Programmers have spent untold billions of man-years writing about code, how to write it faster, better, prettier, etc. and at the end of the day, it's not that significant. Code is ephemeral and has no real intrinsic value. The algorithms certainly do, sure. But the code itself isn't worth all this time (and shelf space! – have you seen how many books there are on UML diagrams?). The code, the performance and the features hinge on one thing – the data. Bad data equals slow and crappy application. Writing a good engine means first and foremost, understanding the data. http://www.insomniacgames.com/three-big-lies/ http://www.insomniacgames.com/three-big-lies/
- deleted 12y ago[deleted]
- XorNot 12y agoSo something that always holds me up with new languages: workflow. What's a Rust development workflow look like at the moment, from editor, to reference materials, to debugging? I tend to be an IDE person (which obviously doesn't and won't exist for some time) so I'm pretty eager to hear how other people have been doing it.
- thristian 12y agoI've only dabbled in Rust, but my setup for writing Rust in Vim is pretty similar to my setup for writing anything else: vim on one side of the screen, where I do my editing and type ":make" to try and build it (with Vim's makeprg configured to run "cargo test"). On the other side, a browser open to the Rust stdlib docs, and a terminal for interactive testing.