r/AskProgramming • u/Objective-Farmer4183 • May 03 '26
Architecture When is C better than Rust?
I've seen a lot of people saying that Rust = C but more secure. Is that true? Is there any catch or something? If you've used both of these programming languages, what was your experience with each? Which ones did you prefer?
I am writing this because I still don't know in which language should I code my backend for a website, and I don't want to mess things up. I am choosing low level because I want performance and low RAM usage + I am more familiar with low level languages.
TLDR; When do you think I should rather use C over Rust and vice versa?
View all comments
Show parent comment
3
u/DrHydeous May 03 '26
Then you can write Rust code that links just fine to the C library. You may need to make a very small amount of your Rust code
unsafewhere it touches the boundary, and there may be a small amount of overhead to wrangle function arguments and return values into appropriate types.These days the only time I would write C is if it's a small patch to existing C code, or for a platform where there's no Rust available.