Hacker News new | past | comments | ask | show | jobs | submit login

I must have misunderstood what was changing in rust re: pointer types. My understanding was that managed boxes using the sigil @ were being removed, and GC moved to the standard library std::rc::Rc.

When I last read the tutorial, I read master instead of 0.9, and thought that the existence of the managed box in the tutorial was only due to it not yet being updated. But the 0.10 tutorial retains references to managed boxes using thee sigil @.

Is the tutorial not yet updated? Did @ not get removed from the core in time for 0.10? Or did I just misunderstand what is actually happening?




Agh, you're right! Issue filed: https://github.com/mozilla/rust/issues/13287

You're correct in that @ has not yet entirely been removed from the core language, because some old vestiges of its use in the compiler itself (specifically the AST) have yet to be removed. In order to actually use them nowadays, though, you have to opt-in with an attribute in your source file, so it's not possible to use them without being explicit about it. And we're certainly not encouraging anyone to actually use them, which is why it's quite embarrassing that mentions of them managed (heh) to slip through in the tutorial.


Most likely the tutorial didn't get updated. It doesn't get a lot of love.

kibwen already posted[1] more details about @ in Rust 0.10, but the short of it is, @ still exists but is gated behind a feature flag. Code that uses it is still being updated. The functionally equivalent replacement is std::gc::Gc, but you should consider std::rc::Rc for reference counting instead (which supports weak references).

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


> Most likely the tutorial didn't get updated. It doesn't get a lot of love.

Ah, that's a shame. I actually just mentioned the tutorial as an awesome resource in another comment.

Maybe my understanding of the Rust language isn't as good as I thought it was, as most of it comes from reading the tutorial and the related guides linked at the end.

I'm a big fan of high quality documentation, and I assumed since the current tutorial was so well written, it was being handled actively already. This is actually one area I would love to step up and help Rust with. I've previously gone so far as to read some of the compiler implementation, but my experience with programming languages is still stuck in the interpreters stage, so it didn't get very far.


The guides are up-to-date and maintained, but the tutorial itself is long, bulky, and ill-maintained. There is a contractor working on rewriting it.


> I've previously gone so far as to read some of the compiler implementation

The guys on #rust-internals are super nice and can help you a great deal if you are interested. But tbh, we really need more contributions with respect to documentation. Again #rust-internals can guide you if you are interested in lending a hand.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: