Re:Will Hare replace C? Or Rust? Or Zig? Or anything else?
by atq2119 on Tuesday May 03, 2022 @09:27AM
(#31248006)
This is a pretty good hypothesis given the history of C++.
Re:Will Hare replace C? Or Rust? Or Zig? Or anything else?
by cestith on Tuesday May 03, 2022 @10:02AM
(#31248438)
I don't know about better, but at least almost as good of a C compiler built in seems like a big selling point. So that's, what, Objective C, C++, D, and Zig?
Perl has Inline::C that allows snippets of C code to be placed directly into Perl code like many C and Pascal compilers allow inline assembly. That's for interoperation and an occasional optimization of course, since Perl is in no way a C replacement for much of what's done in C. Do you foresee a replacement language having such inline sections, being a superset language like C++ or Objective C, or being able to just handle separate files/modules in separate languages?
My main motivation for using Zig is that it's rapidly becoming a better C toolchain that GCC or Clang. So I'm extremely motivated to compile all my C code with Zig when it becomes possible. After that it's only natural to write more of my code in Zig.
So, my hypothesis is, a language that could replace C has to have a better C compiler built-in than existing C compilers.
Another side of this, is that it has to be extremely easy to use C from the new language and vice-versa. Something I also think Zig does mostly right.