Live data from Hacker News

Rust Survey 2021 Results

blog.rust-lang.org

31–40 of 135 posts

Re: Rust Survey 2021 Results

#31

Earlier quoted context omitted.

> Rust isn't many people's first language. Has anyone actually tried to teach/learn Rust as a first programming language? People did it with C++ (and even C) at some point, is Rust that much more problematic? (And the attempt might even inform new convenience features: the proc macro system gives Rust a lot of inherent flexibility there.)

People have. In my opinion, it's a bad idea. I think that to appreciate Rust's design, you pretty much have to be familiar with the awfulness of memory leaks in C/C++ (and it helps if you have experience trying to make a program in a GCed language hit strict latency requirements). I think Rust's design is genius, but I think the first language you learn should be an easy language with a GC (there's enough hard parts…

> I think that to appreciate Rust's design

Why not take it for granted like you do for C vs ASM?

Re: Rust Survey 2021 Results

#32
post #21

I have some time between contracts and I've found myself learning rust. Pros: - Sum types. I am an OO apologist, but trying to use classes in C++ is an exercise in frustration. Sum types map very well to union types and are a better fit for systems programming. - Unit tests built right into the language - it seems like a small thing but it's a hassle in most languages to choose a library, set it up etc. - The above,…

As someone with 20 years of C++ experience, in industries from everything from real-time systems through to low-level HPC graphics on CPU/GPU (currently in VFX), I really don't understand the hatred for OO programming, and I must be either missing something, or being lucky with the codebases I'm working on... It's a tool for encapsulation: you can get into trouble with it, but I'd argue the same is possible with many…

I wasn't criticising OO. I was talking about how much of a square peg in a round hole it felt - for me - to do OO in C++.

Re: Rust Survey 2021 Results

#33

I found this surprising... 59% of respondents sounds huge! "Rust can now safely be classified as a language used by people in professional settings. Of those respondents using Rust, 59% use it at least occasionally at work with 23% using Rust for the majority of their coding. This is a large increase over last year where only 42% of respondents used Rust at work."

I write a bit of Rust, but not for work, and I never heard about this survey. I think that's probably common - the more Rust you write, the more likely it is that you fill out the survey, so the sample is probably very biased towards people who work with it a lot (ie, professionally). Or - you could describe that as biased, at least. Alternatively, maybe the intent of these language surveys is exactly to find out wha…

I think it's true that surveys like this will skew towards more serious/dedicated practitioners, but in addition to professionals, the Rust community has also at various times attracted people who were excited about bleeding-edge things, or PLT/type-theory people, etc., and I think this survey probably does show a shift in the user base towards work-a-day users and away from these other groups.

(Or more succinctly: the absolute numbers are probably meaningless, but the trends are maybe worth watching.)

Re: Rust Survey 2021 Results

#34
post #29

I'm definitely in the camp that worry about the feature/complexity creep. I saw it with Haskell. Haskell 98 is a pretty nice and simple language. GHC Haskell is a monster. This matters when you try to read other people code and the overuse of experimental cool new features becomes a major burden for comprehension. Rust is already a very large language and for intrinsic reasons pile on a load more complexity than Hask…

I get the same feeling, Rust seems to be going down the path of "#[feature]" collection.

It shares that as well as horrendous compile times with Swift.

Re: Rust Survey 2021 Results

#35
post #16

The percentage of people using Rust continues to rise. How was the sample selected?

Why, selfselected of course! How surprising that people who still chose to fill out a rust survey in 2021 increasingly use rust! ;-) On topic, i’d like to try out rust, but can’t find good cause in my daily webdev needs.

Although I write mostly in Rust, when I have to do some web server side work, I use Go. Go was designed at Google for their server-side applications, and it's well-suited to that. All the expected libraries have seen very heavy use and are unlikely to have unexpected problems. Goroutines handle the job of both async and threads, simplifying concurrency. Rust is overkill for such work.

Rust is for complicated problems where both performance and safety matter. Web browsers. Databases. Operating systems. Industrial control. I'm writing a client for a virtual world in Rust. It's much easier to do complex concurrency in Rust than in C++.

Use the right tool for the job.

Re: Rust Survey 2021 Results

#36

I have some time between contracts and I've found myself learning rust. Pros: - Sum types. I am an OO apologist, but trying to use classes in C++ is an exercise in frustration. Sum types map very well to union types and are a better fit for systems programming. - Unit tests built right into the language - it seems like a small thing but it's a hassle in most languages to choose a library, set it up etc. - The above,…

> every method on collections like `map` or `filter`

I think you're remembering the various iterator adaptors, but they aren't methods on collections, they work on Iterators as their name implies. Somebody else explained why these methods can't all just return "Iterator" (that isn't a type) but just thought I'd mention you won't find map and filter in Rust's Vec or HashMap types, those methods live in the Iterator trait.

Re: Rust Survey 2021 Results

#38
post #21

I have some time between contracts and I've found myself learning rust. Pros: - Sum types. I am an OO apologist, but trying to use classes in C++ is an exercise in frustration. Sum types map very well to union types and are a better fit for systems programming. - Unit tests built right into the language - it seems like a small thing but it's a hassle in most languages to choose a library, set it up etc. - The above,…

As someone with 20 years of C++ experience, in industries from everything from real-time systems through to low-level HPC graphics on CPU/GPU (currently in VFX), I really don't understand the hatred for OO programming, and I must be either missing something, or being lucky with the codebases I'm working on... It's a tool for encapsulation: you can get into trouble with it, but I'd argue the same is possible with many…

> As someone with 20 years of C++ experience... I really don't understand the hatred for OO programming

Well, where should I begin:

    std::cout 
Is just a nice way of doing things...

As the other commenter said, it's not so much OO, but more GoF and how the 2000's OO went.

Please tell me why any basic library adds 3 or 4 levels of inheritance just to do something basic like vector or array. "Oh but this is to make things more generic" and yet nobody uses all that generic stuff. STL is often replaced by more "serious" users.

C++ (and Java) are 2nd systems syndrome gone to 11

I've just taken a look at the Vector implementation at my current system and it's an exercise in frustration. Meanwhile I can understand most of this https://doc.rust-lang.org/src/alloc/vec/mod.rs.html#400

Re: Rust Survey 2021 Results

#39

How's the compiler speed? I've been so burnt out on hobby programming on SwiftUI because of the horrendous long compilation times. Makes me long for some Pascal. :)

It depends on what you're doing. Rust is not uniformly slow to compile, the slowness is associated to a few specific features like generics and macros. (Good generic code should delegate to a less-generic implementation as early as possible. Hopefully full "const" generics will soon make this feasible in more cases.)
Post reply on HN