2 ms·
Well, there are almost no good enough alternative to C++, in my view. Rust is hard to learn, Zig and other change the syntax way too much. Also, it would not b
by jokoon 5y ago
Well, there are almost no good enough alternative to C++, in my view. Rust is hard to learn, Zig and other change the syntax way too much.
Also, it would not be difficult to link against existing C++ libraries, or at least to wrap them using extern C.
The goal would be a language that has the good things that C++ has, without the cruft: long compile times, edge cases, etc.
It's pretty amazing how the C++ ISO group managed to add things without breaking backward compatibility, so imagine if they agree to explicitly deprecate thing. I just hope that one day, there will be a split between "old C++", that will still be kept compatible to not break old codebases, and "new modern C++".
I'm not an expert, but I think it might be doable, maybe with some compile flags? I don't really think it would break the ABI or break binary compatibility between old and new C++. I don't know.
- nemothekid 5y agoI don't understand the argument that Rust is hard to learn, unless you also mean C++ is hard to learn. If you come from C++, I don't believe the borrow checker should be that hard to learn; after all it's kind of just an extension of RAII semantics. It's far more straight concept than forward than C++ templates.
- xigoi 5y agoNew syntax is the easiest part of learning a language.
- speedgoose 5y agoI think Rust is much easier to learn than C++. The borrow checker is hell but once you understand that it’s very smooth.
- tialaramex 5y agoIn theory I think you could teach a similar subset of C++ to what's in safe Rust. But you immediately run into a big problem that all the rest of C++ is still there and not knowing about it can hurt you, whereas safe Rust is promised by the unsafe Rust that you don't need to care why any of this is possible.