3 ms·
Yes but a static analyzer could enforce _new_ projects to maintain single ownership model, which could push C and its existing tools closer to Rust. A borrow c
by glouwbug 7y ago
Yes but a static analyzer could enforce _new_ projects to maintain single ownership model, which could push C and its existing tools closer to Rust.
A borrow checker for C is totally feasible as it is just compile time analysis of object lifetime. Something like
gcc -fborrow-check would prop up C to safe new heights.
- Gaelan 7y agoIf you're writing new C, why wouldn't you write C++ or Rust? I think part of why Rust's borrow checker works so well is because its support for higher-level abstraction is so good; my impression is that manual iteration and general array munging is pretty hard to do in Rust (especially without runtime checks), but that doesn't matter because the iterator abstraction is so good. It'd be pretty hard to build something like Rust's iterators in C.
- glouwbug 7y agoC is still prevalent in embedded systems. Something like a clean slate strong type checker to remove C's weak type checking would be greatly appreciated for those who mainly work in IOT where C++ is already treated like C with classes.