Live data from Hacker News

Rust Survey 2021 Results

blog.rust-lang.org

61–70 of 135 posts

Re: Rust Survey 2021 Results

#61

Earlier quoted context omitted.

I don't think this is entirely surprising. Rust isn't many people's first language. People who learn it, mostly do because they have become fed up with the unreliability (typically of C). This creates a bias towards people who are more experienced and have more organizational power. Also, language surveys tend to be biased towards power users which can shift the sample significantly. For example, the Julia survey fro…

> 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.)

The Rust subreddit regularly gets posts from people learning Rust as a first programming language. I'd say about half of them have a good time of it, about half give up and are directed towards python. Plusses tend to be good learning resources, and a welcoming community (easy to ask questions). Negatives being the borrow checker and a steep learning curve.

I'd say Rust is quite a bit easier to learn than C++, while being a step up from Java and two steps up from Python or JavaScript.

Re: Rust Survey 2021 Results

#62
That's not covered by the survey but I'm wondering how much of Rust usage is driven by crypto-currency projects. I'm personally completely convinced by the Rust language and the ecosystem, and decided to bet on it as my main tool for the next decade or so, but I'm also a bit worried that a lot of the money for Rust roles comes from crypto-currency projects (an industry I'm now very sceptical of given the amount of scam/bullshit we've seen during recent years). Not sure if my worries are warranted given my personal bias. Just something I have in mind.

Re: Rust Survey 2021 Results

#63
post #21

Earlier quoted context omitted.

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 thing…

What does std::cout Where is the level of indirection in std::vector implementations? With templates, c++ really doesn’t use virtual dispatch all that much.

Re: Rust Survey 2021 Results

#64
post #62

That's not covered by the survey but I'm wondering how much of Rust usage is driven by crypto-currency projects. I'm personally completely convinced by the Rust language and the ecosystem, and decided to bet on it as my main tool for the next decade or so, but I'm also a bit worried that a lot of the money for Rust roles comes from crypto-currency projects (an industry I'm now very sceptical of given the amount of sc…

I fully agree, that's exactly what I'm seeing in the job market for Rust in switzerland. It's unfortunate, but I guess more traditional industries are firmly in the grip of Java etc.

Re: Rust Survey 2021 Results

#65
post #11

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…

The problem with that is in large parts that Haskell 98 is very outdated, and so relatively basic and absolutely useful extensions are in the same pot as all the experimental stuff. Haskell Prime, essentially the Haskell 98 successor, is supposed to fix that. The first thing I do in almost any Haskell project is enable a bunch of extensions that I consider absolutely essential[1]. Most or all of those should likely b…

I think the GHC2021 group of blessed extensions provides what you want.

https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/cont...

Re: Rust Survey 2021 Results

#66
post #49

Earlier quoted context omitted.

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…

Rust is strict about ownership, which doesn't have equivalent in other popular languages. Users coming from GC languages are surprised Rust can't make things "live long enough". Users coming from OOP languages are surprised that Rust has on-stack objects without a layer of indirection. Users coming from C are surprised that references aren't like pointers. So I think it would be interesting to teach users Rust's poin…

> Users coming from GC languages are surprised Rust can't make things "live long enough".

If you really need a general 'long enough' strategy and can't just pick a sensible place to drop the object statically, that's what Rc and Arc provide - built from the ground up via refcounting.

> Users coming from C are surprised that references aren't like pointers.

For good reason. General "pointers" don't have a simple, compositional semantics that preserves modularity (Yes, I know about separation logic; that's not practically reasonable in a language like Rust - or C/C++ for that matter - that's not built around expressing complex logical invariants in code); references do. A piece of code that uses pointers in non-reference-like ways must be understood as a unit. Which is why Rust strives to reduce such code to a minimum, marked with a scary "unsafe" keyword.

Re: Rust Survey 2021 Results

#67
post #58

Earlier quoted context omitted.

.await is a postfix keyword - it effectively means "crazy control-flow (monadic) magic is happening here". "?" for failure handling is another bit of postfix syntax, that means something very similar. A good IDE will show it with a different highlight, so that it will never be confused for a struct member or method call. This stuff was discussed by the community for a long time - bikeshedding about syntax is a well-k…

Isn't "?" just a sugar for something like the following? That's how I think about it in my mind at least. // with "?" let v = x?; // without "?" let v = match x { Ok(o) => Ok(o), Err(e) => return Err(e), // exit current scope due to the return }.unwrap(); That feels like something that could be done with a macro.

Yes, that's control flow magic. It was prototyped with a macro, but failure handling comes up all the time in practical programming, and it's important to make it as ergonomic as possible.

Re: Rust Survey 2021 Results

#68
post #46

Earlier quoted context omitted.

The irony being that while C++ is known for its compile times, the ecosystem relience on binary libraries makes it much more tolerable. Microsoft is also shipping pre-compiled projections for Rust/WinRT. Then we have examples like image, that compile rayon twice, with different versions, because we just love to watch third party crates being compiled. However I should also add that compile times have improved greatly…

C++ binary libraries are a disaster. At least Rust is honest and tells you to just fall back to the C ABI for interop, and rebuild high-level abstractions around it in code that's built with the project - much like a 'header-only library' in C++.

I beg to differ, and until Rust community acknowledges they are relevant, there are industry domains where C++ will keep its dominance.

Re: Rust Survey 2021 Results

#69
post #62

That's not covered by the survey but I'm wondering how much of Rust usage is driven by crypto-currency projects. I'm personally completely convinced by the Rust language and the ecosystem, and decided to bet on it as my main tool for the next decade or so, but I'm also a bit worried that a lot of the money for Rust roles comes from crypto-currency projects (an industry I'm now very sceptical of given the amount of sc…

To my knowledge, most of the people working on Rust, the project, are employed full time at Amazon, Facebook, Google, Microsoft etc. There are a few folks who benefit from sponsorship from some crypto firms but I think that’s the minority.

While it’s a legitimate concern that many jobs appear to be from the crypto industry, I wouldn’t worry too much. Whether they’re scams or not, the entire community benefits from the software they sponsor and open source.

Re: Rust Survey 2021 Results

#70
post #68

Earlier quoted context omitted.

C++ binary libraries are a disaster. At least Rust is honest and tells you to just fall back to the C ABI for interop, and rebuild high-level abstractions around it in code that's built with the project - much like a 'header-only library' in C++.

I beg to differ, and until Rust community acknowledges they are relevant, there are industry domains where C++ will keep its dominance.

Take a look at the C++ community discussion around the feasibility of "ABI breaks". The C++ community is acknowledging the issues, and how they're getting in the way of continued "dominance" in many sectors.
Post reply on HN