Re:The C juggernaut illustrated (2012)
by andrewmcwatters on Sunday February 05, 2023 @01:00AM
(#34662375)
Very interesting! I meant though that you're not a "nobody." People know of Zig, but might be people like me who don't know a tremendous amount about Zig.
Re:The C juggernaut illustrated (2012)
by AndyKelley on Sunday February 05, 2023 @01:07AM
(#34662405)
I'm being a little cheeky, but I'm pointing out that actually, in fact, I was exactly this nobody that you are talking about for a period of time, and I had a very similar inner thought process as you do in the parent comment :)
In particular:
> So I wanted templates from C++. And atomics from C++11. But that's about it. Other than that, I want to code like I'm in C. The beauty of C-style coding is that the control flow is so simple, it's impossible to not know what code is doing. Contrast that with fancy C++ stuff and you never know what's going to happen or what each line of code is going to do.
> I figured out how to have my cake and eat it too. I discovered that you can compile with g++ and link with gcc, like so:
> As long as you don't use anything from the C++ standard library, you end up with working code that was compiled with the C++ compiler and does not depend on libstdc++.> With clang it's even easier, just don't put -lstdc++ on the linker line.