4 ms·
> Now since a few years we suddenly have a number of promising options but still not enough Well, but how do you recognize that there are still not enough opti
by Rochus 3y ago
> Now since a few years we suddenly have a number of promising options but still not enough
Well, but how do you recognize that there are still not enough options? I assume it should be a bit more specific than just a feeling or "personal preference", isn't it?
> Rust and D as attempts to a "better C++"
Rust has at least one big unique selling point which was not present so far in any other language (at least I'm not aware of any one): compile time automatic memory management. The unique selling point of D in contrast is not that obvious, at least not to me.
> whether that is actually true I can't tell though since I haven't used Jai yet.
Well then maybe someone else knows.
- 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.