Live data from Hacker News

What is Rust and why is it so popular?

stackoverflow.blog

61–70 of 284 posts

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

#61

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.

Maybe I misread it, but it sounded like the OP was comparing Rust to C or C++ on low-powered/resource-contrained firmware, not assembly.

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

#62

Rust is a great language if you use for what was intended, system programming and as safe substitute of C and C++. But it's not the answer of everything, to me it's nowadays abused in a lot of projects, there are instances of project where using Rust not only doesn't make a lot of sense but also can be slower than another languages, there are cases where Go is better, other where Node.js is better, other where Python…

> To me the Rust community seems to want to argue that everything should be rewritten in Rust I haven't seen this. At most, I've seen the push for rewriting important libraries where security is a core issue in Rust. I don't blame them. I'm tired of C/C++ being used everywhere because of performance, leading to the current-day situation of so much fundamentally unsafe code running the world.

I'm involved in a couple of github projects where we have had drive-by "hey, rewrite your project in Rust" PRs. Obviously not official or anything, but never seen anything like that for any other language.

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

#64
Great article. One nitpick:

> One of the biggest benefits of using a systems programming language is the ability to have control over low-level details.

I think this is a misguided conflation of "systems programming" and "low-level programming", those are separate things. See http://willcrichton.net/notes/systems-programming/

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

#65
post #58
post #55

Earlier quoted context omitted.

> Rust is without a doubt a (much) "better C++" but I'm not sure a better C++ is necessarily what systems programming needs most. I agree but if better C++ is what the PL industry can give me, then I'll take it, thank you very much! (Frankly at this point I'll take anything that isn't C++...)

There are alternatives that more appeal to my taste in the works. Given the cost of changing language, any language, I'll wait and see how they turn out before making decisions.

Which ones are more to your taste? For me it is mostly Zig which seems closer to what I want to see in a language. Crystal also looks promising but I prefer languages without GC. Rust is a good language but it is a bit too complex and restrictive at times.

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

#66
post #50
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…

Also, ownership checking only seems to work well for tree-like datastructures, but implementing something with cycles (back-pointers) immediately leads to nasty problems.

That's not a problem with Rust, it's a problem with back-pointers. You basically just need to fall back on raw pointers and do all the correctness checking yourself, precisely because the ownership model is not that helpful here. (Although if there is a pattern of "owning" references which involves no cycles plus back-pointers that are actually identifiable as such, that is directly supported via Rc and Weak.)

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

#67

The more pressing question: What is Rust and why is it so popular on HN?

People like to believe that the biggest problem they have with their code is memory safety, a problem Rust puts a significant effort into solving. At this point, most uses of Rust are also entirely academic, which appeals to HNs because they prefer theory to reality because reality is messy.

> At this point, most uses of Rust are also entirely academic

At this point, this is not true. There are significant production deployments of Rust. Heck, Rust code helped me post this comment, and read yours! (Okay that's strictly not true because I have Chrome on this computer, but had I posted from my phone, or from my other computer, it would have been Firefox.)

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

#68
This language is awesome, but I'm quite conservative when it comes to syntax. I don't like how Rust is trying to move away from C when considering syntax. I tend to prefer languages that can adopt the "C flavor". Python, in my view, does this very well: its syntax is simple, because it borrows a lot from C in its "flavor".

Rust is not doing that, and that's a hurdle.

In my view, the "C flavor" is very important because it's a standard of how people are able to read code. This has nothing to do with the C programming language, I'm just saying that simplicity is what made C popular and easy to use. I can understand that Rust brings very nice innovations, but in my view it should have done so while keeping the "C flavor" as most as it could have.

I admit it's a conservative view, but I tend to believe that a language can be more easily adopted if at its most basic level, it's simple to read for beginners. Rust is not great: I'm not talking about its learning curve, I'm just talking about the "flavor". A language is a tool of expression and communication, features matter less than readability.

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

#69
post #50

Earlier quoted context omitted.

Also, ownership checking only seems to work well for tree-like datastructures, but implementing something with cycles (back-pointers) immediately leads to nasty problems.

That's not a problem with Rust, it's a problem with back-pointers. You basically just need to fall back on raw pointers and do all the correctness checking yourself, precisely because the ownership model is not that helpful here. (Although if there is a pattern of "owning" references which involves no cycles plus back-pointers that are actually identifiable as such, that is directly supported via Rc and Weak .)

[deleted]

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

#70

The more pressing question: What is Rust and why is it so popular on HN?

People like to believe that the biggest problem they have with their code is memory safety, a problem Rust puts a significant effort into solving. At this point, most uses of Rust are also entirely academic, which appeals to HNs because they prefer theory to reality because reality is messy.

I don't think it's fair to say that Rust is entirely academic. It has a lot of production users including some very large names: https://www.rust-lang.org/production/users
Post reply on HN