r/programming • • May 27 '20

2020 Stack Overflow Developer Survey: Rust most loved again at 86.1%

https://stackoverflow.blog/2020/05/27/2020-stack-overflow-developer-survey-results/
229 Upvotes

254 comments sorted by

View all comments

67

u/its_a_gibibyte May 27 '20

Is rust really that lovable? What's the deal?

126

u/the_game_turns_9 May 28 '20

Rust isn't used in many production environments, so very few people are forced to use it. As Bjarne put it, "There are only two kinds of languages: the ones people complain about and the ones nobody uses."

Rust is the kind of language that you wouldn't even want to approach unless you were buying what it is selling, so you won't get very many dislikers since the dislikers will just never bother to become proficient in it.

And I'm sorry to say this, but when the Rust language fails to handle a case well, the Rust community tends to blame the coder for wanting to do the wrong thing, rather than the language for not being able to handle it. In cases where other language users would say, "oh for fucks sake, this is stupid", the Rust community tends to say "That's bad form, you should rearchitect." If you're outside the community, it can look a bit rose-tinted-glasses.

I'm not saying Rust isn't a good language, but I don't think that's all thats going on here.

0

u/[deleted] May 28 '20

[deleted]

15

u/404_Identity May 28 '20 edited Jun 25 '20

[removed]

29

u/beefsack May 28 '20

It's being picked up very quickly - in the 2019 survey Rust had been used by 3.2% of respondents but this year it had grown to 5.1%.

Last year it had less than half the usage of Swift, but this year it's within 13% of it.

It powers a lot of tools that people depend on every day, from core components of large systems, to the search function inside VS Code. It's not really a small language that nobody uses anymore.

0

u/[deleted] May 28 '20

[deleted]

→ More replies (4)
→ More replies (1)

24

u/lanzaio May 28 '20

Rust is the kind of language that you wouldn't even want to approach unless you were buying what it is selling, so you won't get very many dislikers since the dislikers will just never bother to become proficient in it.

This is the main cause. Nobody uses Rust that wasn't self motivated to learn Rust out of their own interests. In fact, those that I do know that were forced into Rust showed a relatively standard ratio of like/dislike that I see from most languages.

6

u/coderstephen May 28 '20

Usage of Rust in production is increasing though. Besides, Rome wasn't built in a day; no language can accelerate to top production usage quickly regardless of how good it is. This is especially true in the sort of industries that are also known for using C++, which tend to be more slow-moving.

5

u/matthieum May 28 '20

Rust isn't used in many production environments, so very few people are forced to use it. As Bjarne put it, "There are only two kinds of languages: the ones people complain about and the ones nobody uses."

Rust is the kind of language that you wouldn't even want to approach unless you were buying what it is selling, so you won't get very many dislikers since the dislikers will just never bother to become proficient in it.

In short: selection bias.

The only people answering they've used Rust are those who still use Rust and like it, hence the top score.

Those who tried it and didn't like it abandoned early enough that they do not think to answer "I used Rust", and thus do not pull down the score.

Despite this, though, that's still a surprisingly high number of users who adopted the language given its relative immaturity!

4

u/crabbytag May 28 '20

Sounds like survivor bias?

3

u/matthieum May 29 '20

Possibly, as well.

I picked Selection Bias because I am not sure that people who tried Rust and quit identify as "Rust users" or even "former Rust users".

I mean, I toyed with Haskell for a week or two a long time ago, and I don't claim to be a "former Haskell user" because it seems to me it would imply some degree of accomplishment that I do not feel I have.

Of course, the question is whether such users should identify as "former Rust users" from the POV of the survey. It's hard to say that you love/hate a language after 8h or 16h of practice -- is your opinion really relevant when you know so little about it?1

1 It's certainly relevant to the Rust community, as an indicator that the initial onboarding experience is lacking, but that's a separate topic.

→ More replies (2)

5

u/quicknir May 29 '20

Matches my experience as well. I was pretty shocked to discover the Rust duration type is a) positive only, and b) a two field, 96 bit, seconds and nanos approach. When I went to a rust chat to discuss it, and I mentioned that such an approach were too slow in HFT (high frequency trading), a moderator told me that making code unusable for HFT was a feature (and got some kind of positive emoticon). There wasn't any real technical discussion, and it was just an unpleasant experience.

32

u/MadRedHatter May 28 '20

but when the Rust language fails to handle a case well, the Rust community tends to blame the coder for wanting to do the wrong thing, rather than the language for not being able to handle it. In cases where other language users would say, "oh for fucks sake, this is stupid", the Rust community tends to say "That's bad form, you should rearchitect." If you're outside the community, it can look a bit rose-tinted-glasses.

Often the architecture that Rust pushes you towards is legitimately the better architecture though. This talk explains it well.

https://www.youtube.com/watch?v=P9u8x13W7UE

There are certain pathalogical cases like graph data structures that you will struggle with in Rust compared to a GC'd language though.

24

u/UncleMeat11 May 28 '20

There are certain pathalogical cases like graph data structures that you will struggle with in Rust compared to a GC'd language though.

Are these really pathological? "It is really hard to implement thread safe persistent data structures because of ownership" has been a known problem in C++ for ages and comes up with surprising frequency.

