by chjj · 4y ago · 0 comments
Bugs occur in rust code too. It's not a silver bullet to fix all problems associated with software development. Each language will have its own set of issues and quirks. It's easy to pick on C because it's been around far longer than most things. Give it 40 years and people will be saying "rust bad, new thing good".
Now, in places where security didn't matter, it suddenly does. Thus, it's not about bad coding habits, but inadequate care in extending privileges to untrusted users. The code should have been cleaned up first.
The issue is still the code, it's just the impact that has changed.
Not being a silver bullet doesn't mean it's not an enhancement.
Of the two bugs mentioned in this announcement, one is an uninitialized local variable, which is allowed in C but not allowed in many other languages (like Java or Rust). The other one is an implicit cast from an enum to a signed integer; in languages where this particular kind of cast must be explicit, not only it's easier to see when it's a signed integer, but also it's more probable that it would be cast to an unsigned integer instead.
> Each language will have its own set of issues and quirks. It's easy to pick on C because it's been around far longer than most things.
It's easy to pick on C not because it's been around for longer than most other popular programming languages, but because it has a larger amount of footguns. It's true that Rust has plenty of quirks of its own, but most of them will not cause security issues.
But a huge number of exploitable vulnerabilities are completely prevented by memory-safe languages. We've spent decades trying like hell to come up with other solutions to prevent these kinds of bugs in languages like C and utterly failed. Nobody knows how to write C or C++ programs of any meaningful scale free from memory safety errors without calling for total rewrites and ballooning budgets by 50x.
> Give it 40 years and people will be saying "rust bad, new thing good".
Of course. Rust will have systemic problems and some new thing will mitigate those problems. This is a good thing, not a bad thing. Why should there be any expectation that a language be the desired language for engineering projects until the end of time?
I've never seen anything quite like the rust community. They're hell-bent on recruitment. More so than any other language platform I've seen. Personally, I'm just sick of it. It's fine if you don't feel the same way. I was just voicing my frustrations.
Plenty of languages to chose from to replace C and its kind.
Also I should note that NVidia, prefered to go with Ada/SPARK instead of Rust for their automotive firmware.
Maybe Zig is currently the closest thing to such a candidate, but it doesn’t even pretend to aim at this, andalign with the "C ABI as interoperation modus for foreign function interface" policy, like the rest[1] of programming languages.
Granted it is a matter for the market to be willing to move beyond it, and the OSes written in it, but the matter isn't technical per se, rather economical, political, human behaviours,...
> it removes the last excuse of C/C++
Odd way of looking at it. I never ask myself "what _excuse_ can I give myself for using this tool"?
I'll continue using C and I don't need an excuse. I prefer C.
Also, what is so bad about crashing bugs? To me, as a programmer, they're very good news. It means you found a bug, you (hopefully) have a crash/log to analyze, and more importantly it means the program didn't just silently continue executing and corrupt state/data without anyone knowing.
Sure, but that applies to any technology on any platform at any time.
It's that it's parroted a thousand times every week.
Why is this an argument? Yeah, personally, I'd be very happy if in 40 years there's something better than Rust. It's been a solid few decades of C prominence, and moving from lang to lang should of course not be something that happens every few years. But on the scale of 40 years? I'd hope we aren't all still using something made today in 40 years, let alone a few years old.
Who said it was an argument? It's merely an observation of what I've witnessed here on HN: endless sentiment about rust and how everything should have been written in it.
The linux kernel was initially written 30+ years ago. Rust didn't exist. C did. Complaining about it being written in C does nothing to benefit anyone.
> I'd be very happy if in 40 years there's something better than Rust.
Me too.
For what it's worth, I agree. It's already written, so rewrite it yourself or use a Rust-based OS or work on Rust internals/specs in order to improve the language.
But I also believe that sometimes it can be a legitimate discussion. It can serve as a reminder that often these languages have footguns that even experienced developers that insist they can use C effectively will eventually fire off.
> Bugs occur in rust code too.
Generally speaking, not these ones.
> It's not a silver bullet to fix all problems associated with software development.
No one said otherwise.
> Each language will have its own set of issues and quirks.
But not memory safety ones.
> It's easy to pick on C because it's been around far longer than most things
Not at all. Lots of languages existed before C that had improved safety. It's easy to pick on C because, with regards to memory safety, it's awful.
If there's a significant improvement without critical downsides - I really hope they do. What's the reason not to?
It does nothing to help the situation. It's just complaining from people who won't be satisfied until all software is written entirely in rust. Why not contribute to the kernel and try to fix some bugs instead?
I don't care what memory safe language they choose, rust is just the obvious choice for this domain.
> Why not contribute to the kernel and try to fix some bugs instead?
Who says we don't? My company contributed a 0day to the Linux kernel just recently.
Maybe we're all saying "new thing better" because we're sick of people writing garbage software and making users unsafe? Maybe we actually know better than you?