Live data from Hacker News

Rust is not a good C replacement

drewdevault.com

51–60 of 213 posts

Re: Rust is not a good C replacement

#51
post #5

Concurrency might be a dangerous thing but in microcontroller land, where I do my C programming, interrupts are a fact of life and just polling really isn't a practical solution.

Is that how Rust concurrency works under the hood? Polling?

No. Rusts memory model allows for the program to be validated at compile-time. It means that broken concurrency code won't compile.

(In some cases, you may need to defer validation to runtime by using wrapper types such as RefCell or Mutex, in which case the usual cost of mutexes and the likes appear.)

However, what was referred to is using interrupts vs. polling on embedded hardware. This is very different from regular software development.

Re: Rust is not a good C replacement

#52
post #21

If OP thinks Firefox is one of the largest C++ codebases in the world then OP has a very limited worldview.

That's true though, as far as the open source projects go. Only bigger C++ open source codebase I can think of is LLVM. What else did you have in mind?

Closed source codebases, presumably.

Re: Rust is not a good C replacement

#53

Earlier quoted context omitted.

I would suggest not taking comments on random github threads as the position of a completely different project.

I'm offering you an olive branch here. You can pile on the snark, or you can take my offer to issue a correction to my article. Edit: found the hostility. Fine, I won't issue a correction. I didn't find Steve's arguments entirely correct and I was willing to add a note to the page letting him share his perspective so the reader could make up their mind. Now I'm less open to that.

It does sound a little snarky but at the same time it's a real good point -- the article says "... met with hostility from the Rust & Cargo teams" and yet you cite "largely based on this discussion [of some other team using Rust to develop their project]."

So if this is an error on your part, maybe you could issue a correction without a specific comment or rebuttal from anyone.

EDIT: your edit makes you seem a little rash. I get that it might be overwhelming because the Rust Evangelism Strike Force (†) has showed up here but take some time to appreciate what folks are writing. Your article regarding Rust is naturally controversial and is filled with good points and bad ones. People will naturally pile on the bad ones.

(†) Tongue in cheek, I'm probably a charter member

Re: Rust is not a good C replacement

#54
You can't overstate the importance of a specification. It is the most loathed thing to write, like unit tests, but in the end is essential. I think the OP romanticizes a bit: K&R C had a spec, a very very very loose spec. It took ANSI a decade to put some meat on it. Early C compilers weren't much help: Sparc had SystemV and AIX had POSIX which are OS specs but still defined C behavior in their compilers, and it made life so much easier in the early 90's when they converged on Gnu.

My favorite part of the article is the footnote. We really need to stop referring to C/C++ as "roughly the same" because they are so so so radically different.

Re: Rust is not a good C replacement

#56

> But now you know why we are still writing C, and hopefully you’ll stop bloody bothering us about it. I don't think anyone will stop bothering them about it until C software security improves. Microsoft found that 70% of security bugs in their software were memory safety issues: https://www.zdnet.com/article/microsoft-70-percent-of-all-se... Languages like Rust are making an effort to address these issues. What's th…

I know the kernel is not the C language, but I think the efforts being undertaken to harden the kernel (use of syzkaller, etc) provide a good roadmap for C programs in general.

https://lwn.net/Articles/763641/

Re: Rust is not a good C replacement

#57
I think a better title for this post would be "Rust is not C".

I'm also not sure how stating the number of features recently added to a 47yo language is very small and the number of features added to a 8yo language is very large proves any point.

That you don't care about safety or concurrency has nothing to do with the title, and frankly betrays that this article is more about Rust not being last decade's systems language as opposed to Rust being a good candidate for future projects that would otherwise have chosen C.

Re: Rust is not a good C replacement

#59
> "measured by the number of bullet points [...] on Wikipedia"

> "measured by the number of headers in the release notes of major [...] versions"

I don't think it's a fair comparison to pull from these two types of sources, compare the numbers and expect a reasonable result.

The entire rest of this blog reads more like a rant about screws not being nails than an actual complain about the languages itself.

Re: Rust is not a good C replacement

#60

Totally agree with his observations but I disagree with the conclusion. C is a ok programming language. The first language that realises that simplicity above all is the most important feature of any language and uses the same safety measures like Rust is going to win over a huge user base.

Simplicity is not the end all be all. Where is Rust, as a language, needlessly complex?
Post reply on HN