logoalt Hacker News

wewewedxfgdftoday at 2:50 AM4 repliesview on HN

I believe much more in making C/C++ safer than using something as complex as Rust.

SafER is better than deeply complex and unable to be understood except by Rust experts.


Replies

timschmidttoday at 2:56 AM

In my experience (20+ years with C/C++, and about 4 years with Rust), Rust is significantly less complex than C++, while being similarly capable. The extra syntax that throws off so many C++ devs is almost exclusively about data types and lifetimes, which I find very useful for understanding my own code and others', and which I wish I had in C++.

show 4 replies
vlovich123today at 3:01 AM

I don’t know what you mean by SafER but it’s important to remember that Fil-C sacrifices a lot of performance for that safety which detracts the reasons you’d be running that software as otherwise C was a bad language for them. Sometimes this won’t matter but there are places fil-c won’t be able to go that Rust can - embedded and OS kernel come to mind. Other places would be things like browsers or games. Rust gives you the safety without giving up the ability to do performance.

Also, I could be wrong but I believe any assembly linked into Fil-C bypassed the safety guarantees which would be something to keep in mind (not a big deal generally, but a source of hidden implicit unsafe).

show 1 reply
bfrogtoday at 2:57 AM

If you can’t understand ownership I’m baffled how you believe you can write well behaved C or C++.

Rust at least embeds this information in the API with checks. C and C++ are doc comments at best.

show 1 reply
TazeTSchnitzeltoday at 3:31 AM

Rust is a much easier language to master than C++.

show 1 reply