Re:Zig, parser combinators, and why they're awesome
by k__ on Wednesday March 10, 2021 @07:58PM
(#26418767)
I had the impression Rust was more compatible with C than C++.
Re:Zig, parser combinators, and why they're awesome
by pcwalton on Wednesday March 10, 2021 @09:49PM
(#26419608)
Well, every language is more compatible with C than C++, because C is a subset of C++†. Even C++ is more compatible with C than with C++ compiled with a different compiler :)
† I know it's not a subset, but near enough for our purposes.
Rust is what you might imagine if starting over from scratch with C++, with a big emphasis on memory and type safety.
Zig is more like starting over from scratch with C, with a moderate emphasis on safety (no garbage collection or borrow checker, but undefined behavior handled more sanely than C)