
Rust Survey 2019 Results - steveklabnik
https://blog.rust-lang.org/2020/04/17/Rust-survey-2019.html
======
Waterluvian
Last year Rust was a language I badly wanted to learn. I've had many false
starts learning a lower level or "systems" language, which I felt would round
off my toolbelt quite well. A lot of principles of CS you don't get exposed to
when writing web servers and UIs.

The problem I had was basically the IDE integration in VSCode. RLS was okay
but unreliable. And if it only works most of the time, it may as well not work
at all. Especially when it only sometimes gave me code completion and type
checking (A lot of "unknown" would fill my code).

Then Steve pointed out Rust Analyzer in a previous thread and I was off to the
races. Rust Analyzer has gotten _so good_. Having a VSCode setup that gives me
immediate feedback for my mistakes and code discovery makes a huge difference
(to me at least). Maybe a bit of feedback is that I wish Rust Analyzer hadn't
been so hard to discover. Though maybe that's just because it was new.

That, combined with my nightly march through The Rust Book has me well beyond,
"I wish I could learn a systems language but !@#$ C and C++ are just so
complicated and unforgiving" and into "wow, it's no-longer a matter of _if_
but a matter of how much I want to hone my understanding." Rust is a beautiful
language that way. It guides me away from rookie mistakes that would leave me
disenchanted after hours of debugging something dumb. (It's hard to be
unrelentingly dedicated to learning something new now that I have young kids.
When I was a teen it was easy)

I don't want to come off as a Rust fanboy. I have yet to implement much of
anything (though hopefully by next year I'll have a Game Boy emulator to show
you all). But I want to give thanks and proselytize a little because it has
been such an empowering experience.

~~~
jfkebwjsbx
C complicated? It is a very small, simple language for a system programming
one.

C++ complicated compared to Rust? They offer roughly the same features and
both are complex languages if you want to understand what is really going on.

Rust is a very good language that competes with C++. The main feature it
brings to the table isn't simplicity (Rust, like C++, isn't simple at all),
but the borrow checker.

Please avoid making comparisons between languages if you don't know them (as
you claim).

~~~
ancarda
>C complicated? It is a very small, simple language

That's a bit misleading though. Yes, C is very small - but that doesn't mean
it's magically easy to understand. It's size has a huge consequence; the
language doesn't do much for you, so it's up to you to fill in the gaps, e.g.
correctly manage memory

~~~
DeathArrow
I find C much simpler to learn and to write simple things in.

If you learn C, you'll find that most used languages are compatible with C way
of thinking. You can pick up C#, Java, Javascript, Python, PHP with ease as
you kind of think in the same way.

While Rust, the language might not be terribly complicated, you have a totally
different paradigm, the restriction on variables and the borrowing system
makes it totally different than the languages people are used to, to the point
that for beginners is totally unintuitive.

You can't just declare a variable, initialize it, pass it to a function and
get a result back.

You can't have self references in a structure.

No, siree, as a beginner learning Rust you have to do a lot of complicated
dancing around the borrow checker.

Comming from C like languages I find even functional languages like F# easier
to pick up. Because they feel more intuitive. Unlike Rust you kind of feel
what kind of code you need to write to get a workable result.

Right now I feel that the only advantage of Rust over other safe by default
languages is speed. You can use low level constructs and unsafe features like
raw pointers in C#, but the garbage collector for the safe code slows it down.

I don't think garbage collected languages can ever be as fast as Rust.

Reference counting like in Swift is another way to provide simplicity, but I
see Swift is even slower than garbage collected languages.

So if your use case needs both performance and safety, Rust is your best bet.

It seems that from simplicity, performance, safety you can only pick two at
once.

Microsoft Research is working on a language inspired by Rust. I'm curious if
they can come up with something as safe but easier to use. I wouldn't bet on
it. They aren't convinced of the outcome since they recommended to write or
rewrite parts of their software in Rust instead of waiting for the new magical
language.

