Earlier quoted context omitted.
If the error rarely happens then passing error data shouldn't affect performance in visible way. If the error occurs in common path then it's designed wrongly. I agree that in special states like OOM passing error data with allocation is not ok.
Error data being returned instead of just error codes doesn't require allocation at all, and never would, unless the specific unions that you're returning require as much. Zig already has tagged unions with a tag field and associated payload, that is exactly what you would return. The overhead isn't remarkably worse than the cost of modifying the value someone passed in to "Fill this in in case of errors" (which is w…
Why is Zig so cool?
451–460 of 527 posts
Re: Why is Zig so cool?
#452Earlier quoted context omitted.
If you have an example of what you're talking about, I'd like to see it.
An example of Zig not having generics, interfaces, and macros? I don't understand.
Re: Why is Zig so cool?
#453Earlier quoted context omitted.
When I read "I can easily say that Zig is not only a new programming language, but it’s a totally new way to write programs" I expected to see something as shocking as LISP/Smalltalk/Realtalk/EVE/FORTH/Prolog... A whole new paradigm, a whole new way to program. Or at least a new concept like the pure functionalism of Haskell, or Prototyping like in Lua/JS/Io. And I was so damn shocked how I must have missed something…
Dev celebs makes blogposts and videos on how Zig is awesome and unique, so the herd repeats.
Re: Why is Zig so cool?
#454Earlier quoted context omitted.
The standard models are pretty bad a zig right now since the language is so new and changes so fast. The entire language spec is available in one html file though so you can have a little better success feeding that for context.
> The entire language spec is available in one html file though so you can have a little better success feeding that for context. This is what I've started doing for every library I use. I go to their Github, download their docs, and drop the whole thing into my project. Then whenever the AI gets confused, I say "consult docs/somelib/"
Re: Why is Zig so cool?
#455Re: Why is Zig so cool?
#456> Probably the most incredible virtue of Zig compiler is its ability to compile C code. This associated with the ability to cross-compile code to be run in another architecture, different than the machine where it is was originally compiled, is already something quite different and unique. Isn't cross compilation very, very ordinary? Inline C is cool, like C has inline ASM (for the target arch). But cross-compiling?…
If you install Zig, you can now generate executables for virtually any target with just a CLI argument specifying the target, regardless of what machine you installed it on. Nothing else does that--cross compilation generally requires compiling the compiler to target a different architecture.
Re: Why is Zig so cool?
#457> Probably the most incredible virtue of Zig compiler is its ability to compile C code. This associated with the ability to cross-compile code to be run in another architecture, different than the machine where it is was originally compiled, is already something quite different and unique. Isn't cross compilation very, very ordinary? Inline C is cool, like C has inline ASM (for the target arch). But cross-compiling?…
> Isn't cross compilation very, very ordinary? Working cross compilation out of the box any-to-any still isn't.
Re: Why is Zig so cool?
#458Earlier quoted context omitted.
Destructors aren't just good. They are one of the most important innovations in programming, since they reduce boilerplate and prevent many bugs. Developing a language without them means introducing more bugs which could be avoided.
It violates one of zigs principle of no hidden control flow
Re: Why is Zig so cool?
#459Earlier quoted context omitted.
Dev celebs makes blogposts and videos on how Zig is awesome and unique, so the herd repeats.
Same can be said about other programming languages. Therefore the comment of yours has zero value…
> yours has zero value
Yours didn't bring much as well, so I suppose value isn't strictly required.
Re: Why is Zig so cool?
#460I love systems programming language and have worked on the Ada language for a long time. I find Zig to be incredibly underwhelming. Absolutely nothing about it is new or novel, the closest being comptime which is not actually new. Also highly subjective but the syntax hurts my eyes. So I’m kind of interested by an answer to the question this articles fails to answer. Why do you guys find Zig so cool ?
It’s hard to do something that is truly novel these days. Though I’d argue that Zigs upcoming approach to Async IO is indeed novel on its own. I haven’t seen anything like it in an imperative language. What’s important is the integration of various ideas, and the nuances of their implementation. Walter Bright brings up D comptime in every Zig post. I’ve used D. Yet I find Zigs comptime to be more useful and innovativ…