12 ms·
Rust 0.10 released
- dmunoz 13y agoI 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?
- eridius 13y agoMost 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 https://news.ycombinator.com/item?id=7525598
- dmunoz 13y ago> 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.
- cmrx64 13y agoThe 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.
- bjz_ 13y ago> 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.
- kibwen 13y agoAgh, you're right! Issue filed: https://github.com/mozilla/rust/issues/13287 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.
- sixbrx 13y agoSo how easy would it be to use Rust to compile libraries to be called from non-Rust systems? I've seen reference to using #[start] and #[no_std] but it wasn't clear with the latter just how much of "std" I'd be giving up? Hopefully that would mean just giving up task spawning and inter-task communication (ok), or would it be everything under the std namespace (not so ok)? Making this easy would be an easy win to get Rust into active use incrementally. Rust would for example be able to do heavy lifting in computations with Python/Cython providing a web front end dispatcher.
- eridius 13y ago#[start] only applies to executables, not libraries. #[no_std] means that no part of libstd would be provided. This is typically expected to be used by, say, kernel developers. libstd itself is statically linked (by default) into your built product, so if you want you can compile your Rust library and use it on a system that has never had Rust installed.
- kibwen 13y agoIt's not very difficult at all to call Rust libraries from other languages by using #[no_std] and exposing a C API. You're correct in that this does currently dispose of the entire standard library, which is rather unfortunate. We're still exploring options for partitioning the stdlib into levels such that you can lose just the stuff that needs a runtime (heap allocation, concurrency) without losing all the other goodies (overloaded operators, iterators, etc.)
- brson 13y agoRust can be called from other languages even with std. The main thing you'll be missing is the ability to handle task failure (which will just cause a process abort), but also protection from stack overflow. For full integration it will require a small amount of runtime API that is yet to be determined.
- kibwen 13y agoI'd really love to see an update to your "Calling Rust from Ruby" post detailing these new features.
- lifthrasiir 13y agoHighlights (no particular order, partially reflects my personal interests): - Managed (GC-ed) pointers are moved to the standard library. There is no special syntax (formerly `@`) nor special header (for vectors containing managed pointers) required. - Special treatments on `str` and `[T]` vectors are being generalized ("Dynamically Sized Types"). - Lifetimes of temporary expressions have changed in somewhat more intuitive way. - Syntax extensions are now exportable, documentable and much more flexible ("procedural macro"). - Language simplifications: `do` syntactic sugar is removed, `priv` is now default, no trait bounds by default (e.g. formerly `:Send` was implied for `~Trait`). - The smart pointer usage has been improved with new `Deref` and `DerefMut` traits. - There are now many auxiliary standard libraries instead of a single `extra` library. - Usual library fixes, redesigns and influx took place. Most prominent change is an introduction of growable vector type, `Vec<T>`, which subsumes the original `~[T]` type. - Rustpkg is gone, long live Cargo! Rustc has also combined many related options into umbrella flags (e.g. `-C`). As prior point releases of Rust did, Rust 0.10 does not represent a significant milestone. It is always recommended to use the most recent development version (master) of Rust, but it had been a great undertaking to compile Rust from scratch. From 0.10 onwards, however, there are official nightly versions [1] and brave souls can play with master more conveniently now. (They are currently not signed yet, so take that in mind.) [1] https://mail.mozilla.org/pipermail/rust-dev/2014-March/009223.html https://mail.mozilla.org/pipermail/rust-dev/2014-March/00922...
- kibwen 13y ago> Managed (GC-ed) pointers are moved to the standard library. Most uses of the old managed pointer scheme have been excised, but not all just yet (though we have people working on it with great vigor and tireless devotion). They're behind a feature flag though, so it's not possible to use them by accident. For example, note that the replacement type in question, std::gc::Gc, is still internally backed by the old managed pointers, although this will not be the case once we finally implement a proper garbage collector. And even then if you really need multiple owners of a single value we'd really prefer that you use our reference-counted pointer (std::rc::Rc) instead, along with weak pointers (std::rc::Weak) if your data has cycles. Reference counting in Rust is generally surprisingly cheap, since the refcount only gets bumped if you explicitly clone the pointer; otherwise the pointer simply gets passed around as an owned value.
- Dewie 13y agoWait, I don't understand these version numbers. Wasn't the previous release 0.9? I was expecting the new release to be 1.0, or 0.91, or something like that. Maybe this is standard practice for all I know.
- aphistic 13y ago10 comes after 9. The previous release was 0.9, not 0.90.
- kibwen 13y agoRust uses semantic versioning (http://semver.org/ http://semver.org/). The number after the dot is simply a minor version revision, and can increment without bound. A 1.0 release of Rust is targeted for later this year. There will be at least one more minor version (0.11), and possibly more, before that point.
- yepguy 13y agoUnfortunately Rust is not actually using semver, which I always found confusing because they seem to be in support of it, and they even include a semver library in the core distribution. If they were following semver, this release would be version 0.10.0 (notice the patch version). The point of semver is to stick to a standard, instead of every project deviating from common practice in subtly incompatible ways.
- Tuna-Fish 13y ago> If they were following semver, this release would be version 0.10.0 (notice the patch version). Actually, since they are doing backwards incompatible changes in every release, this version would be more like 10.0.0. They are deviating from semver for now, I hope they get on it properly for 1.0.0 and beyond.
- yepguy 13y agoYou are allowed to make breaking changes at any time if your major version is zero.
- veeti 13y agoWhat resources would you recommend for learning Rust? There's the official tutorial but I have to admit that the later parts of it go over my head a little bit.
- dmunoz 13y agoIt's hard to say, as it depends on what your previous experience is with similar languages to Rust. Plenty of people are suggesting Rust for Rubyists, which is a good resource. I personally found it too simple, which is not a reflection on the resource but instead what I was looking for. It is likely to be exactly what plenty of people are looking for. I wanted to give some motivation for keeping on at the official tutorial. Some of its contents went over my head initially as well, but I read it again a couple of weeks later, and everything clicked into place. It's a really awesome guide to the language, and the links at the end to guides to various more specialized parts of the language are similarly awesome.
- pcwalton 13y agoRust for Rubyists is a great resource I can vouch for (not just for Rubyists): http://www.rustforrubyists.com/ http://www.rustforrubyists.com/
- duaneb 13y agoI can vouch for this—the overlap between the two languages is mostly the anonymous function syntax.
- mitchty 13y agoTo be sure I think the most similar language to rust would be probably c++. At least I get a distinct "created by c++ developers" whenever I use it. Not that that is a bad thing, just that if you've programmed in almost any imperative language you're fine reading that online book. I'd love to use rust to replace my C stuff in the future if possible once it stabilizes. But until then I am just popping back to that book every other even .N release to have a look-see at progress.
- 13y ago
- kibwen 13y agoCongrats to all developers on the release! Here's a selection of some of my personal favorite changes in this release cycle: * Automatically-generated nightly binaries for all first-tier platforms [1] * Switching the default hashmap over to Robin Hood hashing [2] * Turning on native threading by default, in lieu of the green thread runtime [3] * The removal of conditions in favor of a standardized type for returning I/O results, which will (by default) generate a warning if the result is ignored [4] * The extension of the lifetimes of temporary values, which should greatly reduce the occasions where you have to assign a name to a temporary result in an effort to please the compiler [5] [6] And if you're thrown by the idea that version 0.10 follows version 0.9, know that I voted for 0.A (alas). 1.0 is still expected for later this year, though no promises! Remember, Rust 1.0 is not the milestone when the language is finished, but rather the milestone when backwards-incompatible changes to the language will no longer be made. See the "backcompat-lang" tag on the issue tracker for a list of outstanding blockers. [7] [1] https://mail.mozilla.org/pipermail/rust-dev/2014-March/009223.html https://mail.mozilla.org/pipermail/rust-dev/2014-March/00922... [2] https://github.com/mozilla/rust/pull/12081 https://github.com/mozilla/rust/pull/12081 [3] https://github.com/mozilla/rust/pull/12833 https://github.com/mozilla/rust/pull/12833 [4] https://mail.mozilla.org/pipermail/rust-dev/2014-February/008505.html https://mail.mozilla.org/pipermail/rust-dev/2014-February/00... [5] http://smallcultfollowing.com/babysteps/blog/2014/01/09/rvalue-lifetimes-in-rust/ http://smallcultfollowing.com/babysteps/blog/2014/01/09/rval... [6] https://github.com/mozilla/rust/pull/11585 https://github.com/mozilla/rust/pull/11585 [7] https://github.com/mozilla/rust/issues?direction=asc&labels=P-backcompat-lang&milestone=20&sort=created&state=open https://github.com/mozilla/rust/issues?direction=asc&labels=...
- spicyj 13y agoYour [5] is broken. Looks like it should be http://smallcultfollowing.com/babysteps/blog/2014/01/09/rvalue-lifetimes-in-rust/ http://smallcultfollowing.com/babysteps/blog/2014/01/09/rval....
- jksmith 13y ago>* Turning on native threading by default, in lieu of the green thread runtime [3] Curious about rationale for this. Have details?
- glenjamin 13y agoI've seen it stated a few times that after Rust 1.0 there will be no more backwards compatible changes. Does that mean ever, or just that it'll be stable for some time before people start considering a 2.0 to try and fix whatever warts are discovered from wider usage of 1.0+ ?
- cmrx64 13y agoWe will follow http://semver.org/ http://semver.org/
- kibwen 13y agoIt certainly doesn't necessarily mean ever. Who even knows who will be leading the project ten years from now! But it does mean that it will be quite a while before the hypothetical 2.0 where we could consider breaking backwards compatibility. How long "quite a while" will turn out to be, I can't say. But it will certainly be an improvement over the current situation, where the language breaks about once a week. :)
- ripter 13y agoIs it safe to start learning and using Rust for hobby projects or should I wait until 1.0?
- derekchiang 13y agoYes, lots of people have started using Rust for hobby projects [0] and their feedback has been invaluable to the development of the language. [0] http://rust-ci.org/projects/ http://rust-ci.org/projects/
- hkphooey 13y agoWill there be any impact on Rust due to Brendan Eich quitting Mozilla? How much involvement did he have on the project?
- Havvy 13y agoAFAIK, there will be no changes due to Eich leaving Mozilla w.r.t Rust. If he had any involvement, it was minor.
- Ygg2 13y agoNone, if any. None that can be discerned from emails.
- dbaupp 13y agoNo change: http://www.reddit.com/r/rust/comments/224wgn/eich_steps_down_any_impact_on_rust/ http://www.reddit.com/r/rust/comments/224wgn/eich_steps_down... (The "mozilla" people (brson and pcwalton) are the people to listen to there.)
- pcwalton 13y agoBrian Anderson said it better than I could: Brendan's resignation as CEO will have no effect on Rust or Servo. Many people at all levels of the organization are huge supporters of Rust, Servo, and Mozilla Research in general.
- keeperofdakeys 13y ago
- krick 13y agoMaybe somewhat rude question, but how close to being "ready" Rust is? I mean, should I start using it already if not only for the sake of language itself? How stable is it now? How much it will probably change 'till 1.0? How soon it can be expected to be "production ready"?
- panzi 13y ago1.0 is planned for this year. To the rest I don't know the answer. But you should use Rust so you might find problems and report them, because after 1.0 they can't do breaking changes.
- derekchiang 13y agoThe language will still change a lot before 1.0, so I don't recommend serious usage in production, unless you are prepared for updating your codebase every now and then. However, many people have already started using Rust for personal projects, and their feedback has been invaluable to the development of the language!
- steveklabnik 13y agoThere are three production deployments of Rust that we know about. The language won't change a whole lot, but the libraries will.
- renox 13y ago> how close to being "ready" Rust is? I think that this depends on your expectations, I was quite disappointed to find that there isn't a clean way to make 'unit types' (second, millisecond, meters, etc) in Rust.. I wouldn't use Rust for anything but toy project..
- wfraser 13y ago> there isn't a clean way to make 'unit types' (second, millisecond, meters, etc) in Rust.. Actually, there's this bit on Tuple Structs[1] in the tutorial: > Types like this can be useful to differentiate between data that have the same underlying type but must be used in different ways. struct Inches(int); struct Centimeters(int); [1] http://static.rust-lang.org/doc/master/tutorial.html#tuple-structs http://static.rust-lang.org/doc/master/tutorial.html#tuple-s...
- swah 13y agoI love that the Install button gave me an .exe directly - has it always been like that? I don't remember it being this easy the first time I looked at Rust. Kudos.
- swah 13y agoOh well it isn't that easy: C:\Users\swah>rustc first.rust error: could not exec the linker `gcc`: file not found error: aborting due to previous error
- steveklabnik 13y agoIt was not, that's actually only about a week old.