Hacker News new | ask | show | jobs
by pfalcon 1999 days ago
I'm sorry, but I do programming languages for decades, and familiar with a bunch of them. There's absolutely nothing special about Zig, it's yet another wannabe proglingo. What sets it apart is strong desire "to replace C" while being apparently "as different as possible from it".

I understand such a strategy (among many possible), and that will be a fun strategy if it pans out. The current situation though is that people question: why that dude purposely make it harder than needed for everyone?

2 comments

> There's absolutely nothing special about Zig

That's just not true. It is not only pretty exceptional in its general partial evaluation construct combined with compile-time introspection (although D and Nim have some similar features), it is the only language AFAIK where a single general partial evaluation construct is used in stead of type generics, value generics, typeclasses/concepts, constexprs, macros and conditional compilation.

Zig might not be your cup of tea, and that's fine, but it is without a doubt unique in its design and not only special, but pretty radical.

> Talk about confusing, implicit syntax of Zig

I don't think it's any more confusing than any other syntax (and less confusing than C's `for` syntax where the ubiquitous `;` is treated differently than anywhere else), even though it might not be familiar to you before learning it, but there is absolutely nothing implicit here. You might find `in` more appealing to you or more familiar than `|` but it's certainly not more explicit.

I feel like what you're complaining about is the equivelent of Calculon's critique of a screenplay: "no, I don't like the font". I am very much not a genius (check the user name) and it took me less than a minute to understand the payload operator (which IIRC was taken from Ruby or something).

Let's say `for (x in y) {}` replaced the payload operator. It would still exist in:

- if(some_error_union) |value| {} else |err| {}

- if(some_nullable) |value| {}

- while(some_nullable) |value| {}

- switch(some_tagged_union) { .some_tag => |value| {} }

And any that I might be forgetting. Is your suggestion that each of these should have separate syntax, thus complicating the language with one-off syntax?

> I feel like what you're complaining about is the equivelent of Calculon's critique of a screenplay: "no, I don't like the font".

Syntax is not irrelevant to the main use of a programming language the way fonts are to the use someone is probably concerned with if they ask an opinion of a screenplay, so, no, I don't see a similarity there.

> it took me less than a minute to understand the payload operator (which IIRC was taken from Ruby or something).

Loosely inspired by Ruby, perhaps, but definitely not taken from. Neither the positioning nor the semantics are the same.

> I feel like what you're complaining about is the equivelent of Calculon's critique of a screenplay: "no, I don't like the font"

I'm a human, and syntax is very important to me. 't broken read can syntax I. In that regard, if you purposely (or naively) misuse Comic Sans, then yes, "I don't like the font".

> (which IIRC was taken from Ruby or something).

Bingo. Ruby's not everyone's favorite language, so please be ready that people will send you rays of some hard love in that regard. Did you consider using C syntax for C-replacement-wannabe? (Rhetoric question.)

From what you're saying, I believe you would complain about a foreign language simply because it doesn't resemble your native language enough. Zig's syntax choices are not arbitrary and great effort is made to ensure their consistency. Your complaints about the syntax aren't that there is anything inconsistent or illogical about the syntax, just that it isn't the syntax you're used to.

That's a valid reason to not want to use the language, but I don't believe it is a valid basis for criticism and certainly doesn't excuse the hostility of your comments in this thread.

> From what you're saying, I believe you would complain about a foreign language simply because it doesn't resemble your native language enough.

I assume you mean a natural language. No, I won't complain about a real language used by people. I might criticize someone's inventing their own natural language. The same as I do for programming languages. And I'm very well familiar with the "we need to invent to move forward" argument. I also assume that people taking that ungrateful task are aware that they will receive criticism for that.

> just that it isn't the syntax you're used to.

Not just me, but many people. I specifically started to comment, seeing other people's feedback resonates with my own sentiment about Zig.

> certainly doesn't excuse the hostility of your comments in this thread.

I don't think there was particular "hostility", but I indeed try to nail right at the spot of the issues. Ouch! Beyond that, I allowed me some sour comments regarding downvoting other peoples' and my comments where concerns were raised with way Zig does some things. Such downvoting could be considered hostility, but I actually consider it funny ;-).

If you go into a conlang discussion and complain about people inventing languages when there's already natural languages, I guarantee you will get downvoted and pretty much for the same reason.

Let's look at some of your criticisms:

  > @call(.{ .modifier = .never_inline }, collectNoInline, .{gc});
> I'm sorry, but that's total nonsense. Shows that not enough good faith went into Zig design. Even in C, that could be syntactically annotated as:

  > /*pragma:noinline*/
  > collectNoInline(gc);
In which you say that a built-in function call with optional flags and settings is total nonsense, while hijacking comment syntax to change compiler behavior is better. You can make an argument for that, but the way you describe it as "total nonsense" and not in good faith is definitely hostile.

Let's look at some more examples:

> Jumping thru hoops is what Zig seems to choose with its unorthodox, different-just-to-be-different syntax.

> Zig appears to have strong NIH mentality in regard to the syntax. Trying to replace C, but go out of their way trying to invent syntax just to be different from it and most other things too.

Zig's syntax isn't that unorthodox except compared to languages that look even more like C than it does, and it definitely isn't different just to be different. By claiming such, when there are thousands of posts in discussions about syntax, is plain insulting. Can you provide even a single post that suggests anyone has ever suggested syntax be a certain way just to be different?