News for hackers. Stuff that matters.
Re:One year of Rust by grenoire on Monday May 16, 2016 @02:22PM (#11708371)
One year since stable? It feels like five years for the level of maturity they have achieved.
Re:One year of Rust by merb on Monday May 16, 2016 @02:25PM (#11708405)
Except the tooling, could be better. A language like Rust will benefit from a rich IDE a lot.

But still the language is great.

Re:One year of Rust by Lewisham on Monday May 16, 2016 @03:27PM (#11708913)
I'd say rustdoc is pretty rough. It's very hard to navigate the rust stdlib vs, say, Go, and when you do find what you want, it's often specified in some very cryptic manner that seems to require a PL PhD.

It is a really big barrier to adoption because it's very hard to find out what functionality is or is not offered. Here's an example: I want to iterate over a set. Easy, right?

No.

http://static.rust-lang.org/doc/master/std/collections/hash_...

Look at the signature for Cycle. It's really hard to know what this does even though it's trivial:

fn cycle(self) -> Cycle<Self> where Self: Clone

When you click through to the real documentation, it describes a useful use case for this. But that's not how programmers think. They think "I need to do X right now so I'll find something that looks right" not "I'm going to click through the documentation... oh X looks interesting I'll remember that later". There's no way to infer what Cycle really does without having actually clicked through or used it.

Re:One year of Rust by TheHydroImpulse on Monday May 16, 2016 @03:52PM (#11709099)
I actually get the opposite feeling. Maybe that's because I'm so used to rustdoc now, but it's super easy to find everything. Go's doc tool seems like just a giant dump of API signatures.

Rustdoc isn't perfect, but it's pretty easy to find things imo.

Re:One year of Rust by pcwalton on Monday May 16, 2016 @04:27PM (#11709342)
> fn cycle(self) -> Cycle<Self> where Self: Clone

I agree that a summary would be good, but this doesn't require a PL Ph.D. It means "cycle is a method that moves its receiver and returns a Cycle object of the same type of the receiver, and only works if the receiver is cloneable". The trickiest thing here, IMHO, is move semantics, which is something fundamental to Rust in general.

Re:One year of Rust by vvanders on Monday May 16, 2016 @04:41PM (#11709431)
Yup, I've got the same feeling here.

If you've spent more than a cursory time with Rust this is pretty straightforward.

You'd represent this in Java(minus move semantics, because Java has nothing like that) via:

  class IntoIter {
    public Cycle<T extends Clone> { ... }
    ...
  }
Where Clone is just an interface that knows how to clone its value.
Re:One year of Rust by Lewisham on Monday May 16, 2016 @05:11PM (#11709659)
Fair enough; some more noodling over the signature made it a bit more obvious than it seemed banged out at the back of an OSCON presentation.

I think the point still holds. Maybe just not for that one.

Re:One year of Rust by vvanders on Monday May 16, 2016 @05:21PM (#11709725)
The thing is what you linked is the docs of an implementation not the interface.

I guess I've just had a different experience. I come from almost no PL/ML background and I've found the Iterator interface in Rust(along with Option/Result) to be some of the most impressive, clear things about the language.

Re:One year of Rust by megrimlock on Monday May 16, 2016 @07:22PM (#11710363)
Perhaps there's room for a rust equivalent of cdecl, a tool to map rust to plain English descriptions, offering a gradual onramp to the syntax.

This kind of thing seems silly to experts but could raise the rate at which folks make it through language learning funnel.

Re:One year of Rust by Manishearth on Monday May 16, 2016 @06:43PM (#11710214)
I'm surprised, I find Go's doc generator to be very rudimentary. For example, you can't find the implementations of an interface, and given that interfaces are used often I have to resort to grepping the code to see what it means.

> I want to iterate over a set. Easy, right?

yes, it is easy, `for value in &set {}`. Not sure why you went all the way down to `Cycle`

In this case I agree that perhaps rustdoc should note that a full description should be alluded to (the full description of Cycle is on the Iterator trait's docs), but it's still IMO much better than go

Re:One year of Rust by steveklabnik on Monday May 16, 2016 @03:28PM (#11708927)
If you (or anyone really) has specific thoughts here, that'd be super great. Rustdoc's output could use a lot of love, but we haven't figured out exactly what we want to do with it. And having worked with it daily for a few years now, I'm personally a bit blind to its shortcomings.
Re:One year of Rust by Lewisham on Monday May 16, 2016 @03:35PM (#11708981)
Specific thought: Trait implementation pages like http://static.rust-lang.org/doc/master/std/collections/hash_... should output the first paragraph of the documentation text. That way you can easily scan/Ctrl+F through the documentation that's right next to the struct you're interested in. Reduce the number of clicks and context switches.

It's just a pretty terrifying way to output right now.

Re:One year of Rust by steveklabnik on Monday May 16, 2016 @03:45PM (#11709058)
Ah, just saw your edit. So, to be clear about what you mean, you want the Iterator implementation to show the summary line on this page? Seems reasonable to me! I filed a bug: https://github.com/rust-lang/rust/issues/33672

(Also, that page is a bit sparse because I haven't gotten around to writing any docs for it yet, so it's just the autogenerated stuff.)

Re:One year of Rust by Lewisham on Monday May 16, 2016 @04:23PM (#11709316)
Yeah, once you actually get to the text, it's really good and clearly improved from 12 months ago when I last got the free time to play around significantly.

Thanks for the bug ticket :)

Re:One year of Rust by Manishearth on Monday May 16, 2016 @09:28PM (#11710794)
Re:One year of Rust by blaisio on Monday May 16, 2016 @04:42PM (#11709439)
I agree that the rust docs need work, but I disagree with your example. cycle is just a method defined as part of the Iterator implementation - it's just like a method you might define to implement an interface in Java. JavaDocs actually have the same layout as the Rust documentation in this case: you have to actually click on the method to find out how it works. This is also how docs for other languages are often laid out as well.
Re:One year of Rust by sargun on Monday May 16, 2016 @02:33PM (#11708474)
I really wish that Jetbrains had a Rust IDE. I love their Go, and Erlang plugins for IntelliJ, Java with IntelliJ, and Clion with C. Without them, I don't think I could be anywhere as effective as I am.

I tried to pickup Rust, but I was super frustrated by the code/compile/run cycle with the current plugin. But, hopefully more users will make that better.

Re:One year of Rust by EugeneOZ on Monday May 16, 2016 @03:31PM (#11708947)
There is unofficial plugin: https://github.com/intellij-rust/intellij-rust and works very well: https://www.youtube.com/watch?v=mHa7QlFz7io (small video recorded by me)
Re:One year of Rust by jdright on Monday May 16, 2016 @04:40PM (#11709420)
Is that Racer happening? It look like there is still a lag in the completion suggestion... and that is a huge problem (mainly when using it as to find things).
Re:One year of Rust by EugeneOZ on Monday May 16, 2016 @05:21PM (#11709735)
No, this plugin works without Racer. I use it every day and I don't see any problems with code completion. Except of cases where code completion isn't supported yet :) But it's all personal and better to try - it's free.

To clarify: I'm not author of this plugin.

And I tried Racer with Microsoft Visual Code plugin - it works without any lags, very fast. Just fails sometimes :)

Re:One year of Rust by grenoire on Monday May 16, 2016 @02:37PM (#11708502)
Jetbrains Rust IDE would genuinely make Rust my go-to language for pretty much every task I can think of.
Re:One year of Rust by PascalW on Monday May 16, 2016 @02:51PM (#11708624)
Couldn't agree more! There's some work ongoing on a third party Rust plugin for InteliJ but it still has a long way to come.
Re:One year of Rust by AsyncAwait on Monday May 16, 2016 @02:52PM (#11708629)
Not as great as a full IDE, but Atom.io + tokamak(https://vertexclique.github.io/tokamak) + atom-ctags(https://atom.io/packages/atom-ctags) get you a decent editor/light IDE setup.

I agree however that it would be nice to have ie lifetimes visualized and stuff like that, hopefully sometime soon...

Re:One year of Rust by jonesetc on Monday May 16, 2016 @02:31PM (#11708456)
I'd say the tooling is pretty great only with the exception of an IDE. Debugging, building, testing, packaging all seems pretty well handled.
Re:One year of Rust by msbarnett on Monday May 16, 2016 @03:32PM (#11708950)
> Debugging, building, testing, packaging all seems pretty well handled.

Eh, debugging is a mess, at least on OS X. Rust advertises LLDB support, but it seems semi-broken. Listing source is non-functional and just setting a break-point requires a lot of hand-holding.

Re:One year of Rust by pcwalton on Monday May 16, 2016 @04:20PM (#11709289)
Bug reports of specific problems would be very appreciated! We emit fairly complete DWARF, but debuggers tend to be finicky about the exact subset of DWARF they accept.
Re:One year of Rust by msbarnett on Monday May 16, 2016 @04:36PM (#11709397)
I'll try to submit a report later. It's exactly what it sounds like, though.

    $ cat hello.rs
    fn main() {
	println!("Hello world!");
    }
    $ lldb -v
    lldb-350.0.21.9
    $ uname -a
    Darwin mycomp 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64
    $ rustc --version
    rustc 1.8.0
    $ rustc -g hello.rs
    $ ./hello
    Hello world!
    $ lldb hello
    (lldb) target create "hello"
    Current executable set to 'hello' (x86_64).
    (lldb) source list
    (lldb)
    (lldb) b 2
    error: No selected frame to use to find the default file.
    error: No file supplied and no default file available.
I don't see how the core team could be unaware of this unless literally no one has done even a cursory glance at OS X & LLDB in months.
Re:One year of Rust by Manishearth on Monday May 16, 2016 @06:38PM (#11710191)
I think this is a known issue relating to some lldb versions no longer treating unknown languages as C; which got fixed in lldb upstream but may not have been released yet.
Re:One year of Rust by pcwalton on Monday May 16, 2016 @04:39PM (#11709415)
Well, I do use it regularly for testing Servo. There's a debugger harness run as part of the test suite too. (Not to say we shouldn't fix whatever is causing your problem, though!)
Re:One year of Rust by msbarnett on Monday May 16, 2016 @04:46PM (#11709480)
I can make it work if I feed full file paths to the debugger using syntax I can't remember off the top of my head. Maybe that's one way some scripts might be functioning?

I'll copy and past this into a Github issue when I have a sec.

edit: https://github.com/rust-lang/rust/issues/33674

Re:One year of Rust by pcwalton on Monday May 16, 2016 @05:07PM (#11709638)
Thanks! Forwarding to the appropriate people.
Re:One year of Rust by merb on Monday May 16, 2016 @02:41PM (#11708532)
packaging will work great if you don't rely on any unicorn library that will put their dylib/so files in some ugly path's that aren't standard. (FFI only) actually not the worst thing for most people, but linking against a paid library will mostly end up with setting LD_LIBRARY_PATH at some point.
Re:One year of Rust by blakeyrat on Monday May 16, 2016 @04:18PM (#11709270)
Ok, maybe I've been too spoiled by Visual Studio, but debugging without an IDE? That sounds extremely painful to me.
Re:One year of Rust by krisdol on Monday May 16, 2016 @02:46PM (#11708589)
A big pain is still JIT compilation. Last time I used rust, even small changes to code required a full re-compilation.
Re:One year of Rust by steveklabnik on Monday May 16, 2016 @02:49PM (#11708606)
To be clear: Rust doesn't have a JIT. But we've been doing a lot of work on incremental recompilation, which will fix this problem. (Or rather, we've been working on the precursor requirement, MIR.)

To be extra clear, a crate is the unit of compilation in Rust, so changing your code means that the whole crate it's in needs recompiled; your dependencies won't be. Or, if your project is split up into multiple crates, the other ones won't. Incremental recompilation will reduce this level of granularity such that the whole crate won't need to be recompiled.

Re:One year of Rust by matthewmacleod on Monday May 16, 2016 @02:51PM (#11708625)
Are you sure you mean JIT rather than incremental compilation? The former is a pretty different concept that AFAIK Rust has no implementation of.

I think we are likely to see better incremental support with the recent development of MIR, but I'm not sure what the current plans are. Should help tooling around the language generally!

Re:One year of Rust by krisdol on Tuesday May 17, 2016 @11:36AM (#11714505)
You are correct. I doubted JIT was the right word at the time but couldn't think of the right term. Incremental support is what I mean.
Re:One year of Rust by josteink on Monday May 16, 2016 @02:54PM (#11708652)
> Except the tooling, could be better. A language like Rust will benefit from a rich IDE a lot.

I just found this link[1] for a pretty complete Emacs IDE-like setup the other day. I'm not a Rust programmer, but it seemed promising enough that it made me want to give it a spin.

[1] http://julienblanchard.com/2016/fancy-rust-development-with-...

Re:One year of Rust by tracker1 on Monday May 16, 2016 @03:07PM (#11708768)
Replied in the wrong child.... May want to give VS Code + RustyCode[1] extensions a look.

[1] https://github.com/saviorisdead/RustyCode

Re:One year of Rust by shmerl on Monday May 16, 2016 @03:01PM (#11708714)
I'm not into IDEs, so that doesn't bother me. But by tooling I'd understand cargo. It is improving.
Re:One year of Rust by vvanders on Monday May 16, 2016 @03:12PM (#11708801)
I actually find the tooling to be quite decent. VSCode + Racer has worked pretty well for me so far.
Re:One year of Rust by nemaar on Monday May 16, 2016 @02:30PM (#11708445)
With this speed of development, I'm pretty sure it is coming.
Re:One year of Rust by merb on Monday May 16, 2016 @02:32PM (#11708470)
actually idea-rust made great progress, yes.
Re:One year of Rust by steveklabnik on Monday May 16, 2016 @02:26PM (#11708421)
Rust has been in development for almost a decade at this point; but the language changed significantly many times before 1.0. It's been one year since the 1.0 release, which is the language we know today as "Rust". All those older languages are dead and gone now.

I'm actually doing a talk about the ACM's Applicative conference in NYC this year talking about the history of Rust.

Re:One year of Rust by kibwen on Monday May 16, 2016 @04:09PM (#11709206)
For the record, I take issue with the "almost a decade" label, development on Rust didn't start in earnest until 2010 at the earliest. :P It's about as misleading as saying that Go is 40 years old just because its commit graph goes back that far (https://github.com/golang/go/graphs/contributors).
Re:One year of Rust by steveklabnik on Monday May 16, 2016 @04:34PM (#11709383)
It depends on how you define "in earnest". Graydon started in 2006, which is a decade, though obviously it was very slow at first. My "almost" is an almost because of those personal project years. YMMV of course :P
Re:One year of Rust by laughinghan on Monday May 16, 2016 @07:59PM (#11710506)
The 4 commits before 2008 are pretty clearly not development on Go in any sense, they appear to be Brian Kernighan playing with the syntax and styling for a C "hello world" program: https://github.com/golang/go/commits/master?page=810

No one would say those commits show he was working on Go as a "personal project" during that time.

Re:One year of Rust by kibwen on Wednesday May 18, 2016 @06:33PM (#11726567)
And I guarantee that none of the Rust commits from before 2011 survive to this day, because the compiler was rewritten from scratch in 2011. :P A different argument could say that Go dates back to 1995, because Go is essentially an evolution of Rob Pike's language Limbo.
Re:One year of Rust by russellbeattie on Tuesday May 17, 2016 @03:36AM (#11711886)
So maybe you know why it's called 'rust'? I can't find any reference to it. Such a horrible name for a new programming language.
Re:One year of Rust by steveklabnik on Tuesday May 17, 2016 @10:32AM (#11713946)
There's no one reason. One is the "rust" group of fungi. Another is that Rust isn't cutting edge; it uses ideas that have been around a while. And so on.
Re:One year of Rust by monocasa on Monday May 16, 2016 @02:42PM (#11708551)
Will that talk be available online at some point?
Re:One year of Rust by steveklabnik on Monday May 16, 2016 @02:44PM (#11708567)
I hope so. I gave it at FOSDEM in 2015, only intending to give it one time, and then they lost all of the video from the keynote track :( So I'm giving it again there to hopefully get it on the record.
Re:One year of Rust by richardfontana on Monday May 16, 2016 @03:57PM (#11709130)
That was a really good talk, one of the highlights of that FOSDEM for me.
Re:One year of Rust by steveklabnik on Monday May 16, 2016 @04:02PM (#11709168)
Thanks so much! I was so sad when they lost the recording :(
Re:One year of Rust by jandrese on Monday May 16, 2016 @02:38PM (#11708518)
This is one thing that's a little annoying to me. I know if I develop a Rust app today I can't leave it alone or it will decay horribly.
Re:One year of Rust by pcwalton on Monday May 16, 2016 @02:43PM (#11708556)
> This is one thing that's a little annoying to me. I know if I develop a Rust app today I can't leave it alone or it will decay horribly.

No, it won't. Rust has been stable since 1.0, as the article itself mentions.

Re:One year of Rust by tatterdemalion on Monday May 16, 2016 @02:43PM (#11708565)
Good news for you: this is a complete misconception. Rust has been stable for a year. With a minor caveat for actual bugs in the language, your code will compile on all Rust 1.X compilers from now until the end of time. Upgrading Rust versions has been a breeze.
Re:One year of Rust by kzrdude on Tuesday May 17, 2016 @05:38PM (#11717696)
You're overstating the stability guarantees. The Rust project has formulated it as “hassle-free upgrades” which seems to imply that small, simple edits may be necessary when upgrading to a new Rust version.
Re:One year of Rust by steveklabnik on Tuesday May 17, 2016 @07:42PM (#11718551)
That's only for changes that are important, though: we don't make unnecessary changes.
Re:One year of Rust by kzrdude on Thursday May 19, 2016 @02:07AM (#11728338)
Agree. It's important to underscore what was promised and what was not. Otherwise you might get the impression that a promise was broken (when it was not).
Re:One year of Rust by AsyncAwait on Monday May 16, 2016 @03:01PM (#11708715)
That was true prior to last year's 1.0 being released, but since then code no longer breaks, (in any major ways anyway, there's been some soundness fixes for the good of the language's future). Also, the Rust teams runs any potentially breaking changes against the crates at crates.io and they even sent fixes to existing crates in the past.
Re:One year of Rust by Animats on Monday May 16, 2016 @02:44PM (#11708570)
That's gotten much better since 1.0. Prior to 1.0, you needed to revise your Rust program about once a week so it would compile. Now the language has settled, but the libraries are still churning.

One of the big advantages of Go is that it comes with a coherent set of libraries from a single source (Google) that do most of the things you'd want to do on a server. Rust is more like Python; many people write libraries, many of which overlap and some of which work.

Re:One year of Rust by pcwalton on Monday May 16, 2016 @02:51PM (#11708617)
The advantages of having a distributed ecosystem vs. having a monolithic standard library is an extremely polarized topic, and I don't want to start that debate.

But I do want to emphasize that Rust libraries follow semver, and the lock features of Cargo mean that your builds are always reproducible and you upgrade only when you want to. Your code will never stop compiling one day just because some library "churned".

Re:One year of Rust by jayflux on Monday May 16, 2016 @07:54PM (#11710480)
"Rust is more like Python; many people write libraries, many of which overlap and some of which work."

Odd comparison, Python actually has quite a comprehensive, well used standard library, which usually gives you enough to get going.

Using NodeJS as an example would've made more sense, where most libraries/modules are user written.

Re:One year of Rust by steveklabnik on Monday May 16, 2016 @02:41PM (#11708541)
That should not be true. 1.0 meant that we stopped breaking things on a daily basis, if your code runs on stable today, it should run on stable tomorrow, modulo any soundness fixes (of which we have had two or three this year, which were all trivial to update).

If it is true, please file bugs. We do our best not to break people's stuff, going to pretty extreme lengths compared to many other ecosystems.

Re:One year of Rust by kzrdude on Tuesday May 17, 2016 @05:34PM (#11717661)
and occasional other breaking compiler bug fixes that are not really soundness fixes.
Re:One year of Rust by quarterto on Monday May 16, 2016 @02:26PM (#11708409)
Well, it has been around for about that long. The "one year" is since the stable release 1.0.
Re:One year of Rust by grenoire on Monday May 16, 2016 @02:36PM (#11708495)
I meant since the stable release in fact.
Re:One year of Rust by deutronium on Monday May 16, 2016 @02:25PM (#11708404)
I was confused by that, apparently it's one year since the first stable release.