Earlier quoted context omitted.
In my opinion, this is an important issue and not "bikeshedding", but it can be discussed whether the term "C/C++" is always an example of that idea or not. I think it is not, but it is connected enough, that I won't use it to side step the issues.
So there will be zero C language constructs, and C standard library functions being called, on your C++ source code?
Why is Zig so cool?
321–330 of 527 posts
Re: Why is Zig so cool?
#322While some of the features the author references are really interesting, personally I don't see how any of that would justify creating a new memory unsafe language in 2016. I thought it was pretty obvious by now [1][2][3] memory safety is best left to tooling / compilers and not to programmers. [1] https://research.google/pubs/secure-by-design-googles-perspe... [2] https://www.microsoft.com/en-us/msrc/blog/2019/07/we…
Re: Why is Zig so cool?
#323This is a very confusing blog post. I found myself looking for ChatGPT markers because it doesn't make sense to say: omg zig is so much cooler than C here's why, then start listing the absolute basics of the language that are identical in most modern languages without any actual reflection why writing the same thing in a different syntax somehow makes zig superior?
You're absolutely correct! The "how to modify an environment variable" bit and the bin-dec-hex table made me feel the same way. Then I saw the part explaining how to check for duplicates in a row... I'm struggling to understand the point of the article. Testing a text generator?
Re: Why is Zig so cool?
#324I like how Zig feels clear and simple to start with. I like that it gives one toolchain and makes cross compilation easy. I like that it helps people see how systems programming can feel approachable again.
I also like that C has done these things for many years. I can use different tools, link libraries, and trust that it will still work. I can depend on standards that keep improving while staying familiar.
I think Zig is exciting for what it adds today. I think C is cooler because it has proved itself everywhere and still runs the world.
Re: Why is Zig so cool?
#325Earlier quoted context omitted.
You're absolutely correct! The "how to modify an environment variable" bit and the bin-dec-hex table made me feel the same way. Then I saw the part explaining how to check for duplicates in a row... I'm struggling to understand the point of the article. Testing a text generator?
Also bizarre that it got to the front page of HN while being so low quality :/
Re: Why is Zig so cool?
#326Why are people so obsessed with Zig when Odin has been stable, though not yet with official spec, for such a long time and used in real production for years? Is it just syntax preference or does Zig provide something amazing that I am missing? Not that I use any of them, I am not interested in manual memory management and i stick to Go. But I'm curious.
I feel like Zig is aiming a lot higher. So that’s why it’s taking longer and also why people are more obsessed with it. The work on doing their own backend and incremental linker is impressive and interesting. So is their attempt at getting IO and async right.
Re: Why is Zig so cool?
#327This is a very confusing blog post. I found myself looking for ChatGPT markers because it doesn't make sense to say: omg zig is so much cooler than C here's why, then start listing the absolute basics of the language that are identical in most modern languages without any actual reflection why writing the same thing in a different syntax somehow makes zig superior?
Titles get the headlines.
Re: Why is Zig so cool?
#328Earlier quoted context omitted.
So there will be zero C language constructs, and C standard library functions being called, on your C++ source code?
I mostly write C, but yes even a simple call to e.g. malloc has different semantics in C++ (you need to cast).
Even better, all heap allocations should be done via ownership types.
Calling into malloc () is writing C in C++, and should only be used for backwards compatibility with existing C code.
Additionally there is no requirement on the C++ standard that new and delete call into malloc()/free(), that is usually done as a matter of convenience, as all C++ compilers are also C compilers.
Re: Why is Zig so cool?
#329This is a very confusing blog post. I found myself looking for ChatGPT markers because it doesn't make sense to say: omg zig is so much cooler than C here's why, then start listing the absolute basics of the language that are identical in most modern languages without any actual reflection why writing the same thing in a different syntax somehow makes zig superior?
- pointers to bitfields
- checked bitshifts
- small ints like u4
- imperative array initialization blocks
- test code blocks
- equivalent of debugger; keyword from js
- some vague stuff about being able to do at compile time
The rest is pretty genericRe: Why is Zig so cool?
#330This is a very confusing blog post. I found myself looking for ChatGPT markers because it doesn't make sense to say: omg zig is so much cooler than C here's why, then start listing the absolute basics of the language that are identical in most modern languages without any actual reflection why writing the same thing in a different syntax somehow makes zig superior?
Titles get the headlines.