287 points · by steveklabnik · 11y ago · 140 comments
However, despite that short and distracted development window, we still managed to squeeze out compiler performance improvements that should result in 30% faster compiles for crates in the wild. You can expect even more progress on the compilation speed front for 1.2, due to be released August 6, along with a slew of stabilized and much-demanded stdlib APIs.
Let me also mention that tickets have just gone on sale for the first official Rust conference, a small one-day event in Berkeley: http://rustcamp.com/ We'll be using the experience from this proto-conference as a guide for larger events in the future, so even if you can't go we'd love to get your feedback as to what you'd like to see from a Rust conference.
So, whatever you guys are doing, WRT marketing, you are doing something right.
I don't feel like the docs empower me enough to write multi threaded code comfortably without the borrow checker spitting at me. Is it just me, or does anyone else feel this way?
In addition, we've only had a stable Rust for six weeks: there just hasn't been enough time to write more advanced things. Nobody wants to invest in stuff while things are still changing. As an example of this, I know there's an O'Reilly book coming out in the fall which covers advanced topics exclusively.
A basic task pool isn't too many lines of code: https://github.com/rust-lang/threadpool/blob/master/src/lib.... Hopefully that can help for that case, though obviously, this isn't just a comment about threadpools :)
I'd love a 'learn to write rust with datastructures' style intermediate tutorial.
[1] https://github.com/nrc/r4cppp/blob/master/graphs/README.md [2] http://smallcultfollowing.com/babysteps/blog/2015/04/06/mode...
Could you provide some pointers about how to begin with contributing to the Rust documentation? What are the areas that need the most help or have received the most complaints/confused reactions? I actually like writing docs but I'm not sure where I'd begin. (And of course not super confident in my understanding of Rust in the first place since I'm still learning it myself. But I know a lot more than someone looking at it for the first time.)
Currently, the areas that need most help fall into two categories: intermediate/advanced docs, and API documentation. The latter is an easier place to get started, I'd imagine. Hence my suggestion of examples.
We also have the A-docs tag: https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Ais... Some of these are actually pretty easy, I tend to let the pile up and then knock out 10+ in a day if nobody else gets them first.
I can get more specific than that if you'd like, but I think that's a pretty decent high-level overview.
I have another exciting documentation-related announcement in the pipeline, but I'm currently waiting on some lawyers...
Also, doc comments run as tests too, so https://github.com/rust-lang/threadpool/blob/master/src/lib.... will actually get executed as a test.
I started using Rust exclusively for hobby projects after the 1.0 release, to force myself to learn the language, but I found myself running into compiler panics on nearly a daily basis.
Admittedly, the code the compiler tended to crash on was very macro-heavy, but a goal of rust is safe macros. (And even if the macro-expanded code was invalid, the compiler should just report an error, not crash).
There are currently 207 open issues regarding ICE (Internal Compiler Error): https://github.com/rust-lang/rust/labels/I-ICE
If you're running into ICEs or any other bug, please either open up a ticket or :+1: the ticket that exists. It helps to know which things are biting people more often.
Trust me, there are far worse things lurking in the compiler than a few improperly-handled error cases.
I think it is also important to recognize that all compilers have this problem and they all stabilize over time. It is an issue orthogonal of safety. These aren't segmentation faults or some kind of memory error but the compiler signaling an internal invariant was violated.
This can happen easily because we are writing a very large program that reads user input, interprets it, and tries to emit a program.
This can happen in multiple situations. One example is the compiler may have a logic bug that violates an internal invariant resulting in an ICE (instead of emitting incorrect code).
Other times it is as simple as the code we have been given is invalid and the error wasn't properly handled, and you end up seeing it in a non-user friendly way (as an ICE).
We are working hard to move the compiler to a more modern, robust design as soon as possible but even with a great design it will be an iterative process that we continue to do over the lifetime of the language, just like everyone else.
Longer answer: The Rust compiler was written in Rust before the Rust language was even what it was today. As one particular example, the AST used to be garbage collected! And when you have a codebase that's 320,000 lines long, you don't update the entire codebase to the latest idiom, because if you did, you'd never actually ship the language.
Basically no other Rust program will ever have to contend with this kind of situation. As such, while I can sympathize with this line of argument, I don't think it's representative.
EDIT: I previously had 750,000 but it's actually 323,326 LOC as of right now. Whoops!
For example, here's about the worst rustc crash I've found: https://github.com/rust-lang/rust/issues/21946. It doesn't even give you an ICE, it terminates with a stack overflow.
So no, Rust cannot magically fix logic errors in large, complicated codebases, but that's not something that a complete beginner needs to worry about thankfully.
http://doc.rust-lang.org/nightly/std/primitive.str.html
It's unfortunate that most of the links navigate you to the less useful doc.
You can either remove "Source Code Pro" from your box, or use Tampermonkey / Greasemonkey to remove it from the markup.
To take the given example, I would start at http://doc.rust-lang.org/std/ and hit `s` to start a search. Searching for `str::lines` gives http://doc.rust-lang.org/std/primitive.str.html#method.lines as the second result, which has the two methods conveniently next to each other, succinctly explains them, and shows an example of using each one.
I've had good luck with docs for the few third party libraries I've tried so far too. The recommended doc generation creates pages in the same format as the std docs, so as you get comfortable navigating them you get comfortable navigating many third party docs as well.
The specific issue you're talking about is due to using Markdown rather than ReST, basically. We didn't manually link those methods, but probably could.
In general, the API docs could use a lot of work. There's always so much more to do.
One question though. When is Cargo going to be available on FreeBSD (and other BSD's)? I think these platforms are significant in the server space where Rust would be highly relevant. Having Rust usable there would likely augment uptake of the language.
Don't hold me to that.
> The tl;dr; of this change is that there is a new target of the compiler,
> x86_64-pc-windows-msvc, which will not interact with the MinGW toolchain at
> all and will instead use link.exe to assemble output artifacts.
We're very interested in improving support so that you can use VS's features fully. These are just first steps.Also note that the Rust team tests all the crates before making a (minor) breaking change to see the impact of the breakage to the ecosystem. (possibly "popular crates only", when the ecosystem grows huge in the future)
It is true that Rust, like all actively-maintained languages, can make changes that are theoretically breaking if all evidence strongly suggests that no code is actually going to break.
If I could go back and edit I would -- but it has been too long.
My freedom to dress as I want does not mean it is reasonable to demand to be treated equally when I am wearing a garbage bag to a meeting.
My freedom to not shower does not mean it is reasonable to demand to be treated equally when I stink up the place. Instead it is entirely reasonable to ask me to leave.
If a community manager asks people who express toxic opinions to leave, that is entirely reasonable. It's their job in fact. And make no mistake, the opinions of others you have linked to as being "suppressed" are toxic, so much so that in many countries [1] they would be considered illegal.
[1] And I am talking about countries that rank significantly higher than the US on the press freedom index:
https://en.wikipedia.org/wiki/Press_Freedom_Index#Rankings_a...
And outscore the US on the freedom house report on both civil liberties and political rights:
https://freedomhouse.org/report/freedom-world/2015/germany#....
https://freedomhouse.org/report/freedom-world/2015/united-st...
So please save your "Europeans don't care about freedom of expression" tropes.
Steve's been nothing but extremely polite and helpful in every interaction I've seen him have in the Rust community. He's only ever fought for inclusiveness and respect. How about giving him the benefit of the doubt, and admitting he's good for the community.
I believe he's already contributed a lot to the culture of inclusiveness and friendliness in the community that you mention you'd be bothered to be "ostracized" from.
amongst more
It is especially troubling to have a community leader who equates speech with violence, even "hate" speech, which in that gist is clearly demonstrated to be completely subjective.
And btw, this "legitimizes slavery" is bullshit. This is the article in question.
http://unqualified-reservations.blogspot.co.uk/2009/07/why-c...
Opensource Swift is only few months away and it already has a much bigger user base and is backed by the biggest company in tech. Rust & Swift share many common traits and kinda look alike as well.
Why should anyone pick Rust over Swift when Swift will be able to do everything Rust can do and is also positioned as a systems programming language? And Swift will also be a full-stack programming language and you will be able to program apps and backends with it.
I feel like Rust is about to get killed. And killed quickly.
Swift isn't going to penetrate to the bottom of the stack with pervasive reference counting. You'd either have to start managing memory manually (as per C) or implement a borrow checker (as per Rust), and even then your entire ecosystem is still going to use reference counting pervasively due to the language's defaults. One of the benefits of Rust defaulting to linear types and borrowed references is that it creates an entire package ecosystem where dynamic memory management is the exception, not the rule.
For the record, I think Swift is super fantastic as a language and I'm thrilled that it's going open-source. I think the two languages will work swimmingly together. :)
I would formulate this a bit milder: many desktop applications are written in C++ and many system applications (e.g. UNIX command-line tools) could be written in Swift or Go. So, there are certainly areas where C++, Rust, Go, and Swift are or will be in competition.
Of course, if you require strong safety guarantees and the absence of a garbage collector, Rust is probably the only modern option.
No, it's optional if you don't need to interact with Obj-C frameworks (ie. Cocoa). And memory is not managed dynamically. Swift uses ARC.
Like I said, I just don't see Rust sticking around for long. Swift will suck all the developers out of it since you'll be able to actually get a job programming in Swift.
If anything, Rust is the only modern language that's not threatened by Swift, by virtue of existing at a level of the stack that's so low as to be out of Swift's reach. I agree that Swift is going to be huge, but you're mistaken as to who its competitors are. :P
Rust provides dynamic memory management too, but you aren't forced to use it and most use it for a few variables only.
So far nothing I've seen about Swift tells me that it will be able to be used for things like Servo and other perf-critical applications. Yes, it might edge out Rust webdev, but not much more.
"You cam get a job in swift" is largely due to its iOS backing. I'm not so sure how that's going to apply to other OSs especially if Cocoa and co aren't made open source.
(And I like Swift and think their development team is really cool.)
By how much? Will extra language codebase justify the speed increase (if any)?
Say you're developing some mobile app, why wouldn't you want to use a single unified codebase for front & backends instead of splitting it across Rust and Swift?
I was somewhat disappointed when Apple shipped Swift; I feel like Rust has considerably more potential as a general purpose language, and it would be nice to have less dilution of effort in fairly similar space.
However, I don't think that the existence of Swift is an existential threat to Rust.
> Swift will be able to do everything Rust can do and is also positioned as a systems programming language
Swift is an interesting language, with some good ideas, and in many ways easier to use for application programming than Rust; but I still, on balance, think that Rust is more interesting and versatile.
Swift is not really a systems programming language. You can't write a kernel in Swift, nor target embedded platforms, nor write a library that could be called from other languages like Ruby or Python (at least, without bringing in the whole runtime as well). It's closer to the space of Go, a more systems-y application language.
Furthermore, open source Swift does not mean you will be able to use the whole ecosystem on other platforms. I highly doubt that Apple will port Cocoa/Cocoa Touch to other platforms; so Swift on other platforms will likely only be viable for back-end code.
Objective-C has been open source for years, and until the introduction of Swift was the dominant language of choice for writing code on one of the most popular smartphone platforms, but Apple canned cross-platform OpenStep when they bought NeXT, and Objective-C has never made serious inroads on other platforms (I know exactly one person who writes production, server-side code in Objective-C on Linux).
So, I could see Swift becoming popular for writing backends for iPhone applications, but I can't imagine that it will make serious inroads in other spaces, unless Apple makes a dramatic change in strategy and starts shipping their UI libraries on other platforms as well.
They do feel like quite similar languages; I'd think of them as a complementary Systems/Applications pair.
Go has to contend with Swift. Rust does not.
(Also, there are concerns about Swift's usefulness on non-apple platforms if the libs aren't completely open source.)
During the WWDC 2015 opening keynote, Federighi explicitly stated that Swift's a "systems programming language" and they even say it in the documentation:
> It is the first industrial-quality systems programming language that is as expressive and enjoyable as a scripting language.
https://developer.apple.com/library/ios/documentation/Swift/...
Swift calls itself a systems language. Rust/C++ call themselves systems languages. The two sets use those words to mean different things.
Well, honestly, that's just what I thought about C/C++ in comparison to some 'newer' programming languages like Go, Rust (and also Swift, maybe? I don't know enough about Swift yet).
Personally, I would only use Swift if there was an easy way to write cross-platform (mobile) software with it. It's as simple as that.
Because Swift can't do everything Rust can do. It's missing its biggest features.
Like what? Please do enlighten us.
It also means that, like other managed languages, Swift objects that have references taken to them (classes) must in general be allocated on the heap. This means that, unlike Rust but like many higher-level languages, controlling allocations can be difficult and heavily dependent on the whims of the optimizer. Some of Swift's implementation decisions (like copy on write arrays) also suffer. The inability to avoid allocations, combined with much less efficient allocations than are possible with tracing GC, are among the reasons that reference counting is uncommon in production languages (though the Immix collector does very well).
You can certainly write code in the unsafe dialect of Swift that is just as fast as Rust, C, or any other language. But like unsafe mode in Rust, this won't be the common mode of use in Swift.
Python and Ruby are pretty similar languages overall, but neither has "killed" the other. Why? Because despite their similiarities, they offer different things. I generally prefer to use Python over Ruby, no real reason for it, I just prefer the language. With Rust and Swift, there are some pretty major differences that can't be waved away as personal preference, Rust's borrow-checker isn't something Swift can integrate overnight (and wouldn't likely do) and Rust can't just grow some ARC equivalent (and almost certainly won't).
And hey, some of my favorite minor features for Rust are cribbed from Swift. Namely `if let` and `while let`. I'm not scared of a little competition, keeps us on our toes and makes sure we keep looking for ways to improve the language and ecosystem.
Rust also has the equivalent of ARC in the form of the Rc and Arc containers, Rc does reference counting without atomics, Arc with atomics (for when you need to do reference counting with thread safety).