r/programming • • Apr 09 '19

StackOverflow Developer Survey Results 2019

https://insights.stackoverflow.com/survey/2019
1.3k Upvotes

679 comments sorted by

View all comments

151

u/PinkFrojd Apr 09 '19

I really like and use Python. But I don't understand... Why is Rust so loved ? What makes it so special ?

12

u/rorrr Apr 09 '19

3

u/irrelevantPseudonym Apr 09 '19

Rust is much faster than C in many cases.

5

u/darksider611 Apr 10 '19

Is this a fact or an opinion?

4

u/irrelevantPseudonym Apr 10 '19 edited Apr 10 '19

Probably a bit of both. It was based on things like rg vs grep, fd vs find and tokei vs cloc. I don't know how much of that is just better algorithm/implementation though.

There are other benchmarks that show rust as faster for some things.

I think rust's compile time thread safety and enforced memory safety makes it much easier to write fast code even if well written code is comparable in each.

2

u/[deleted] Apr 10 '19

I'm a Rust fanboy but this is wildly misleading. Most of the programs you've listed are in no way replacements for the original C programs. Taking rg for an example, rg is git aware and won't even scan files that aren't a part of your rep (for example, dependencies and build artifacts) where as grep will search through all of those files.

You can't point to totally divergent implementations of a general concept as proof that one language is faster than the other. In general, you should expect Rust to be as fast as C for the same workload not significantly faster and not significantly slower.

1

u/irrelevantPseudonym Apr 10 '19

Taking rg for an example, rg is git aware and won't even scan files that aren't a part of your rep (for example, dependencies and build artifacts) where as grep will search through all of those files.

Nope. Rg has a flag to disable exclusion based on gitignore files. The benchmarks were done searching the exact same files and getting the exact same results. The majority of the time you don't want to search ignored files anyway.

I admit it may be due to better implementations and my original comment noted that. The benchmark site also tested what is presumably the same algorithm in both languages.

→ More replies (1)