3 ms·
> is a simple C-like language that offers Rust-style memory safety Ok, I see; but why then not just add this feature to C, or maybe Zig? > many more areas sti
by Rochus 3y ago
> is a simple C-like language that offers Rust-style memory safety
Ok, I see; but why then not just add this feature to C, or maybe Zig?
> many more areas still to explore when it comes to memory safety that are less extreme than Rust's approach
Such as memory arenas/pools (like Ada), or runtime automatic garbage collection?
- flohofwoe 3y ago> but why then not just add this feature to C It would most likely need to 'break' C in a way that it wouldn't be recognisable as C anymore or at least break compatibility with existing C code (e.g. removing pointers, or at least pointer arithmetics, and the way pointers and arrays interact).
- Rochus 3y agoNot necessarily; the compiler has to trace ownership anyway and could also detect "legal" use of pointers and reject certain uses for objects under the "borrow checker regime", as Rust does it. But of course one could take a subset of C and augment it with the new features, as it was e.g. done in C++ in the eighties or Simula (with Algol) in the sixties; the obvious advantage is the similarity to the original language and (potential) reusability of a large existing code base.