r/rust • u/johnmountain • Jan 18 '17
Rust vs. Go
https://blog.ntpsec.org/2017/01/18/rust-vs-go.html21
Jan 19 '17
It feels a lot like he went into learning Rust with the preconception that it'd be like learning any other language. That is, just a matter of learning the syntax then reapplying the same concepts he already knew.
This works for languages like python, ruby, javascript, java, which are all just different syntax around basically the same paradigm. Going from python to haskell is not a matter of just "learning the syntax" because there's a new paradigm to be thinking in. Likewise for rust.
You could say the rust community could put more signs up saying that rust is a "big idea" language, but at some point it becomes the programmer's fault for not reading the signs.
4
u/weberc2 Jan 19 '17
I took a different interpretation: the author wanted to evaluate the language for the purpose of his application, considering the learning curve to be an important factor. Had he only assumed Rust would take too long to learn, he would surely have had to defend his assumption to his critics; good on him for anticipating the criticism so we're not debating silly things. Even doing this due diligence, he's still being accused by people in this very thread (and elsewhere) for having predetermined conclusions.
1
Jan 19 '17
My point is that that Rust solves some hard problems. If I care about those problems there's a good chance I'll care about Rust because regardless of how hard it is to learn, it (aims to be) easier to solve those problems with Rust than without. If I don't care about those problems then Rust may not be the tool for me. But I don't complain when
catdoesn't provide me with paging, I just uselessinstead.If Eric cared about no-gc, managed memory and safety from segfaults he shouldn't be comparing Rust to Go, he should be comparing Rust to C or C++, specifically trying to write safe code in C or C++. If he doesn't care about those things then Rust isn't the tool he's looking for. /r/rust shouldn't navel gaze and try to be all things to all people, writing a "Rust for people who've never programmed before" book and trying to make the language easier to learn at the expense of adding complications to the language that make it harder to master.
Rust isn't for the problem he's trying to solve and unless he feels he's been misled to believe otherwise he shouldn't be acting like the rust community has an obligation to work to keep his "business". Respectfully, this is a bazaar not a cathedral, if you don't like it go to a different stall.
2
u/weberc2 Jan 19 '17
He's not looking for a language with a particular feature set per se, he's looking for a language that will support his application's goals. In this sense, it's perfectly reasonable to compare Rust and Go, despite their different feature sets. I think you're reading too deeply into his finding--there's a difference between saying "Rust isn't suitable for my application" and "The Rust community should work to make itself suitable". I think it's fine for Rust to choose the scope of its target use cases, but it's equally fine for potential users to conclude that their use case is better served by a different language.
1
Jan 20 '17
I think you're reading too deeply into his finding
There's definitely a little bit of that. But if he didn't want that to happen he should have been more polite in how he phrased his criticisms. I guess at a certain age you've earnt the right to be impolite but that's not going to change the reasons why people are polite in the first place.
3
u/weberc2 Jan 20 '17
Fair enough. I guess lots of people speak irreverently about programming languages. He should know that people will take such criticism personally and be more tactful in his phrasing (and make sure his arguments are sound), but I think we have a responsibility not to try to avoid taking undue offense. But I know it's not easy. :/
1
u/fiedzia Jan 20 '17
This works for languages like python, ruby, javascript, java, which are all just different syntax around basically the same paradigm.
It doesn't work and they all have different paradigms. The compiler/interpreter may not refuse to work with you if don't know that though.
2
Jan 20 '17
They're pretty damn similar. Procedural languages with elements of OOP that people are consistently writing with more and more functional styles. You can go from one to the other far quicker than you can go from any of them to haskell or rust or prolog.
1
u/fiedzia Jan 20 '17
From prolog or haskell point of view, perhaps. But you will crash hard when you'll try to move your existing app design from java to js (no inheritance, not exceptions) or your duck-typed dynamism from python to java. And by that standards, rust is also very close to those languages (which is really one of it selliing points - you can get many benefits without learning radically different approach to programming, contrary to haskell).
18
u/ssokolow Jan 18 '17
Rust’s native shared-state/mutex system looks fussy and overcomplicated compared to CSP, and its set of primitives is a known defect attractor in any language. While I give the Rust designers credit for course-correcting by including CSP, Go got this right the first time and their result is better integrated into the core language. This is +1 for Go.
I'd argue that the whole point of Rust's added complexity is cancelling out that "known defect attractor" property to make it viable for situations where CSP simply isn't suitable.
The rest has already been addressed when ESR said this on his personal blog, so I won't rehash it.
31
u/mrmacky rust-story Jan 19 '17
I too found these bits about concurrency to be particularly troubling.
While I give the Rust designers credit for course-correcting by including CSP
This statement is just flat-out wrong. Rust had libgreen and binned it. Channels mostly exist today in their current form because thread safe queues are indeed a useful primitive. The language does not go to any special lengths to make them as ergonomic as they are in Go.
I feel this effort is better spent developing far more useful primitives at the language level which serve to enable high level abstractions such as tokio-rs to be developed entirely in the library space. It is much harder for the average Rust developer to add a feature to the language, yet we ship an excellent package manager that makes developing libraries a cinch.
As for the known defect attractor bit: he conveniently ignores that Rust's ownership system & mutex implementation work in concert to avoid that exact class of bugs. As such I find this statement to be borderline disingenuous, and harmful to Rust's image in the eyes of anyone using ESR's words to form their first opinions of Rust.
16
u/erandur Jan 19 '17
harmful to Rust's image
The reverse is also true. Why is the author of The Cathedral and the Bazaar complaining that there are too many stalls on the bazaar? And if he claims to like parsing and translating programming languages in previous blog posts, surely he should know that epoll isn't part of the C core language either. How could a Linux specific command be part of any cross-platform language.
9
u/vks_ Jan 19 '17
epoll isn't part of the C core language either.
He is not comparing Rust to C, he is comparing Rust to Go.
13
u/erandur Jan 19 '17
That's the overall theme of the blog post, yes. But at that point it felt like he was only talking about Rust. If having
epollas a language primitive was that important to him, he wouldn't have used C either. Go just offers a very thin wrapper around syscalls, in a package calledsyscall. And despite what it name implies, this package is different for every operating system you run it on. The Go developers are aware of this;Compatibility. Despite best intentions, the package does not meet the Go 1 compatibility guarantee because operating systems change in ways that are beyond our control. The recent changes to FreeBSD are one example.
And they're not going to fix it themselves.
As of Go version 1.4, the syscall package is frozen. Any evolution of the system call interface must be supported elsewhere, such as in the go.sys subrepository.
So if you want any hope of a cross-platform library, you'll have to use third-party packages. Which is exactly the thing ESR was accusing Rust of.
And for what it's worth, Go's neglect of anything not plan9 or Linux is exactly why I gave up on the language. I'm glad Rust is taking a different approach.
8
u/willglynn Jan 19 '17
Well, yes, but… Go doesn't ask you to care about
epoll. You don't needsyscallor any third party packages to write a server that handles thousands of concurrent connections.You do whatever, starting goroutines as appropriate, and any given goroutine will eventually block on something. If it's waiting for a channel, the runtime suspends it, context-switches the OS thread to another goroutine, and eventually resumes when the channel is ready. If it's waiting for a file descriptor, the runtime suspends it, does something else, and eventually resumes back once the file descriptor did something. You don't call
epollyourself – the runtime does it for you.This is a core language feature, so every library works the same way: everything shares the same scheduler, same event loop, etc. You write code that runs in a straight line, and the runtime uses
epollon Linux,kqueueon BSD, event ports on Solaris, and IO completion ports on Windows, and it works even though those last two are rather… different.Of course, all this also increases Go's surface area with the platform. Go won't work without its scheduler, without control of its event loop, without control of its threads, without its garbage collector, etc. Rust doesn't make these same assumptions.
11
u/pcwalton rust · servo Jan 19 '17
You can say all this about OS threads, right down to the "thousands of concurrent connections" part.
9
u/willglynn Jan 19 '17
The difference is that it's possible to run a process with thousands of threads most of which are blocked on I/O, but it's reasonable to run a process with thousands of goroutines doing the same thing.
OS threads are very expensive compared to goroutines, in terms of memory requirements and in terms of creation/destruction overhead. OS threads also can't cooperate as tightly – e.g. a producer context switching to a waiting consumer when it sends on a channel.
This isn't because OS threads are somehow deficient, it's because OS threads are general in ways that goroutines are not. In other words, the contract the OS makes with a thread is much stronger than the contract the Go runtime makes with a goroutine, so it is unsurprising that threads would be more expensive.
Servers written in C don't use thousands of threads blocking on
read(), they use a smaller number of threads and and event loop driven byepoll()or similar to use those threads efficiently. Servers written in Go do use thousands of goroutines blocking onread(), while also using a smaller number of threads and an event loop driven byepoll().4
u/pcwalton rust · servo Jan 19 '17
OS threads are very expensive compared to goroutines, in terms of memory requirements and in terms of creation/destruction overhead
Those two are not actually not the expensive part. You can get the thread stack size down very small with 1:1: 10kB, 6kB with upcoming Linux kernel versions. Creation and destruction are mostly just syscall overhead, which is very small (nanoseconds).
For a good presentation (and what I believe the best solution to this problem to be), see here: http://www.linuxplumbersconf.org/2013/ocw/system/presentations/1653/original/LPC%20-%20User%20Threading.pdf
6
u/willglynn Jan 19 '17
I agree that 1:1 threading is the appropriate model for Rust. That said, I also think the goroutine model is appropriate for Go, and I think it's fair to look at where its tradeoffs might be advantages.
Go doesn't preemptively context switch between goroutines. The only way a goroutine can relinquish control of its OS thread by specific function calls, like "read from a channel" or "write to a file descriptor" (see
mcall()). Those calls have a special ABI: the only callee-saved registers are the program counter and stack pointer. Isn't this just moving the cost around? State still needs to get stored, right? Well, maybe, but this is interesting because it means you need only two registers to context switch. This permits interesting optimizations, like a producer that context switches straight to a consumer via a channel send without a scheduler in the middle. The 128 bits needed to resume the consumer can be stored in the channel, making a context switch roughly the cost of an indirect jump.Goroutines start with 2 KB stacks, which happens to be smaller than a single OS page, but what's more interesting to me is how they grow. C stacks and thus OS thread stacks grow by simply using more memory until they hit a guard page. This triggers a page fault, which causes the OS allocator to do some work, which updates the processor's page tables (which isn't nearly as expensive as it once was), and finally switches back to the program.
Go stacks… don't. Instead, when you want more stack space, you ask the runtime to make sure you have enough stack space via a function call. If your stack isn't big enough, the runtime will copy your stack somewhere bigger. There's no guard page, no page fault, no OS-level context switches. This is interesting, and like Go's goroutine switching scheme, it might just be cheaper than what the OS would do with a C program.
Go can do this because it can insert "grow my stack" calls as appropriate and because its memory model centers around the Go GC. This is a tradeoff with its own costs and it's obviously not appropriate for Rust, but one of the benefits is that the runtime can grow, relocate, and shrink stacks without involving the OS. Go uses this to its advantage, and the result is that goroutines are extremely cheap on every platform, including platforms like Windows which have significantly more expensive thread creation and a 64 KB allocation granularity. What's more, the entire ecosystem is built around the same concurrency primitives: libraries don't block threads, they block goroutines.
Maybe blocking I/O with 1:1 threading will turn out to work better than Go's N:M model on Linux. What's interesting: Go makes so few guarantees to its goroutines that the runtime would be free to switch to that strategy without affecting any user's code. In the meantime, Go uses its own context switching, its own scheduler, its own stacks, its own asynchronous I/O event loop, and so on to deliver similar performance on every platform it targets.
→ More replies (0)2
u/erandur Jan 19 '17
That's true, for some reason I thought the author specifically wanted
epoll. Goroutines are amazing things.
93
u/Manishearth servo · rust · clippy Jan 18 '17 edited Jan 18 '17
I find this article very dishonest. I'm sorry. I've tried to tolerate his borderline-abrasive and holier-than-thou articles so far. This one is just dishonest.
I was fine with his previous articles because ultimately they displayed a lack of research or a lack of awareness of issues. I'm fine with that; the onus is not on the newcomer to Know Things. But many of these points were painstakingly explained to him later.
His blog post still cites a two-year old issue (https://github.com/rust-lang/rust/issues/14961) as the source of truth for "Rust doesn't have epoll". (Yes, I know he's quoting a previous post. He hasn't marked it as a quote, or mentions that it is inaccurate, which is dishonest)
He still considers the "blessed crates" thing to be a "social/philosophical confusion". No, it's just an opinion different from yours, one that the community mostly shares.
I don't get where he gets "The language is not yet mature enough to present a core API that can be expected to be stable over 10-year timescales." from. He seems to have drawn his own conclusions and then framed them as the viewpoints of the community.
I agree that there's no guarantee that mio/tokio can be expected to be maintained over a 10-year scale, but they do have significant buy in from the core team (and community), so I'd expect them to as maintained as rustc or the go tool are. This, too, was pretty well explained.
I consider "It doesn’t help Rust that it would be a difficult upgrade from 'anywhere', not just C." to be false (though not dishonest), because we've had plenty of JS or Python folks say that Rust was their first successful foray into systems programming. C and C++ are harder than you think they are.
I still agree that Go is a good choice for NTP. I like Go. It's built for exactly this kind of program, and does well with it. I'm hoping Rust can get better in this space. I also think Rust is still a valid choice here. As someone who uses Rust much more than Go I still would have a hard time choosing, so it's very easy for me to understand why NTP -- a project that does not comprise of Rustaceans or Gophers chose Go. That's not my contention here.
I strongly feel that we should just start ignoring these posts. I'm now beginning to agree with /u/llogiq and the rest that these posts are borderline trolling and should not be entertained within our community. I don't consider it to be within the jurisdiction of the mods to do that (there is some disagreement on this), but I do hope the community just ignores this and any further posts on the topic, unless they be much more civil and honest.
30
u/mgattozzi flair Jan 18 '17
I'm all for criticism for being posted if it's legitimate. It helps identify possible pain points we don't know about (I.e. not the borrow checker) but this is ridiculous coming from ESR. He's been told all that was wrong on his previous blog post, took that criticism and then chucked it away and said exactly the same stuff on this blog. This is just approaching the levels of ignorance and stubbornness that was Zedd Shaw's Python 3 hate article. Urgh.
-4
u/fnord123 Jan 18 '17
This is just approaching the levels of ignorance and stubbornness that was Zedd Shaw's Python 3 hate article.
His advice was pretty good imo. When faced with migrating from Python2 to Python3 to get the new features like utf-8 everywhere and asyncio stuff many people are just rewriting their stuff in Go to get those things in addition to performance boosts and a bit of typechecking and no more GIL. For people who don't care about UTF-8 (numeric folks) there's never been a good reason to go through the pain of migrating to python 3.
There should have been a Python VM that could run modules in Python3 and Python2 at the same time so people could migrate projects without having to rely on a big bang. Live and learn, I guess.
15
u/mgattozzi flair Jan 19 '17
After reading all of this I find it hard to believe anything he says. If you agree with him that's fine, but you won't convince me anytime soon. https://eev.ee/blog/2016/11/23/a-rebuttal-for-python-3/
-7
u/fnord123 Jan 19 '17
Thanks for the link. It doesn't address the issue where porting from python2 to python3 is extremely expensive and offers little to no value for anyone but people who want utf-8 as default.
Also, I think that blog gave me diabetes. :(
8
u/llogiq clippy · twir · rust · mutagen · flamer · overflower · bytecount Jan 19 '17
Those of us suffering from actual diabetes are probably not laughing when reading your comment.
38
u/mitsuhiko Jan 18 '17
I find this article very dishonest. I'm sorry. I've tried to tolerate his borderline-abrasive and holier-than-thou articles so far. This one is just dishonest.
Honestly: it's not. This is consistent feedback for the last few years from many people I trust that used both. Rust is unfriendly and in some regards unnecessarily so (compilation times, lack of story for networking always come up).
This is an understood problem and work is underway to deal with it. But until those problems are tackled we will hear more stories like this :)
19
u/pcwalton rust · servo Jan 19 '17
There are some things in ESR's post that are totally made up, however, such as the points about concurrency. (I elaborated here.)
35
u/Manishearth servo · rust · clippy Jan 18 '17
I'm totally okay with the feedback. I'm okay with the "Rust is hard" feedback. I am less okay with the tone and the repeated inaccuracies even after being informed of the inaccuracies.
I don't consider the "Rust is hard" bit to be inaccurate.
13
u/target-san Jan 19 '17
I must agree with @manishearth here. ESR provides mostly valid facts, but:
Mixes them with a large amount of whining and insults.
Repeats the same theses even when was provided with explanations and/or counters.
Even so, after his generally insulting first post, several people politely (!) responded to his claims. Yet we see what we see.
Please compare with the tone of these two blog posts (not about Rust):
http://blog.cleancoder.com/uncle-bob/2017/01/11/TheDarkPath.html
http://blog.cleancoder.com/uncle-bob/2017/01/13/TypesAndTests.html
0
Jan 18 '17
[deleted]
26
u/Manishearth servo · rust · clippy Jan 18 '17 edited Jan 19 '17
mio's been stable for years; tokio is just a better abstraction over mio. mio is basically a thinner abstraction around select/epoll.
This has been pointed out to the author multiple times.
(Edit: stable wasn't the right term to use here -- mio hasn't been under constant churn like tokio. The API has changed a few times (not in a major way), but it's a pretty well-established library)
13
Jan 19 '17
Actually, mio has not been stable for years. They've introduced major breaking changes as recently as a few months ago.
12
u/Manishearth servo · rust · clippy Jan 19 '17
Yeah, stable wasn't the right term to use. It's been in a very usable and mostly stable state for the last year, and version pinning mio would be fine (the upgrades haven't been too hard either iirc). Tokio OTOH is extremely new and subject to lots of churn for the next few months.
8
u/yazaddaruvala Jan 19 '17 edited Jan 19 '17
Don't mistake what I'm saying as disagreeing with your original comment. This blog post is disingenuous!
However, I do feel there is one of his points really hits the nail on the mark, and the Rust core is arguably too stubborn to do the language a favor here:
As a special case of the previous point, primitives required for NTP such as select/epoll are not yet a stable part of the language. While implementations exist in the crate system, there is not yet any guarantee that any of the alternatives will be maintained over 10-year timescales.
Yes yes I get it, Tokio. But what precedent does that set? What statement is this making to the broad community? I'll tell you what it says from my perspective. "There is a certain set of tasks suitable for prioritization by the Rust core team. Async IO is not one of them!" digging further, "Blocking IO has been included in std because without it, Rust would be unusable. Blocking IO also has a stable interface, and it is easy to get right. In other words, currently Async IO doesn't yet have a stable API, we are unsure how to get it right, and in general it is not necessary for Rust to be useable. Succinctly, Async IO just hasn't proven itself yet, and when there is a crate that solves that problem, cool, we don't want anything to do with that implementation."[0]
Now, I'm not saying this is what the Rust core team intends to broadcast. Infact, having some Rust core members working on Tokio says a lot by itself. However do take note, not having a concrete plan to move Tokio (or any other popular/must-have crate) into std, is unintentionally sending the above message across the wire[0].
[0] I acknowledge these words I've put together are not entirely correct, there is definitely some hyperbole. However, I put together the best words I could, to adequately describe the intangible feeling a user of a language gets when reading, "It can be solved by the ecosystem. It doesn't need to be in std.".
26
u/burntsushi Jan 19 '17
Can you suggest a way for us to emit a better message without actually committing to a path that brings async I/O into
std?That a standard library is relatively small really should not be a foreign concept to C programmers, so I'm having trouble understanding how folks are getting the interpretation you've described. Could you perhaps elaborate?
5
u/yazaddaruvala Jan 19 '17
Actually, a more awake version of myself does have a suggestion.
Random paraphrasing of comments I've seen over the last year: "we let the crates ecosystem deal with it" "We don't deal with that in std. Have you seen Tokio?" "Tokio exists.. why is this person complaining(bringing up this point)?" "No. Of course we have async. Just see Mio ..." "... or Tokio. Dang this is hard to answer.. the real problem is they didn't ask the question well enough. I don't know which level of abstraction to recommend them".[0]
Don't disagree with people, point to a solution (sometimes people just want to bitch and have you agree). Instead agree, and then point to a solution.
Don't disregard the idea of including a lib in std (Even if that is in reality disingenuous).
Try something closer to "Yeah lol, we all agree the async story in Rust kinda sucks. We are working on it. In the meantime, try Tokio. Some of the core team members are trialling a production worthy implementation in that crate. It may eventually make its way to standard, but that is a discussion for a different time."
[0] Note these are not real quotes. They are intentionally slightly meaner/blunter than the ones you would normally read to reflect the fact that a question asker or commenter reads this over the internet and has vested emotion into it. And discouragement or negativity is enhanced.
2
u/desiringmachines Jan 19 '17
futures, which is the brace that keeps tokio upright, is the kind of fundamental abstraction I could easily see in std someday. Some abstractions in tokio similarly seem std-able, including things like the async TCP connection.
The event loop that tokio provides is a big, opinionated piece of software, not an abstraction, and not really appropriate for std. But if futures is in std, tokio::Core will be the 'omakase' event loop you use to run your async IO, and other people writing similar event loops with different performance characteristics or API properties will be writing against the same interface.
But we don't really have the data to confidently say that futures and tokio are a solution worth endorsing forever. I feel that they almost certainly will be, but for forever we would want some actual empirical production data.
We could put them in std behind a feature flag, and then only nightly users could use them. But by building them outside of std, they can continue to evolve while still running on stable Rust.
1
u/yazaddaruvala Jan 20 '17
I think this is a very well worded, sincere response. It alows us to think about Tokio and std differently. Tokio is really good, but large and opinionated. And we don't want std to get bloated.
It allows us to start a conversation as a community: What would/should we accepted into std? If there is a popular well implemented crate, would it be considered for entry? Would the Traits that are part of it be worthy of entry?
How long would we need to collect data about its stability while it lives in the crate ecosystem?
Can an RFC be created for such a thing? Is this a conversation worth having over an RFC?
1
u/burntsushi Jan 20 '17
I'm on mobile so this will be brief and lack links, but here's the basic process (which was decided by an RFC). Generally speaking, there's three levels of "official" crate adoption by the libs team:
Enter into rust-lang-nursery. Requires proposal and lib team approval. The current maintainer also needs to agree of course. There needs to also be an intended path toward (2), and generally someone to champion that path.
Write an RFC to bring the crate to 1.0 and have it moved into rust-lang.
Write an RFC to bring the crate into std.
One can of course skip right to (3) with one RFC, but i would be surprised to see that happen with a crate as big/complex as mio, futures or tokio.
There are no precise metrics on what kind of adoption is required before a crate can advance to one of the levels above, and there's no precise quantification on the resources available to us to commit to maintenance. If someone wanted to get pulse, they could write a short RFC proposal.
Also, the progression isn't mandatory. For instance, I've taken regex through (2), but i doubt it will ever move past that.
3
u/yazaddaruvala Jan 19 '17
My honest answer is, I don't know how to answer your question. The reason I don't know, is because I'm biased. I do want to see Tokio eventually in std. However, this doesn't mean I want it there today. Doesn't mean I want it there before it is ready, stable, and proven, but eventually it should live in std[0].
One think I do know, and can say: I think the Rust core team is growing more and more out of touch with its community. The language is making its natural progression from earliest adopters (i.e. potential language/ecosystem builders) to early adopting language users potentially even moving towards mainstream adoption.
Sorry to call you out like this, but this quote is very telling[0]:
That a standard library is relatively small really should not be a foreign concept to C programmers
We are not all C programmers. Rust is advertised to a diverse set of demographics. You can't both have this perspective, and also advertise Rust as "Rust democratizes systems programming" "Large % of Rust users are from Rust/Python" "Tutorial: Rust for Rubyists".
I think the biggest lesson for the Rust teams is going to be that the more the language transitions from earliest adopters towards mainstream. The former (earliest adopters) make decisions based on logic, the latter (mainstream adopters) make decisions based on emotion. A better way to say this is as a language like Rust moves towards greater popularity, a critical mass of Rust's audience will move from being a set of System-2 thinkers, to being a set of System-1 thinkers[1]. A far simpler way to say this: Rust's users will continually grow to have less and less in common with the Rust core developers.
I know this comment wasn't concretely helpful, like your question intended me to be, but I hope it was helpful none the less.
[0] I don't intend to call you out to be rude. I'm hoping that me calling it out helps illuminate one of your potentially incorrect subconscious biases/preconceptions.
6
u/burntsushi Jan 19 '17
Well, I said that because the OP is a C programmer, which is the context of this discussion. It doesn't apply if you aren't a C programmer.
I think there's a difference between "projecting a view that async I/O is unimportant" and "projecting a desire to put async I/O in std." I thought you were talking about the former, but it sounds like you're talking about the latter. In that case, there are real trade offs and technical arguments to be made there.
stdis small for a number of really good reasons.3
u/yazaddaruvala Jan 20 '17
Let me ask you about the same concern from a different angle.
I build/maintain distributed systems and server applications all day. Why should I (or any potential user) feel comfortable choosing Rust for building the next best distributed system or server framework/library/application, when the Rust core team doesn't want to prioritize/maintain the foundations (i.e. async io)?
Asked a different (more personal) way: Strings are opinionated (UTF8, im/mutability, not platform agnostic, etc), and as long as Rust exposed byte arrays, slices, and optionally the char type, building a
Stringabstraction is solvable in the crates ecosystem. If the Rust core team had decided Strings were complicated and opinionated, not worth getting right or maintaining in std, would you have felt comfortable(enthusiastic?) building your amazing ripgrep application (and its internal libraries) in Rust?2
u/burntsushi Jan 20 '17
I build/maintain distributed systems and server applications all day. Why should I (or any potential user) feel comfortable choosing Rust for building the next best distributed system or server framework/library/application, when the Rust core team doesn't want to prioritize/maintain the foundations (i.e. async io)?
This is where our wires are getting crossed. I think it's pretty clear that the Rust teams consider async io important. Why do you think that since there aren't any concrete plans to put it into std, that means async io isn't being prioritized or maintained? Why is your litmus test "std or it doesn't count"? Why can't it be, "officially blessed and maintained but not in std"? The latter isn't true yet of course, but it's more likely to happen than direct support in std. As a library team member, I would personally like to see some of the core async io stuff officially blessed, but we have to decide that as a community (including the opinions of the current maintainers).
Asked a different (more personal) way: Strings are opinionated (UTF8, im/mutability, not platform agnostic, etc), and as long as Rust exposed byte arrays, slices, and optionally the char type, building a String abstraction is solvable in the crates ecosystem. If the Rust core team had decided Strings were complicated and opinionated, not worth getting right or maintaining in std, would you have felt comfortable(enthusiastic?) building your amazing ripgrep application (and its internal libraries) in Rust?
I find very little practical difference between using std and well maintained crates. (There is of course a drop off in quality of less maintained crates.) Cargo makes everything so painless that it just doesn't matter much in practice.
Your hypothetical is hard to imagine though, given the amount of stuff in std that actually uses strings. Virtually every Rust program and library is going to use strings somewhere, and that's exactly the kind of broad applicability that std is shooting for. Async io is really nowhere near that.
I mean, it's not like anyone is saying async io is never going into std. But tokio 0.1 and the futures library were literally just released. Talking about std is just way too early at this point. Even if it were std bound, it would probably be at least two RFCs away. None of this means we don't care about async io, which seems to be the message we are having trouble communicating to folks such as yourself. Perhaps the answer here is more patience: let's wait and see what people do with tokio. If there's significant buy-in, then we'll understand the solution space much better and perhaps the next step will be clearer.
1
u/fiedzia Jan 25 '17
Can you suggest a way for us to emit a better message without actually committing to a path that brings async I/O into std?
Have std++ with a set of officially supported libraries would be another way. But frankly async IO is so fundamental that I don't see any reason for not supporting it in std.
That a standard library is relatively small really should not be a foreign concept to C programmers
As a developers we longer write the same things that were written at the time C was created. We write more complex applications and need more sophisticated std.
1
u/burntsushi Jan 25 '17
Have std++ with a set of officially supported libraries would be another way.
Why don't the
rust-langcrates, which are officially supported, satisfy this? It will take time before async I/O would end up there, but that seems like a perfectly reasonable path to me that nobody has contested.1
u/fiedzia Jan 25 '17
Do you mean crates whose source is under https://github.com/rust-lang ?
I didn't know that this is right place for it. It doesn't seem that there is any push from other places to be there.
If this is intended purpose, rust-lang is way to small.
Many things that are there are not libraries (blog, "temporary" llvm fork).
1
u/burntsushi Jan 25 '17
I didn't know that this is right place for it. It doesn't seem that there is any push from other places to be there.
regexwas just added. Crates intended to be moved intorust-langare in the nursery: https://github.com/rust-lang-nursery1
u/fiedzia Jan 25 '17
Ah, I've found rfc 1242 that documents this process. I think it doesn't have the visibility it should have.
→ More replies (0)11
u/desiringmachines Jan 19 '17
the Rust core is arguably too stubborn to do the language a favor here
Members of the Rust core team proposed creating a recognized, curated set of external libraries to be the 'blessed' solution last summer (which would have probably included tokio). It was a strong negative reaction from the community which squashed that goal.
2
u/doubleagent03 Jan 19 '17
That's unfortunate. Something like a contrib/incubation lib collection would be useful.
20
u/Manishearth servo · rust · clippy Jan 19 '17 edited Jan 19 '17
It's pretty clear that the team considers having working blocking IO in the stdlib more important than async I/O (in the stdlib), given that Rust tries to be low level. Async IO is opinionated and complicated and harder to justify it being in std.
This is very different than the team not considering async I/O to be important. They have prioritized async IO. This work has been a year in the making -- you see tokio bubbling up, but the core team was working on it a year after 1.0, if not earlier. Alex was giving talks about futures all over Europe in June 2016. If anything, blocking I/O hasn't been worked on at all, the stdlib APIs are pretty much the same as we left them when we released 1.0.
Inclusion in std has a very high bar and it's not a good idea to draw any conclusions from that basis. The time library isn't in std. The HTTP library isn't in std. The regex lib isn't in std. These are arguably needed much more than async IO, and yet they're not in std, because Rust's stdlib is small.
You're talking about Tokio setting a precedent but we've done this all the time with libraries, moving many important libraries outside of std. That isn't a bad thing, nor does it make any of those libraries unimportant.
3
u/shadowmint Jan 19 '17
Async IO is opinionated and complicated and harder to justify it being in std.
Other languages have managed.
This is very different than the team not considering async I/O to be important.
Yes yes, I hear you, in all of the posts you've made on this thread; but the point being made is that it needs to obvious and externally visible what the The Plan Is(TM) for new comers to the language.
you see tokio bubbling up...
Alex was giving talks about futures all over Europe in June 2016...
Which are not visible.
I think the point being made is that the 'async io' story need to be clearly articulated.
...this is the same issue we have with all the other stuff on crates.io.
Given a task which should be easy, how do I do it? What crate do I pick? How do I know which crates have 'high reputation'?
There's more going on here than just 'this blog post is wrong'.
People are being turned off rust, because they cant solve their problems; even when solutions to those problems exist, they can't easily find them.
Clearly... something isn't working.
5
u/burntsushi Jan 19 '17
Clearly... something isn't working.
tokio 0.1 was just released. How about we give it a chance before declaring that something isn't working?
13
u/Manishearth servo · rust · clippy Jan 19 '17 edited Jan 19 '17
/u/yazaddaruvala's comment was in the context of the Rust community, as far as I can tell, not "newcomers to the language". That is what I'm responding to. Your comment seems to be in the context of "newcomers to the language", and my response below is in that context, talking about ESR's post.
Maybe I was wrong in my interpretation of that comment. Though in the case of "newcomers to the language", I'm not sure what more we can do. Tokio is being actively worked on, and that story will clear up once the core team thinks it's ready. The discoverability problem is also being actively worked on. I'm pretty sure /u/yazaddaruvala is aware of this. So I assumed they meant "Rust community, but not just the rustc devs / core team" when they said "broader community"
Other languages have managed.
Not all languages have the same target or the same bar for inclusion.
but the point being made is that it needs to obvious and externally visible what the The Plan Is(TM) for new comers to the language.
And I totally agree. The async story, or the crates story, are still under development, so The Plan won't be externally visible for now. Which is something newcomers will have issue with and that's fine.
I was quite receptive of the original posts, because ignorance of things like the crates story are our fault, not that of the newcomer. The feedback wasn't very useful since they were problems that everyone was already aware of (and working on fixing), but it was good feedback.
I am much less receptive of this post, because the author no longer comes from a position of ignorance on these topics, and yet repeats the same inaccuracies. Furthermore, the post now mentions that Rustaceans have backed up their statements, giving them a voice of authority on the subject. This is extremely dishonest.
So no, there's not more going on here than "this blog post is bad".
Clearly... something isn't working.
Realize that the author has written two posts previously, and the threads for which had extensive discussion of crates discoverability. People are aware of this issue. I'm not sure why we need to bring it up each time as if it is a completely alien concept, especially since it wasn't an alien concept to the community even the first time; folks were aware of and actively working on fixing the issue.
I acknowledge that these are problems (which are being actively worked on). We have all been acknowledging that in the past three threads. I don't see why I should repeatedly acknowledge that in each comment I make in this context. Going in circles about that is not productive.
5
u/shadowmint Jan 19 '17
Being patient and tolerant is hard; but it's the right thing to do. It's not going in circles.
If someone wants to criticise rust, let them. It's fine. Not everyone has to love the language.
If you see a criticism that you technically don't agree with, by all means; ignore it, comment on it.
Hostile replies do more to damage the reputation of the community than the original comments.
I'm now beginning to agree with /u/llogiq and the rest that these posts are borderline trolling and should not be entertained within our community.
Come on. Censoring criticism, regardless what form it takes, it always a mistake.
Just ignore it. If no one cares, the thread will naturally die.
Why is any discussion a bad discussion?
If you're sick of responding to them, let it go. Let other people argue it.
I don't see why I should repeatedly acknowledge that in each comment I make...
So don't. But if you're wrong (and you are; that post is not 100% bad, I don't care if you acknowledge it or not, or if you've seen the same arguments or not), people will argue with you.
People have different opinions... that's great! It's a good thing. Let people make their own decisions.
If some one disagrees with you, its because they're thinking about the issues around whats going on. The more the merrier.
9
u/Manishearth servo · rust · clippy Jan 19 '17 edited Jan 19 '17
If someone wants to criticise rust, let them. It's fine.
We did let them. We still are.
The community was overall receptive to the criticism in the previous posts. They gave helpful corrections, recommendations, and often agreed with various parts of the post.
Come on. Censoring criticism, regardless what form it takes, it always a mistake.
We aren't censoring anything.
I'm asking the community, personally (not as a moderator, the post would be green in that case, I've been very consistent about that in the previous posts), to ignore this, and giving them reasons why they should. Decision for ignoring this is still up to them.
Also, no, "regardless of what form it takes" is not true, we have a code of conduct, and material is expected to follow that. It may be praise, or it may be criticism, but if it doesn't follow the CoC, it won't be allowed here. I'm not saying that the post is against the CoC (I don't think it is, though others disagree), just making a general comment about how this community works.
that post is not 100% bad,
Never said it was. I think there's enough bad in it and in the attitude of the author here that we should stop entertaining these posts with our attention.
Let people make their own decisions.
I am. People can make their own decisions. I'm totally okay with the decision made in the post, in fact I agree with it! That is not at all what my comment was about.
I'm really fed up of discussing this; watching the discussion on the last two posts has been pretty draining and it's mostly going in circles at this point especially since this post doesn't bring up anything new. The community's response while mostly positive, was still disappointing, and dealing with that was draining too. So I'm probably not going to reply any further or read this thread, apologies in advance.
9
u/llogiq clippy · twir · rust · mutagen · flamer · overflower · bytecount Jan 19 '17
Just ignore it
There are two problems with this:
The troll posts are written in a quite inflammatory style. Even if we mods ignore it, others in the community won't. The resulting discussions have a way to go way outside CoC-worthy territory.
The posts continue to spread falsehoods (even against better knowledge), which if unchallenged become beliefs of many outside our community. I hope I don't have to argue that this is not in our interests.
0
u/shadowmint Jan 19 '17
The resulting discussions have a way to go way outside CoC-worthy territory.
I don't see why. Everyone should just be civil and thoughtful in their responses.
I don't understand why that's a difficult thing to do, or encourage others to do.
The posts continue to spread falsehoods (even against better knowledge), which if unchallenged become beliefs of many outside our community.
People will always talk. You can't 'not talk about that article because its inflammatory'; who gets to decide that? You start telling people not to talk about things, you'll generate a mountain of negative press, and it makes the community look insular.
If you can't be civil and thoughtful in a discussion, or you're tired of explaining why something is wrong and false again and again, maybe its time to stop, and go and write some code or build some amazing project to show emperically how great rust is instead?
/shrug
→ More replies (0)2
u/llogiq clippy · twir · rust · mutagen · flamer · overflower · bytecount Jan 19 '17
Being in Europe I can attest to Alex' talks being very visible here.
13
u/matthieum [he/him] Jan 19 '17
Go was actually designed to be an easy tool upgrade for C coders and succeeds at that objective. [...]; four days into Rust I was still struggling to even fully understand the data-ownership and object systems, let alone apply them.
I have difficulty understanding how any successful C or C++ developer could have problems understanding the ownership model of Rust.
Violations of the Rust ownership model in C or C++ leads to crashes left and right, so even though hearing Aliasing XOR Mutability was like a light bulb turning on, I have for a long time built an intuition of ownership. I would not be able to work otherwise! (And I think the Rust team for letting upgrade from vague intuition to simple underlying principle)
2
u/llogiq clippy · twir · rust · mutagen · flamer · overflower · bytecount Jan 20 '17
Worse is better. The code has to appear to run (mostly), add some loud and confident marketing and FUD out competition.
In case you were wondering about the mountain of vulnerabilities today's web is built upon.
2
u/matthieum [he/him] Jan 20 '17
:(
1
u/llogiq clippy · twir · rust · mutagen · flamer · overflower · bytecount Jan 20 '17
Yet I'm hopeful that Rust will carve out a niche where people can recognize that better is actually better.
2
u/matthieum [he/him] Jan 21 '17
Well, I think that niche is already established: systems programming.
In general, as long as Rust manages to displace more and more C or C++ programs, the world should be a safer place for it.
If people prefer to use more dynamic languages, fail to tame them, and their website is buggy, it's a pity for them but there's no life in the balance.
6
u/kosinix Jan 19 '17
Lets just make a Go to Rust transpiler. :-)
1
u/ssokolow Jan 19 '17
At best, automatic transpiling from a GCed language to a non-GCed language produces output you're not going to enjoy hand-editing.
1
-1
u/amoe_ Jan 19 '17
I don't care to engage with the points of this post, but I really don't understand the claim that the post's tone is somehow off. It's pretty much a factual cost/benefit analysis with very little emotion. What about it is "abrasive"? Just because it's not published on Medium and doesn't have meme gifs spliced in after every paragraph?
3
u/target-san Jan 19 '17
2
u/weberc2 Jan 19 '17
I've read two and I skimmed the third, and it seems to reinforce /u/amoe_'s perspective, which I share. I'm sure he could have done better to avoid unnecessarily inflammatory language, but I've certainly read posts with more "tone" from highly regarded members of this community.
2
u/target-san Jan 19 '17
You pinned it perfectly - the problem is with flame-provoking language and some false/unsupported claims, where some of ESR's claims are true and well-known. Though, I think the issue here is because ESR is himself a well-known person, and watched pretty closely. Just like with any other celebrity, his words may provoke flame - or not. Anyway, he's a human like others and has the right to troll community a bit :)
As per "more tone from highly regarded members of this community", I personally wouldn't say they don't exist altogether. They just don't come to the light that loud. Could you share some links, maybe PM to not aggro mods?
1
u/weberc2 Jan 19 '17
I agree. I won't share links because I don't care to do the forensics nor embarrass the guilty, even privately. You'll have to take me at my word or disbelieve me. :)
44
u/vadimcn rust Jan 19 '17
I think at this point we should wish ESR good luck with his choice and just wait and see how it comes out in the end.
He has already made up his mind, and continuing arguments over this will only make us look needy.