Live data from Hacker News

Rust is not a good C replacement

drewdevault.com

41–50 of 213 posts

Re: Rust is not a good C replacement

#41

There's a lot of stuff I could say here, but I'll stick to > Attempts to integrate it with other build systems have been met with hostility from the Rust & Cargo teams. This is very much not true. We've put in a ton of work to support this. Arguably, we've put in too much design work and not enough implementation work; we've had a few different attempts at making this work even better than it does today, and we haven…

not a great article, but also not a great response articles like what was posted are frustrating and can clearly hit a nerve, but instead of being defensive, try to use the feedback as indication that the work that's been done may just not be recognized, instead of it not being done

I think in general this is good advice, but my goal with the above is to do exactly that: provide information about what it is that we’re doing.

Re: Rust is not a good C replacement

#42
post #11

> Safety. Yes, Rust is more safe. I don’t really care. In light of all of these problems, I’ll take my segfaults and buffer overflows. I especially refuse to “rewrite it in Rust” - because no matter what, rewriting an entire program from scratch is always going to introduce more bugs than maintaining the C program ever would. And that is why we can't have nice things. "I don't really care" if someone overflows my buf…

I would say if you rewrite it and have more bugs, you must have no understanding of the existing codebase, or understand so little of it you shouldn't be the one rewriting it regardless.

All the rewrites I have done have resulted in leaner codebases with fewer potentials for bugs. I think people take some article one software developer wrote almost two decades ago as gospel, but "second system syndrome" doesn't have to be a syndrome.

This "rewrite" fear is exactly why our banks are stuck on 1970s and 80s code with an almost 60 year old programming language and no one left to take over maintenance. Eventually we need to get over this fear.

Re: Rust is not a good C replacement

#44

There's a lot of stuff I could say here, but I'll stick to > Attempts to integrate it with other build systems have been met with hostility from the Rust & Cargo teams. This is very much not true. We've put in a ton of work to support this. Arguably, we've put in too much design work and not enough implementation work; we've had a few different attempts at making this work even better than it does today, and we haven…

not a great article, but also not a great response articles like what was posted are frustrating and can clearly hit a nerve, but instead of being defensive, try to use the feedback as indication that the work that's been done may just not be recognized, instead of it not being done

There are constructive comments and then there are very opinionated rants. Eventually you just have to realized that you cannot always make everyone happy, in this case, a grumpy C programmer who tries to start a flame war.

Re: Rust is not a good C replacement

#45

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.

Steve has a point. You took what is essentially a random person on the internets comment as a true statement about a project.

Re: Rust is not a good C replacement

#46
post #4

There's a lot of stuff I could say here, but I'll stick to > Attempts to integrate it with other build systems have been met with hostility from the Rust & Cargo teams. This is very much not true. We've put in a ton of work to support this. Arguably, we've put in too much design work and not enough implementation work; we've had a few different attempts at making this work even better than it does today, and we haven…

Thanks for sharing your perspective. My comment was largely based on this discussion: https://github.com/mesonbuild/meson/issues/2173 If you'd like to share a short summary of your thoughts, I'll update the article with your commentary.

I didn’t read the entire thread, but if I understood the gist of it, it seems like an anti-pattern is being asked for, and it would be an anti-pattern when mixing any languages. What it seems they want is the ability to mix Rust and C in the same build chain, not treat each as a separate build artifact and link at the end.

I’ve never had a problem modeling things with Makefiles, having the Rust artifact target be built by Cargo and then linking with the standard toolchain for C in the Makefile.

I’m clearly missing some context, as this works really well.

Re: Rust is not a good C replacement

#47
As long as you don't write software for computers that are connected to a network, it's fine not to care about security. For everybody else though, new software should probably be written in a safer language. That doesn't have to be Rust of course.

Re: Rust is not a good C replacement

#48

Most of the author's points here derive from the fact that C has been around for nearly 50 years and Rust a mere 8. This post should really be titled "Rust is not a good C replacement _right now_". Yes, Rust still has a long way to go to be the right tool for all the things you can do with C today, but that doesn't make it less. It clearly has benefits when writing concurrent and safe code. You pay for this with a le…

Rust is much more complex than C, it is not even in the same sphere of usage. A language like zig could be a decent C replacement.

Re: Rust is not a good C replacement

#49

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.

Your article includes a fully unsubstantiated claim based on a discussion from an unrelated project. Asking someone else to do something to fix your mistake is ludicrous and is in no way "offering an olive branch".

Re: Rust is not a good C replacement

#50
> Safety. Yes, Rust is more safe. I don’t really care. In light of all of these problems, I’ll take my segfaults and buffer overflows. I especially refuse to “rewrite it in Rust” - because no matter what, rewriting an entire program from scratch is always going to introduce more bugs than maintaining the C program ever would.

Are they advocating for never rewriting anything? Like, programming language advancement should have stopped at C cause someone would have had to rewrite something and that would mean more bugs??

Post reply on HN