News for hackers. Stuff that matters.
Re:Rust vs. Go by tedunangst on Wednesday January 18, 2017 @05:37PM (#13431051)
Well, let's see. I was following rust's development for a while, but waited until 1.0 when it seemed it might be kind of stable. All that trivial and obviously correct code turned out to be a kind of wrestling match with the compiler. Far from a pure joy, it was rather frustrating. Set it aside for a while, but then came back recently figuring maybe I'd take another look but instead of starting from scratch I'd pick an existing project and poke around with it. First project I looked at had a requirement that one use the nightly compiler check out, but not just any nightly, specifically the one from last Tuesday. Then I looked at another project, and this also required nightly, but this time it was the one from the Thursday before last. Fuck. This. Noise. I'm not learning a language where every project requires a separate compiler.
Re:Rust vs. Go by comex on Wednesday January 18, 2017 @06:17PM (#13431414)
That's basically an artifact of the combination of Rust's immaturity and its conservative stability policy - once a language feature or API is supported by a stable compiler, it needs to keep working more or less forever. So a bunch of features still require nightly, so some projects target nightly, and the big ones may pin to specific nightlies. But the amount of breakage is vastly lower than it used to be (especially pre-1.0), and even in the year-and-a-half since 1.0 a lot of different bits have been stabilized, so that sticking to stable Rust no longer feels like being handcuffed. The biggest unstable feature left is compiler plugins, which should get a rudimentary version stabilized Real Soon Now. With that and maybe specialization in place, there should be little reason for projects to stick to nightly.
Re:Rust vs. Go by ajmurmann on Wednesday January 18, 2017 @05:46PM (#13431135)
I'm totally fine learning the borrow checker. It's a investment I see value in. Even if it's just in me learning about solid rules for sharing variables. But that nightly shit you describe is scary as fuck and makes me very concerned about the future of the language. Post 1.0 this shouldn't be an issue!
Re:Rust vs. Go by burntsushi on Wednesday January 18, 2017 @06:11PM (#13431384)
There are a couple of fairly popular libraries that were nicer to use on nightly Rust (serde and diesel), but could otherwise work on Rust stable. The "nicer to use on nightly" is going away with the next stable release of Rust. Other than that, the vast majority of the ecosystem is on Rust stable.
Re:Rust vs. Go by tedunangst on Thursday January 19, 2017 @12:26AM (#13433262)
Unfortunately "the next stable is the one you want" has been the story for quite a while now. Since this is ostensibly a thread comparing with go, I'll note that their story is more like "the next release will be better, but don't wait for it".
Re:Rust vs. Go by pcwalton on Thursday January 19, 2017 @03:44AM (#13434168)
> Unfortunately "the next stable is the one you want" has been the story for quite a while now.

I don't recall anyone ever saying this, where "the one you want" means "the one that supports procedural macros".

We have had this discussion for a very long time, and it has always centered around serde and diesel. Those have been the biggest nightly users since 1.0, and probably before then.

Re:Rust vs. Go by burntsushi on Thursday January 19, 2017 @08:24AM (#13435551)
> Unfortunately "the next stable is the one you want" has been the story for quite a while now.

Not really. serde and diesel have been more convenient on nightly for a long time now. It is only just now that we can say the "next stable" because that's when the particular feature they need will be stable.

> I'll note that their story is more like "the next release will be better, but don't wait for it".

I can't wait to use Go's `sort.Slice` function[1], but I'll have to wait for the next stable release.

Seriously though, I'd say the key difference between Go and Rust on this venue is that while Rust is stable, there's still more stuff we'd like to add. To that end, we encourage experimentation by making the acquisition of a nightly Rust compiler really easy. This naturally leads to people experimenting with nightly and publishing crates that either use it or require it. This is a necessary part of experimenting with new features and getting feedback.

Go's scope for experimentation is much smaller. Their changes are much more incremental and conservative. It's a really nice benefit of using Go.

My point is: this is a trade off and it should be presented as such. In Rust land, it requires that you---the user of Rust---ignore crates that require nightly or ignore features of crates that require nightly.

[1] - https://tip.golang.org/pkg/sort/#Slice

Re:Rust vs. Go by ajmurmann on Wednesday January 18, 2017 @06:21PM (#13431457)
Yeah, I constantly ran into this when parsing JSON. I hope you are right and it will be over soon.
Re:Rust vs. Go by pimeys on Wednesday January 18, 2017 @05:51PM (#13431198)
I consider libraries using a nightly Rust to be proofs of concept, not actually usable tools. This might be possible in the future, let's push these features to the stable Rust and maybe we could have this kind of libraries in the future.

I always use stable compiler. Never had a need for nightly.

Re:Rust vs. Go by tatterdemalion on Wednesday January 18, 2017 @06:10PM (#13431372)
The main blocker on stable was a feature called "custom derive" or "macros 1.1" which will be stabilized in the 1.15 release in February. At this point any library tied to a specific nightly is using some extremely cutting edge features.
Re:Rust vs. Go by AsyncAwait on Wednesday January 18, 2017 @06:30PM (#13431509)
It's not really scary.

Very few projects require nightly features and of those that do, most of them will work on stable in just a couple of weeks!

Plus you can easily switch between versions with rustup!

Re:Rust vs. Go by yellowapple on Wednesday January 18, 2017 @09:38PM (#13432495)
I feel like every other crate I've run into claims to require nightly.

In reality, they often work perfectly fine on a reasonably-modern stable, and simply haven't updated their documentation and READMEs to indicate "oh yeah, this nightly feature is now in stable, so just use a stable that's newer than version so-and-so".

Re:Rust vs. Go by moosingin3space on Thursday January 19, 2017 @02:34PM (#13438772)
Please, if you see this, file an issue against the project, so we can clearly mark those crates as working on stable.
Re:Rust vs. Go by serge2k on Wednesday January 18, 2017 @08:00PM (#13432035)
> most of them will work on stable in just a couple of weeks!

Until they don't again because clearly the authors have no interest in being on a stable compiler release.

> Plus you can easily switch between versions with rustup!

I don't think people are complaining because switching versions is hard. Just unnecessary, risky, and yes kind of annoying.

Re:Rust vs. Go by AsyncAwait on Wednesday January 18, 2017 @08:42PM (#13432241)
> Until they don't again because clearly the authors have no interest in being on a stable

This is false, most uses of nightly are because of macros, which will be stable in the next version of Rust.

Re:Rust vs. Go by lomnakkus on Thursday January 19, 2017 @04:00AM (#13434232)
> Until they don't again because clearly the authors have no interest in being on a stable compiler release.

Then use an older version of the package. Unless the package in question was relying on some "nightly" feature that never made it into stable, then you should be fine.

Re:Rust vs. Go by serge2k on Wednesday January 18, 2017 @07:58PM (#13432025)
1.0 was what, 1.5 years ago?

I'm not convinced the problem will just go away. Not as long as people are obsessed with the new hotness language features that require a compiler from the tuesday before last.

Cargo also makes me wary. How do I know what I'm choosing is any good, and if it is will it still be around next year. Nature of 3rd party libs I guess.

Re:Rust vs. Go by dbaupp on Wednesday January 18, 2017 @08:36PM (#13432210)
Cargo doesn't require that you use things from crates.io without vetting them. It's possible to, say, write everything yourself, or only use specific crates that you've decided are good (whether that's by reading the source, or only using the ones published by the Rust developers, or some other criteria) and even go as far as explicit pinning to specific versions of them in your manifest (although this isn't particularly necessary: Cargo pins versions by default, and won't upgrade without you explicitly asking for it).
Re:Rust vs. Go by mook on Thursday January 19, 2017 @02:03AM (#13433734)
The problem really is that you have to vet them at all. With golang's standard library, it's all going to be supported to some degree. (I believe the same happens with rust's standard library, it's just much smaller.)

Basically, some people like having a curated library set; others do fine without and are happy to find things to use. The former set doesn't like rust as much in its current state.

Re:Rust vs. Go by pcwalton on Thursday January 19, 2017 @03:45AM (#13434173)
We have the Rust nursery as a curated library set.
Re:Rust vs. Go by dbaupp on Thursday January 19, 2017 @02:53AM (#13433940)
The crates published by the Rust developers themselves seem quite similar to the standard library for this purpose. (But, yes, things like this are not as discoverable as they should be; it is one of many things people are working on.)
Re:Rust vs. Go by solidsnack9000 on Thursday January 19, 2017 @02:18AM (#13433789)
> I'm not learning a language where every project requires a separate compiler.

All the libraries I have needed for my projects in Rust support stable. Maybe shortly after 1.0 some people were not playing by the rules yet.

The only exceptions I've found are some truly elite macro things and stuff to support code generation.

Re:Rust vs. Go by Animats on Wednesday January 18, 2017 @06:36PM (#13431550)
Welcome to the downside of version pinning. Now that we have version pinning, developers don't need to make versions forward compatible. Misery is when one program needs packages which use different pinned versions of something. There's probably some namespace hack to allow that.

This is compiler version pinning. At least .toml files don't support that. Yet.

Re:Rust vs. Go by dbaupp on Wednesday January 18, 2017 @06:45PM (#13431600)
Do you really expect any project to have nightly builds that are forward compatible? The whole point of regular development builds is to have a place to test and do experiments... which is pointless if every experiment needs to be supported forever.

The "namespace hack" in Rust is having the "stable" namespace: a compiler that rejects all unstable code (and is forward compatible), so that people don't accidentally get pinned.

If someone wants to pin to a specific development version (of anything), there's nothing the project can do about that, other than being closed source and only publishing stable artifacts. Tooling like rustup that makes it easier to pin means that people who choose to experiment can still use stable by default (easy to switch back) and that others can easily collaborate on the experiments, both of which seem like strict positives.

Re:Rust vs. Go by tedunangst on Thursday January 19, 2017 @12:18AM (#13433225)
Perhaps another incarnation of the rule that work expands in response to productivity improvements. You can improve efficiency, but instead of saving work people will find more ways to create new work.
Re:Rust vs. Go by bbcbasic on Wednesday January 18, 2017 @05:50PM (#13431181)
> wrestling match with the compiler

I went through a similar experience in Haskell. It is worth going through until you get to the point where it is no longer a wrestling match, because then you are just as productive but any code you write is checked much more thoroughly than in a more weakly typed language.

> Fuck. This. Noise. I'm not learning a language where every project requires a separate compiler.

I guess just wait until it stabilises then.

Re:Rust vs. Go by serge2k on Wednesday January 18, 2017 @08:01PM (#13432040)
> I guess just wait until it stabilises then.

Which is when? 1.15? 1.50? 2.0?

What was the point of that whole "1.0" thing?

Re:Rust vs. Go by ehsanu1 on Wednesday January 18, 2017 @08:19PM (#13432124)
It's right now, with 1.0. Just don't use libraries that require nightly. Libraries are not the language. The language is stable. If your requirement is stability, then use the stable version of rust with stable libraries. That's what I do.
Re:Rust vs. Go by eropple on Thursday January 19, 2017 @02:42AM (#13433888)
Are you unfamiliar with semver and the promises it makes?

This is a rhetorical question, as there's no way you've been around here so long without knowing what it is. For everyone else, however, the notion is that code written for 1.0 will continue to work for additional 1.x releases. It says nothing about iterating on not-yet-baked features--that's what nightly is for, and as they become baked they become part of 1.x releases. They're not breaking backwards compatibility; the major version remains the major version.

Re:Rust vs. Go by bbcbasic on Wednesday January 18, 2017 @08:06PM (#13432066)
Touche! I remember a place where I worked where the first version was 3 because they figured customers wouldn't trust a version 1. I guess these guys went for version deflation.
Re:Rust vs. Go by AsyncAwait on Wednesday January 18, 2017 @06:24PM (#13431476)
Was this project rocket.rs by any chance?

Very few projects require the nightly compiler and fewer still a specific version of it, but rocket is highly experimental and kind of a special case.

Re:Rust vs. Go by dman on Wednesday January 18, 2017 @06:37PM (#13431553)
The simd crate required nightly the last time I tried.
Re:Rust vs. Go by kibwen on Wednesday January 18, 2017 @06:49PM (#13431619)
I talked to burntsushi last week about stabilizing SIMD in Rust, and he says he's got about to release an RFC very soon. :) Due to this, I'm hopeful that stable SIMD will land this year.
Re:Rust vs. Go by dman on Wednesday January 18, 2017 @07:14PM (#13431772)
Thats great news!