Hacker News new | ask | show | jobs
by Cthulhu_ 1946 days ago
C/C++ is a potential footgun, but it has its place for applications where they need precise control.
2 comments

You're not precise though. Precise ought not mean "It is possible to express precise thought regarding memory, yada yada, in this language", it ought mean "A person is capable of expressing precise thought regarding [...] in this language, without making mistakes".
Could you offer some insight or examples of where or how C permits or enabled more-precise control than is permitted or enabled by Rust?
You need unsafe in Rust just to do a doubly-linked list.
> You need unsafe in Rust just to [implement] a doubly-linked list.

And? That's what unsafe is for.

Yes, I agree, you can implement a doubly-linked list in Rust exactly as you can in C, with the same precise control.

You can even implement intrusive collections: https://docs.rs/intrusive-collections/

Unsafe is a normal part of the language, and how you manually implement precise control behind a safe reusable abstraction whose correct use can be verified by the compiler.

Do you have any examples of precise control you can express in C, but can't express in Rust?