News for hackers. Stuff that matters.
Re:Rust is mostly safety by steveklabnik on Thursday December 29, 2016 @09:20AM (#13277372)
A little over 18 months ago, 1.0 was released. We've had very strong compatibility guarantees since then.
Re:Rust is mostly safety by nordsieck on Thursday December 29, 2016 @09:30AM (#13277422)
While that is true, in Go, almost no libraries are written to use non-stable features. This is not the case in Rust.
Re:Rust is mostly safety by ekidd on Thursday December 29, 2016 @09:43AM (#13277477)
There are really only two popular Rust libraries that use unstable features:

1. serde, the best serialization/deserialization library. This works on stable now using the `serge_codegen` crate and a custom `build.rs` script. This will Just Work on stable with no extra setup once Macros 1.1 lands, theoretically in about 5 weeks. But I'm using it on stable now in a half-dozen projects, thanks to a `build.rs` script.

2. Diesel, the high-level ORM library for Rust. This works on stable using a `build.rs` script, and 90% of it will work on stable without the `build.rs` script once Macros 1.1 ships.

There are a few other experimental libraries like Rocket (which looks very slick) that only work on nightly Rust. But I don't think any of them are particularly popular yet.

Personally, I maintain something like two dozen Rust crates and applications, and only two use nightly Rust. Both need Macros 1.1, which should be on stable in about 5 weeks.

Re:Rust is mostly safety by kzrdude on Thursday December 29, 2016 @09:54AM (#13277542)
serde works on stable without serde_codegen or custom build scripts, too. It works like a regular library in fact, just with less features (no code generation feature). A custom data structure might not be able to use the default code generation for its impls anyway.
Re:Rust is mostly safety by bluejekyll on Thursday December 29, 2016 @11:27AM (#13278179)
This is true of diesel as well: http://diesel.rs/guides/getting-started/
Re:Rust is mostly safety by steveklabnik on Thursday December 29, 2016 @09:34AM (#13277438)
Right. Go and Rust have completely different development models, so that wouldn't make any sense.

To recap, in Rust, to make additions to the language:

1. Small additions mean make a PR.

2. Big additions mean make an RFC, then a PR if accepted.

3. These PRs go behind a feature flag that lets us track the feature, and only allows it on nightly.

4. People who desire the new feature try it out. (This is what you refer to.)

5. If any issues are found, they're fixed, or, in the worst case, the feature is removed.

6. The feature is made available to stable users, the feature flag is removed, and backwards incompatible changes can no longer happen.

What would be un-healthy is if everyone had to rely on nightly for everything. At the moment, most people use stable Rust. And of the people that use nightly, the largest single feature will be stable as of the next stable release for Rust. But some people are always going to be using nightly features, and that's a good thing: it means that by the time it hits stable, it's already undergone some degree of vetting.

Re:Rust is mostly safety by setori88 on Thursday December 29, 2016 @09:57AM (#13277561)
Any idea when custom allocator will become stable? That's the only thing holding us to nightly.
Re:Rust is mostly safety by steveklabnik on Thursday December 29, 2016 @10:06AM (#13277613)
I literally had a conversation about this yesterday. We need someone to champion the work. If that's you, we should get in touch.
Re:Rust is mostly safety by setori88 on Thursday December 29, 2016 @11:26AM (#13278168)
email sent
Re:Rust is mostly safety by steveklabnik on Thursday December 29, 2016 @11:33AM (#13278210)
Excellent! It might take me a day or two; I have some stuff to look up in order to give you a proper response.
Re:Rust is mostly safety by kebolio on Thursday December 29, 2016 @09:46AM (#13277495)
> Most people use stable Rust.

However, many popular or important libraries like Serde or Rocket require the use of nightly. I recall the article a very short while ago on the front page that noted how Rust has effectively diverged into two languages, stable and nightly.

Re:Rust is mostly safety by stymaar on Thursday December 29, 2016 @10:52AM (#13277928)
This article has been unanimously qualified as FUD by the Rust user community. Nightly is for innovations and experimentations, not for real use :

- Rocket is an amazing example of innovation, but it's currently just an experimentation.

- Serde works on stable for a long time but they experimented a more ergonomic version on nightly. They iterated upon it with Rust developers to create a new and well thought stable API which will land in the next version of Rust (macro 1.1 in february).

Rocket is likely to follow Serde's path during 2017 and will eventually work on stable in 2018. Building a great langage takes time ;)

Re:Rust is mostly safety by steveklabnik on Thursday December 29, 2016 @09:53AM (#13277534)
Serde does not require nightly, though it is nicer to use on nightly. That's the "will be stable as of the next stable release for Rust" I alluded to above.

Rocket just came out; I think it's an extremely interesting library, but https://crates.io/crates/rocket shows that it's been downloaded 618 times. It hasn't exactly taken the world by storm yet. I think it shows great potential though! But it's not a good case of showing that the Rust ecosystem largely depends on nightly.

The article you refer to contained a number of factual errors.

Re:Rust is mostly safety by kebolio on Thursday December 29, 2016 @10:06AM (#13277612)
Over the last year of intermittently dossing around with Rust I encountered the need to use nightly regularly, with various crates refusing to compile (and usually I stopped my experimentation there as my barrier to entry was anything harder than pacman -S rust cargo). Yet I did not know until just now that Serde is moving off a dependency on nightly and it is encouraging that this is a trend with similar libraries; I stand corrected.
Re:Rust is mostly safety by erickt on Thursday December 29, 2016 @01:27PM (#13278981)
Serve creator here. The core library 'serde' never actually required nightly. It was just the helper library 'serde_derive' which can automatically implement the serde traits that needed nightly. dtolnay has been doing a wonderful job getting us off nightly. We can't wait to finally get rid of using it.
Re:Rust is mostly safety by steveklabnik on Thursday December 29, 2016 @10:17AM (#13277689)
If you happen to remember which libraries those were, I'd be interested in hearing about them!

> my barrier to entry was anything harder than pacman -S rust cargo

Today, that also wouldn't be the case: "rustup update nightly" and "rustup run nightly cargo build" or whatever, with extra stuff to automatically switch per directory.

Re:Rust is mostly safety by pimeys on Thursday December 29, 2016 @10:17AM (#13277688)
We've been using Rust on production since the summer and we only use the stable compiler.

These "popular or important libraries" are nice use cases what you might be able to do with Rust in future. But relying on them right now and using them in production is not really a good idea.

Re:Rust is mostly safety by echelon on Thursday December 29, 2016 @09:52AM (#13277527)
That article posted half a week ago [1] claiming Rust developers and libraries rely on nightly was FUD. It's terrible that this is being repeated, because it is simply not true.

[1] https://news.ycombinator.com/item?id=13251729

Re:Rust is mostly safety by kibwen on Thursday December 29, 2016 @06:43PM (#13281243)
Er, there are no unstable features in Go... the language is deliberately frozen.
Re:Rust is mostly safety by SomeStupidPoint on Thursday December 29, 2016 @09:37AM (#13277449)
What constitutes a strong compatibility guarantee?

How many breaking changes happened in the past 18 months?

Re:Rust is mostly safety by steveklabnik on Thursday December 29, 2016 @09:44AM (#13277484)