Live data from Hacker News

What is Rust and why is it so popular?

stackoverflow.blog

221–230 of 284 posts

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

#221
post #200
post #187

Earlier quoted context omitted.

C and C++ have plenty of analogous checks- debug assertions in the standard library, runtime checks for uninitialized memory, sanitizers, etc. Do we have an idea how effective they are there? Do we have reason to expect Zig's to be any better? In fact, Rust approaches most of these particular problems the same way- arithmetic overflow, array bounds checking, stack overflow handling, etc. are all checked at runtime. R…

> C and C++ have plenty of analogous checks- debug assertions in the standard library, runtime checks for uninitialized memory, sanitizers, etc. Do we have an idea how effective they are there? Do we have reason to expect Zig's to be any better? Yes. Take a look at some of the checks Zig has. > Rust's language complexity is dedicated to things that Zig simply doesn't check, and that C and C++ have checked only recent…

> Take a look at some of the checks Zig has.

I did, to make sure I wasn't missing something. There's nothing new there, and some things are missing. (This is not bad, Zig is still in development, but it's not exactly a new approach either.)

> only C++ and Scala contend to be as complex as Rust or more. ... If you, like me, don't particularly like complex languages, then the complexity has a cost.

This is why I linked our Reddit conversation- Rust is nowhere near as complex as C++, and its particular complexity's costs are not difficulty in reading or code review.

> If you have an alternative to achieving a similar level of correctness with a much simpler language, I would very much prefer that.

But this is exactly my point- I don't believe Zig is such an alternative! Zig and Rust both improve over C and C++'s complexity and readability, leading to some general correctness improvements; so far only Rust does anything different to address memory safety.

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

#222

Earlier quoted context omitted.

I think this is misplaced causation. Don’t discount the fact that a significant number of programmers just like novelty and like Rust because it’s new in the same way Haskell is new to a Java dev. That said, Rust’s domain does seem wider than just systems programming. It has the right abstractions to be suitable for (edit: some ) higher level things like web apps. Personally Rust is turning into what I was assuming a…

> because it’s new in the same way Haskell is new to a Java dev Do you have any hypotheses about why we don't see as much publicity for Haskell then?

Don't we?

I think I see more posts about Haskell than Rust here on HN. (What makes sense, since fits a larger set of applications.)

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

#223
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…

Well, yes. There are plenty of popularity metrics there already, this one is about something else. As you said, mainstream languages won't win this one. But it is a valid metric anyway, and there is plenty of merit on winning it.

Think about this - if a bunch of people hate a language and stop using it, the following year that language's "most loved" score will increase. I wouldn't call that merit, it's just a bad metric.

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

#224
post #195

Earlier quoted context omitted.

"It is a niche feature" looking at C and C++ usage that niche is pretty huge.

It is, and C/C++ are used in so many areas which are not system programming right? Being a scientific Python backbone is one of them for example. My claim was that it is nothing out-of-ordinary. In fact, I really dislike the article's somewhat evangelist attempt to target newbies. These so-called benefits existed and do exist in so many other languages. The only thing that Rust comes with is memory safety which on cl…

"My claim was that it is nothing out-of-ordinary". Well I guess will agree to disagree there are pretty prominent cases of very capable people trying to do a project in C++ and failing and then leveraging Rust and actually delivering.

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

#225
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…

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.

I don't think there's a shortage of good embedded people. A lot of the companies involved in this travesty could afford them, and have access to good candidates, but have no reason to do it. Cheaper and commoditized hardware has lowered the barrier of entry for selling your own stuff, and the lack of regulation means that the consequences for screwing up in terms of security or privacy are basically zero.

What you see happening isn't an accident. There are companies that do excellent IoT work, with excellent people. Many companies that don't could afford to excellent engineers, and have access to a terrific pool of candidates, but their management chooses another way and they're perfectly aware of what they're doing.

(Sauce: am embedded developer, has been involved on and odd in the IoT scene since 2011 or so).

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

#226
post #221
post #200

Earlier quoted context omitted.

> C and C++ have plenty of analogous checks- debug assertions in the standard library, runtime checks for uninitialized memory, sanitizers, etc. Do we have an idea how effective they are there? Do we have reason to expect Zig's to be any better? Yes. Take a look at some of the checks Zig has. > Rust's language complexity is dedicated to things that Zig simply doesn't check, and that C and C++ have checked only recent…

> Take a look at some of the checks Zig has. I did, to make sure I wasn't missing something. There's nothing new there, and some things are missing. (This is not bad, Zig is still in development, but it's not exactly a new approach either.) > only C++ and Scala contend to be as complex as Rust or more. ... If you, like me, don't particularly like complex languages, then the complexity has a cost. This is why I linked…

> There's nothing new there, and some things are missing.

And it still goes further than C sanitizers (except the glaring missing piece of use-after-free, which I'm sure will be addressed).

> Rust is nowhere near as complex as C++

It's hard to quantify this, but I think few people would point at any language (in real use) other than Scala, C++ and Ada as being as or more complex than Rust, so it's at the very top. Some people are perfectly OK with that and even prefer such languages. Rust is well beyond my language complexity comfort level (even C# is too complex for my taste, and, as a high-level language it offer much better abstraction than Rust, or any low-level language). So if C++ is at 500 and Rust is at 300, that doesn't mean much if I want to be at 50 or 100.

> Zig and Rust both improve over C and C++'s complexity and readability

I don't see it this way. I find it hard to put C and Zig in the same category as Rust.

> so far only Rust does anything different to address memory safety.

I disagree with that, too. Rust is the only one that addresses memory safety using sound guarantees. If you run tests on a Zig program out of the box you won't have array overflows; that's not what you get in C and C++. Zig's "big idea" or "doing anything different" is how it does partial evaluation with a single construct (comptime) that is drastically simpler than anything I've seen. In other words, as far as simplifying languages with tough requirements for low-level programming, it's rather revolutionary. That's my preferred direction for programming languages.

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

#227
post #130

Earlier quoted context omitted.

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

Sure, but you still get memory safety.

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

#228
post #93

Earlier quoted context omitted.

It's mostly a hunch, based on a combination of lots and lots of factors. It's very difficult to explain. From a distance, "embedded" looks like a very homogenous field, but it's nothing like that. Some of the factors that contribute to this hunch -- but bear in mind that they don't apply everywhere in the embedded development space, nor equally, nor to every kind of device -- include: 1. A lot of resource-constrained…

Very interesting breakdown. Do you think that Rust could instead help outsourcing? Similar to how Java's GC keeps teams away from segfaults, could Rust's safety guarantees give companies more confidence that an outsourced team's code would have fewer critical bugs?

Uh, I don't think I can answer that question objectively. My opinion about outsourcing companies is heavily influenced by the fact that I am from one of those cheap outsourcing destinations, and it's anything but positive. (Edit: to clarify -- I have first-hand experience with outsourcing so yeah. Not positive.)

I guess -- but take it with a grain of salt, given what I've said above -- that it's something which shouldn't even play a role in deciding whether to outsource something or not. There are infinitely many ways to introduce critical bugs, and Rust -- any language, in fact -- helps with only a tiny subset of these. It won't help you against misusing crypto primitives, or failing to validate paths, or a bunch of other things.

(Edit: I guess what I'm saying is that, if you don't trust a development team to get something done in a language, you shouldn't trust them to get something done in any language. Bugs can happen in any language, and some languages make it easier than others to introduce some types of bugs. But good developers should be able to write good software in any good language, it's not like we're comparing Rust and INTERCAL).

Also, Rust is pretty complex, and it attempts to solve a lot of non-trivial problems. In my experience, attempts to handle this kind of complexity by organizations that focus on nothing but price and headcount misfire very, very badly.

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

#229
post #226
post #221

Earlier quoted context omitted.

> Take a look at some of the checks Zig has. I did, to make sure I wasn't missing something. There's nothing new there, and some things are missing. (This is not bad, Zig is still in development, but it's not exactly a new approach either.) > only C++ and Scala contend to be as complex as Rust or more. ... If you, like me, don't particularly like complex languages, then the complexity has a cost. This is why I linked…

> There's nothing new there, and some things are missing. And it still goes further than C sanitizers (except the glaring missing piece of use-after-free, which I'm sure will be addressed). > Rust is nowhere near as complex as C++ It's hard to quantify this, but I think few people would point at any language (in real use) other than Scala, C++ and Ada as being as or more complex than Rust, so it's at the very top. So…

> If you run tests on a Zig program out of the box you won't have array overflows; that's not what you get in C and C++.

Build a C program in the right mode (also required for Zig) and you get exactly the same thing.

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

#230
post #229
post #226

Earlier quoted context omitted.

> There's nothing new there, and some things are missing. And it still goes further than C sanitizers (except the glaring missing piece of use-after-free, which I'm sure will be addressed). > Rust is nowhere near as complex as C++ It's hard to quantify this, but I think few people would point at any language (in real use) other than Scala, C++ and Ada as being as or more complex than Rust, so it's at the very top. So…

> If you run tests on a Zig program out of the box you won't have array overflows; that's not what you get in C and C++. Build a C program in the right mode (also required for Zig) and you get exactly the same thing.

What mode would that be? The various fsanitize options? C doesn't have slices. Zig also allows turning on safety on a scope level. Not to mention the powerful comptime polymorphism/introspection mechanism that allows working in a more typesafe manner than C, while still being much simpler than Rust.
Post reply on HN