Live data from Hacker News

What is Rust and why is it so popular?

stackoverflow.blog

121–130 of 284 posts

Re: What is Rust and why is it so popular?

#121
post #103

Because the StackOverflow survey which Rust keeps winning defines "Most Loved" as: > % of developers who are developing with the language or technology and have expressed interest in continuing to develop with it Because there aren't that many Rust jobs, almost no one has to use it. Which means people either try it and leave, they like the language and stick around, or they never use it (the overwhelming majority of…

Yup, which is what I alluded to with "However, the roughly 97% of survey respondents who haven’t used Rust" :-)

Re: What is Rust and why is it so popular?

#122

Earlier quoted context omitted.

I think you're asking rhetorically, but just in case: 1. Rust-the-language doesn't know anything about allocations, so strictly speaking, it cannot. Furthermore, without a GC, it's unclear how it could in the first place, given that a compaction would invalidate all pointers to that memory. 2. Certainly not to the same degree as the JVM, given that there's nothing inherently to inspect, like there is in languages wit…

> Rust-the-language doesn't know anything about allocations AIUI, Rust knows more about allocations than it should, since it's still limited to a single global allocator, and Box (which relies on that global allocator) is implemented via compiler magic and cannot be supplemented by equivalent library code. If Rust supported "pluggable" allocators in some fashion, fancy features (including heap compaction, although I…

`std` data structures that are generic over type of allocator are in the works.

Re: What is Rust and why is it so popular?

#123

Earlier quoted context omitted.

> I doubt that we'll see it used for low-power/resource-constrained firmware I'm curious what your reasoning is for saying this?

Are you going to use Rust on a PIC12 with 32 bytes of data memory and max 256 code instructions? Of course not. Assembly is still king in this low-powered embedded class and will stay as such for the foreseeable future.

But the full quote is: "I doubt that we'll see it used for low-power/resource-constrained firmware, but lots and lots of embedded systems are now bulky Linux boxes with years of uptime, and I can see Rust making inroads there."

There is a massive number of devices between an 8-bit PIC and a Cortex-A. Obviously you're not going to use Rust on a tiny PIC or similar, hell that architecture is outwardly hostile towards even C. I'm guessing these very low power chips will exist for many years to come, but a lot of work has moved over to things like Cortex-Ms which absolutely benefit from things like Rust.

Re: What is Rust and why is it so popular?

#124
post #80
post #74

Earlier quoted context omitted.

As someone who never much got into systems programming, Rust feels like a breath of fresh air. It makes systems programming way more accessible for me personally, coming from non-systems languages. Learning to write C well is just not something that appeals to me at all. From mostly an outsiders' perspective, I just don't think C is a very nice programming language. It looks easy to to pick up and it probably is (for…

> As someone who never much got into systems programming, Rust is a breath of fresh air. I think that's part of the problem :) Because Rust looks high level it appeals to people used to high-level programming. But once you get into systems programming, the issues are different from high-level programming, and you're less happy to pay for features that solve other problems. What I'm saying is, obviously, a matter of t…

Does the travesty that's currently playing out in the IoT space suggest that we now have a shortage of good embedded people or am I reading that wrong?

A tool that gets more decent developers to even look at embedded sounds like it would have been a good thing to have 5+ years ago, but better late than never.

Re: What is Rust and why is it so popular?

#125

The example of an error message in the blog post is the kind of thing that makes me seriously consider trying out rust. It's excellent. Are most rust error messages like that?

Most are that good, or better. I actually debated putting that error because it's one that doesn't have a "help:" line that actively suggests how to fix it.

Some errors are admittedly worse, and people like estebank are actively working on improving them.

Re: What is Rust and why is it so popular?

#126
post #39

Earlier quoted context omitted.

Yes and no. It provides some kinds of (important!) static analysis out of the box, but at the cost of complexity, which directly adversely affects some other kinds of (also important) static analysis. For example, there are sound static analysis tools that guarantee no undefined behavior of C code, but AFAIK, such tools can at best only work on a subset of C++, because of its complexity. Rust goes all out on eliminat…

What is the complexity, and what are its costs? As an active user of Rust, I haven't seen the (adverse) complexity or its costs yet. It's worth pointing out that Rust combats more than undefined behavior. Undefined behavior is a category of bad things that Rust works to eliminate, but Ownership goes beyond eliminating UB, and eliminates a large swath of potential logic bugs.

Programming in Rust is complex, I'm not sure how can argue against that, it is not straight forward to do simple tasks because of how you need to organise your architecture with the borrow checker.

Most people that starts using Rust get stuck on issues that you woudn't have with other languages.

Re: What is Rust and why is it so popular?

#127
post #114

Does anyone know how StackOverflow measures "love" towards a language?

> % of developers who are developing with the language or technology and have expressed interest in continuing to develop with it

https://insights.stackoverflow.com/survey/2019?__hstc=188987...

Re: What is Rust and why is it so popular?

#128

Wow, that is an extremely well-written brief introduction to Rust. I love the way it manages to address some more technical (e.g. FFIs, distinction between borrow-checker and other parts of compiler) but important concepts despite being so short. Thanks very much Jake Goulding if you're reading.

You are quite welcome! Hope to see you writing some Rust sometime!

Re: What is Rust and why is it so popular?

#129

Earlier quoted context omitted.

OK, I will bite. If I had to come up with a case where Python is better than Rust, I would say with rapid prototyping and scientific computing. If you just want to try a few things out, python has faster development cycle and if you want to do some super clever math python has better library support. With a bit more mind stretching, I can make a case for Go with a bit more mind stretching. If you want to write a mass…

> If I had to come up with a case where Python is better than Rust, I would say with rapid prototyping and scientific computing. Scripting? I'm not gonna write a 50 LOC single-use script in Rust.

I've found that a lot of scripts end up not being single use. In my case they usually do end up rewritten in Rust, with the benefits of having a proper --help command from the bother. Once you know enough Rust the obtuse parts of the language that must exist to cater for the performance critical crowd cease to be a problem.

Re: What is Rust and why is it so popular?

#130
post #80

Earlier quoted context omitted.

> As someone who never much got into systems programming, Rust is a breath of fresh air. I think that's part of the problem :) Because Rust looks high level it appeals to people used to high-level programming. But once you get into systems programming, the issues are different from high-level programming, and you're less happy to pay for features that solve other problems. What I'm saying is, obviously, a matter of t…

The nice part about Rust is that if you don't want to use a given feature, you can just ignore it. You can totally write Rust in a struct + functions style, just like C. If you want higher level abstraction only in some parts of your codebase, you can do that too. It's easy to mix-and-match.

Right, like C++.
Post reply on HN