2 ms·
> how do you recognize that there are still not enough options One language that's still missing is a simple C-like language that offers Rust-style memory safe
by flohofwoe 3y ago
> how do you recognize that there are still not enough options
One language that's still missing is a simple C-like language that offers Rust-style memory safety but without Rust's design philosophy of repeating every C++ mistake (that's not about memory safety) and high level type system wankery (or generally too much influence from functional languages).
There are also many more areas still to explore when it comes to memory safety that are less extreme than Rust's approach (I completely forgot about Vale which tries out some really interesting things in that direction: https://vale.dev/ https://vale.dev/)
- 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.