A good thing from Microsoft evaluating Rust to use in their huge code base is
they learned about a few weak points and are making recommendation to Rust
team.

One side effect of Microsoft embracing Rust might be that other corporations
like Google and Oracle might avoid it to distance themselves from Microsoft.

~~~
pjmlp
Google is using Rust on Fuchsia, but isn't keen in exposing it to userspace
apps.

[https://fuchsia.googlesource.com/fuchsia/+/refs/heads/master...](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/master/docs/project/policy/programming_languages.md)

------
pornel
Networking in Rust has gotten _so much_ better this year.

My old server needed nested callbacks, wrapping everything in refcounting,
loops via recursion, and Either for control flow. Still easier than C, but not
pretty.

Now it's just `do_this().await.do_that().await` and I'm done! Huge
congratulations on shipping that.

------
jeswin
I started learning and coding Rust full-time over the last couple of months. I
expected a learning curve, but boy what a steep curve it was. Simple things
are simple enough, but for experienced programmers porting your patterns
(especially functional programming patterns) can be challenging and
interesting at the same time.

For instance, I wanted to return a function (async) from a function. A
seemingly simple task, but I couldn't figure it out and I had to ask on Stack
Overflow. [https://stackoverflow.com/questions/61167939/return-an-
async...](https://stackoverflow.com/questions/61167939/return-an-async-
function-from-a-function-in-rust)

The answer is obvious only if you know a fair deal of Rust. Thanks to the Rust
team's amazing momentum I am sure the compiler will improve over time, but for
now I found passing functions and closures around a bit harder than I
expected. Totally loving the language though.

~~~
Dowwie
The learning curve is misleading. You can achieve parity with a higher level
language by copying and pasting solutions such as the one in your stack
overflow post. Yet, unlike in other languages, an opportunity presents itself
to learn far more about the underlying tooling used to create such a solution.

------
DeathArrow
NPM rewrote one of their services in Rust. It took them one hour to rewrite it
in Javascript , two days to rewrite it in Go and one week to rewrite it in
Rust.

Even if we account 90% of that time to the lack of experience in Rust, it
still feels like a massive productivity hit.

So unless you absolutely need to squeeze the most performance you can from the
hardware it might not be the best choice.

[https://www.rust-lang.org/static/pdfs/Rust-npm-
Whitepaper.pd...](https://www.rust-lang.org/static/pdfs/Rust-npm-
Whitepaper.pdf)

~~~
siscia
It is kinda unfair to compare the time of writing a service in go and rust if
your team already work with JavaScript.

Go was designed to be extremely simple (simplicistic, if you want to be ugly
with terms) while rust was designed with very different goals in mind.

Moreover the mental model of JavaScript is much closer to the one of go than
the one of Rust.

If you are learning rust and you are not from C/C++ or similar low level
languages you are basically re-learning how computers works. Usually on go you
don't really care of the difference between the stack and the heap, in rust
you have to.

Said so, it is really true that rust has a steep learning curve, however once
you get over it the productivity is at least as high as go especially in the
long term.

For one off script of ~100 lines I would pick go as well.

------
k__
About the docs.

They are better than most docs, but sometimes they have gaps in their sample
apps.

The WASM book, for example, goes from "hello world" straight to "game of
life".

It's certainly an interesting algorithim and probably hits a sweetspot because
its computation heavy(?), but at least for me it was too much noise around
actually learning Rust and WASM.

~~~
lucasyvas
I'm so happy you mentioned this. I went through the same process and "noped"
out. Now, I've stuck with Rust, but I laughed out loud at that leap.

~~~
steveklabnik
I am also happy you both mentioned this, because I've never heard anyone say
this before! Good to know!

~~~
k__
Yes, I'm a frontend dev. I know my todo list examples, haha.

------
steveklabnik
Please don’t forget that the survey closed in December last year, so it’s
pretty close but may not reflect rust actually today. In particular the IDE
landscape has been changing rapidly.

~~~
mkl
Hi Steve, I spotted a typo: "By are the most common" should be "far" instead
of "are".

BTW the (3d!) pie charts are far less clear or informative than the nice
simple bar charts, which could be used for everything here.

~~~
steveklabnik
Thanks!

I didn't write this post, but I'll pass it along.

------
memco
Having not used Rust at all, I'm impressed with its momentum. I know every
language has their issues, but Rust seems to have a strong community, is well
organized and seems to have good tools available: all things that make me
believe that I would be able to use it effectively were I ever to work with
it. I've been watching Gamozo on Twitch use it to build a hypervisor kernel
and I really enjoy seeing how the language works for him.

------
m-hilgendorf
When people want better docs, do they mean better doc tooling or better doc
writing? Because personally, I'm a huge fan of cargo-doc and its integration
to the ecosystem. Just yesterday I found out about #![deny(missing_docs)] -
which combined with executing code snippets in cargo test - enforces _really_
good documentation discipline and ensuring that everything is doc'd, and that
docs don't become stale.

~~~
steveklabnik
I didn’t tread the raw results, but I believe it’s “more docs,” not the
tooling.

------
ridhwaan
Ask HN: Do you recommend learning C++ first then Rust? My logic is that
learning C++ and navigating its pitfalls would lead to a better understand of
Rust and the underlying reason behind certain design decisions.

~~~
pixel_fcker
I think it will take years of working in c++ to fully appreciate the
nightmarish many-tentacled footgun monster it can be.

At the end of it you might even develop Stockholm syndrome and be one of those
posting “if you just restrict yourself to _these_ parts of the standard and
run this 6 static analysers on your code then c++ is perfectly safe if you’re
not an idiot”.

If you don’t want to learn c++ for its own sake, that’s time you could better
spend learning a language that’s not actively trying to harm you.

Source: coded c++ for 20 years, now writing rust as much as possible.

~~~
Koshkin
Why not D, then? Just curious. D is “a better C++,” and it is a mature
language.

~~~
pixel_fcker
I looked into D once or twice. Found learning materials severely lacking.
Having to read up on the differences between 2 (3?) compilers and choose
between them wasn’t a great intro.

For the work I do GC is also a non-starter. I know it’s got some level of no-
gc now but the last time I looked it wasn’t well-supported.

In short it seemed interesting but on-boarding felt hard. And with that the
value proposition wasn’t there or well-advertised: It’s supposedly “better” in
some ways such as faster compile times and better meta-programming and frankly
that didn’t seem worth the effort.

Rust by contrast does an excellent job of onboarding and making it easy to
learn the language (at least at an introductory level). It also comes with a
very straightforward value proposition: just as fast as c++ but whole classes
of bugs simply aren’t possible. Add in a little bit of ergonomics and
functional flavour and I was hooked.

------
codesections
> As for platforms that users develop on - Linux and Windows continue to
> dominate.

That seems like a _very_ odd way to characterize the results (55% Linux, 24%
Windows, 23% mocOS). Why draw the line between the two platforms that are 1%
apart instead of between the two that are 31% apart?

------
EugeneOZ
I'll use this post to say "Thank you!" to developers of the IntelliJ IDEA Rust
plugin.

For those who didn't try: this plugin works even in the Community Edition of
IntelliJ IDEA.

------
zelly
You need a standard web/networking framework. Built in to the standard
library, like in Golang. That will speed up adoption. Rust's competitor is
C++. C++'s biggest weakness is build tooling, which Rust is demonstrably
better at with cargo. C++'s second biggest weakness is poor networking
support. Rust isn't any better. That's driving away the JavaScript/RoR/hipster
crowd which is the lifeblood of Rust's adoption.

~~~
twic
If Rust's competitor is C++, you don't need to attract Rails developers, you
need to attract C++ developers.

If anything, i would say that over the last year or so, too much effort has
been put into making Rust a competitor for web development, what with async,
and lots of attention paid to web frameworks. Meanwhile, C++ people i know
mostly look at it and say "meh, no const generics, no placement new".

~~~
zelly
C++ programmers will not switch to Rust. Most of them are older than the
maximum age where you can learn new things, let alone be willing (or allowed
in their company) to do so.

Rust will be most popular with those who are 18 years old now and wanting to
try native programming. When you compare the two, tabula rasa, it's just a no-
brainer.

~~~
dang
Please don't post flamebait to HN. Generational flamebait is among the dumbest
and most wretched sort we see here.

[https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html)

~~~
zelly
I'm not trolling. I'm confused why this is so controversial since it's widely
accepted folk wisdom (and confirmed by science). Learning gets harder as you
age. Just bing it.

[https://www.independent.co.uk/life-style/learn-language-
scie...](https://www.independent.co.uk/life-style/learn-language-scientists-
second-education-best-age-a8330911.html)

It's nothing personal against anybody.

------
decafbad
Anyone else asks for REPL? I like to have a REPL.

~~~
steveklabnik
Sometimes folks do. There even was a limited one, long ago. It’s just not
simple.

~~~
Koshkin
Come on, even Haskell has one!

~~~
gmassman
Haskell's an old language, pushing 30 years now... Rust is still a relatively
young technology. There are lots of improvements that could be built but only
a handful of people to build them.

------
jeddy3
"If you _summed_ the size of _all_ Rust projects you work in, how big would it
be?" (emphasis mine)

Then: "The majority of Rust projects (43%) are 1,000-10,000 lines of code."

Am I reading this wrong somehow? I've been rereading it a couple of times, and
feel like you can't draw that conclusion.

------
timClicks
Really interesting to see data science so prominent. Encouraging to see, from
my personal perspective.

~~~
Dowwie
Rust offers complete control over asynchronous streams of data with
uncompromising safety. I believe that this will make Rust a contender for the
Golden standard in data engineering, which supports data science. The survey
category may need to distinguish the two or data science will include it.

------
riquito
The industry chart need some love, the number of lines is twice the labels,
making it quite misleading

------
mesaframe
Regarding learning Rust, As a intermediate level developer. I find literature
for learning, and working with Rust quite lacking.

On the other hand C++ has some huge array of books. All of the them being top
notch.

~~~
justwalt
Is the Rust book not enough? I found it to be pretty great.

~~~
mesaframe
It is good enough for introduction but not much more. What I meant to say is,
there are no books that teaches you how to create programs using Rust.
Patterns and stuff...

~~~
timClicks
I am very curious about what you think about Rust in Action
[https://www.manning.com/books/rust-in-
action?a_aid=rust&a_bi...](https://www.manning.com/books/rust-in-
action?a_aid=rust&a_bid=0367c58f&chan=hn). It wont describe higher level
patterns, but does walk you through dozens of example programs. Projects
include:

    
    
      - a CPU emulator
      - a fully functional NTP client
      - a skeleton grep implementation
      - how decimal numbers are represented in Rust
      - developing your own format for representing numbers
      - a memory scanner so you can learn how game cheaters cheat
      - handling UNIX signals
      - inspecting binary files for hidden patterns
      - an OS kernel + bootloader
      - an L-Systems implementation

~~~
mesaframe
Can only tell after reading the book.

------
Scarbutt
Surprised to see backend web apps as top use of rust by a large margin. I
guess many take the common opportunity(web dev) to learn the language?

~~~
jasondclinton
I think that its a reflection of where much of the market's jobs are: "backend
web app" might as just well be replaced with "thing moving data around with
RPCs" which is what so much of the value software provides in the economy is
tied up, these days. Also, for startups who live-or-die by their cloud hosting
costs, reducing CPU utilization by 2x and MEM utilization by 5x versus GC'd
languages, the value proposition is real.

~~~
Thaxll
That's not how it works, since most startup run python / ruby / nodes code,
the cost of your app is definitely not a big concern, especially since you can
have performat code in any language, you don't need rust speed in 99.9% of the
cases.

~~~
nicoburns
Sometimes performance matters. At my previous company we settled on a Rust
solution for one component (ingesting analytics data) after cycling through
python and node prototypes that were just too slow (we had 100+ GB of data to
process, and the node.js app was taking 15 minutes to process one 500mb file).

And once the data processing code was in Rust, it made sense to have the
endpoint that collected the data in Rust too. It would probably have been
_possible_ to optimise the node/python versions. But it was _easier_ to write
it in Rust that is designed for these high-performance scenarios.

An unexpected bonus was just how reliable our Rust code turned out to be. I'd
definitely consider Rust for non-performance critical code on that basis.

------
FrankenApps
The text in the last survey question (target platform) seems wrong (or the
graphic is wrong).

------
jasondclinton
I was surprised to see the title "System Architect" was the second most-common
job title among respondents. Use of that phrase is culturally taboo within
Google. Are there regions in the world where its common to use that title? I
see that the respondents were from all over the world in 14 languages.

~~~
zelly
So many weird job titles/euphemisms for programmers. Engineer, Architect,
Developer, Scientist. How about none of them. You're a programmer. You're not
building bridges.

~~~
siscia
Hummm I find this view very disturbing.

While it is true that some developer builds yet another e-commerce cart on
JavaScript or PHP, some of is work in critical systems.

Systems that in one way or another allow our world to keep working.

What if DNS stop working? What if the service that get unemployment claims
stop to work? What if the system that manages patients in a big hospital stop
working? What if an avionics system in a big Boeing is done wrong? What if a
database that keep track of citizenship corrupt data?

Those are problem just as serious as bridges falling down.

Some structural engineers build houses some other huge bridges. Some software
engineers build carts for e-commerce, other fundamental systems of our world.

~~~
zelly
It doesn't mean the job is not important. It just means it's a different job
from the other job titles which have existed for hundreds of years in the
physical domain.

Programming is more like being a lawyer than engineering. But let's stop
making analogies to other professions and just call it what it is:
programming.

------
blondin
rust has an awful readability issue.

its syntax is too irregular and permissive. (too much ruby?) people tend to
disagree, but syntax is very important. that is, in fact, why python has won
the scientific community. we don't wanna be spending brain cycles deciphering
syntax.

as a side note, we blamed java for being verbose for years. in retrospective,
java was right. i have never seen a piece of java that i couldn't understand.
i may not know why the code is doing what it's doing, but i always know what
the code is doing.

java has stellar readability!

with rust, only time will tell. my gut feeling is that the readability will
not help the language when programs get old.

~~~
saghm
Can you elaborate on what exactly you don't like about Rust's syntax? I'm
always surprised when I hear this, because a lot of the things that get
pointed out tend to have good reasons for the way they are.

~~~
edflsafoiewq
But it doesn't _matter_. If the language is unreadable, even if every
syntactic decision followed by necessity alone from a set of first principles,
it wouldn't prove the language was readable. It would only prove the selected
principles necessitate an unreadable language.

Compare [x for x, y in v] to v.iter().map(|&(x,y)| x).collect::<Vec<_>>().
There is a good reason for every bit of ugliness, but that does not change the
fact that it _is_ ugly.

~~~
sgift
Readability is very often nothing else but habit - code which looks like code
you've seen often enough looks well. Case in point: The first example is just
gibberish to me and I needed the second one to decipher it.

Also, I would write the second example different:

    
    
      let r: Vec<_> = v.iter().map(|(x,_)| x).collect();
    

In my opinion that's superior in readability to both of your examples, but
probably also only because I'm used to it.

~~~
edflsafoiewq
Your r has a different type.

------
toby
Quick plug, my company released a lot of Rust code on Wednesday:
[https://github.com/mobilecoinofficial/mobilecoin](https://github.com/mobilecoinofficial/mobilecoin)

The SGX and no_std support might be of particular interest to some of you.

~~~
Dowwie
Not the right place or time for this, but congrats on your release

~~~
toby
Apologies, I was unable to delete my comment after I realized it wasn't
appropriate here.