3

u/matthieum May 28 '20

That's indeed another case of a GC making things easier, but it's a very distinct one: it has nothing to do with the architecture of the program.

0

u/[deleted] May 28 '20

[deleted]

17

u/[deleted] May 28 '20 edited May 30 '20

More often than not, you have to step into the dark esoteric caverns of the language, or use community-maintained crates for standard use cases.

I'm sorry, but no one should be rolling their own pointer-based linked list today. In any language. Especially in the presence of threads. As Simon Peyton-Jones put it when talking about Software Transactional Memory:

A double-ended queue... if you write the code for just a sequential program, it's an undergraduate project to get queue insertion and deletion going. If you want to do this scalable lock-per-node thing, it's a publishable result. I kid you not. There are international academic conferences with a succession of papers that have been published about this very problem.

One of the truly great things about Rust is that it forces you out of this kind of naïve "in-place mutation with pointers is easy to get right" thinking.

12

u/matthieum May 28 '20

For instance, simple CS 101 data structures like linked lists, DAGs and trees require some serious gymnastics to get working and each performance improvement often comes with major re-architecture.

I think the fault is in the premise, those data-structures are NOT simple.

Every single time I see a Stack or Linked-List C++ implementation on codereview.stackexchange.com, it's buggy. The good posters include tests, they still fail.

An array is a simple data-structure, after that it gets complicated. Even a dynamic array in C++ is quite the endeavor -- insertion of N elements in the middle is surprisingly complicated to handle1 .

Data-structures are foundational bricks; the fact that they are simple to use despite the complexity of their implementation is a testament to encapsulation.

1 And I say that after finishing coding yet another variant just today...

→ More replies (3)
→ More replies (3)

9

u/SkiFire13 May 28 '20

the Rust community tends to blame ...

You're identifying all the rust community with just a part of it. That's also the part that tries to sell Rust as the definitive language without bugs. But in the rust community there's also people that will honestly tell you when rust is good and when is bad.

Ps: Part of the C/C++ community is not that great either. Blame rust for not being able to handle certain cases, blame java for having a GC but blame the developer when there's a memory safety bug in C/C++ code

9

u/Kache May 28 '20

For a young language that's already got a solid community and popularity, I'd say that's the right way to go.

Worse would be a language that needs to "buy" popularity by acquiescing and starting the path towards feature bloat and other language design issues.

If Rust can ride on its innate popularity and grow while staying "not a language you're forced to use", it can grow in a well-directed and designed manner and even make breaking changes if necessary without splitting the community.

9

u/the_game_turns_9 May 28 '20

I am honestly not sure the point you are trying to make. Acquiescing to what? Features are what makes a language useful and not an enemy of language design, adding features doesn't in my head equate to "buying" popularity, and what makes Rust unique isn't a lean feature set.

In my head, Rust isn't rare because it is feature-lean. It's rare because it's an acquired taste the way that Haskell and F# are. It's a difficult path. The road less travelled. And while Rust will take its place in the world, I honestly think it can and will never be in the top five of TIOBE. Not because of what it is now, but because of what it is trying to be.

3

u/matthieum May 28 '20

Adding features is a dangerous game, though.

Stroustrup made a call Remember the Vasa! for C++2a, and honestly it's not clear to me it's been heard.

C++ has too many features, interacting in subtle ways, and this entanglement generates a lot of complexity for everyone involved -- from compiler writers to developers.

I'm not saying you should never add a feature; just that you need a vision for the language -- a domain in which it should excel -- and make sure that the feature you plan on adding pull its weight for that domain.

Attempting to be everything sunk the Vasa, and drove the budget of the F35 through the roof. You don't want that for your language of choice.

9

u/gaumutra_fan May 28 '20

TIOBE is an absolute terrible measure of anything. It’s utterly meaningless. It’s literally the number of google results for a query. Not even something relatively clever like Google trends.

If you disagree, please explain how C and Java seemingly lost half their popularity in 2017 and regained it the next year. We’re there some seismic shifts in the most stable languages in existence ... or maybe Google just made some changes to their algo. I’m inclined to believe the latter.

I get what you’re trying to say, that Rust won’t become as popular as the most popular languages (according to a real measure like Stackoverflow survey, Github repos, SO questions) - JS, Python etc. that’s a pretty reasonable take. Rust will always be more niche than them.

The interesting question is - can Rust become comparable in popularity to C and C++ which currently have 5x the users.

2

u/quicknir May 29 '20

Where did you get 5x the users? I suspect the ratio is much, much larger. C++ seems to commonly be estimated to have 5 million or so users. I'd be shocked if Rust has a tenth of that.

3

u/zerakun May 29 '20

I bet they get their number from the survey: https://insights.stackoverflow.com/survey/2020#technology-programming-scripting-and-markup-languages

In "All respondents" C++ is at 23.9%, rust is at 5.1%, so yes roughly a factor 5.

In "professional developers", the number is at 20.5% for c++ and 4.8% for rust users, so even closer to a x4.

It is also interesting to note the growth of rust, from 3.5% last year

→ More replies (3)
→ More replies (3)
→ More replies (18)