Remix.run Logo
pzittlau 3 hours ago

I don't think that it's really subpar. It's just unusual compared to others. In and of itself it's very consistent. For instance there's `|capture|` for capturing all sort of things(errors, optionals, ...) in nearly all control flow constructs. `blk:` for naming blocks, `if`s, `switch`, and so on. Have a look at this blog post: https://matklad.github.io/2025/08/09/zigs-lovely-syntax.html

ulbu 2 hours ago | parent | next [-]

|capture| hides an inconsistency that bugs me – everywhere else, assignment to a variable flows leftwards. |capture| is an unnatural rightwards assignment.

in general, I like zig syntax, but i find that it had very little regard to how the eye moves on the page. it’s jarring at times.

simjnd 31 minutes ago | parent [-]

But the capture is conditional so it makes sense.

if (evaluation) result = evaluation

if (evaluation) |result|

Although assignments as expressions in C are convenient, I don't think they make a ton of sense and find Zig's capture easier to read (easier to immediately see what's being evaluated)

ulbu 19 minutes ago | parent [-]

if |result| (evaluation)

phplovesong 3 hours ago | parent | prev [-]

I saw that article previously. Nearly all of the syntax seem to be in-house with little benefit. All the examples could just use some modern c-like thing.

Zig has benefits, like comptime, no hidden control flow, memory mngmt, cross compilation etc. But its syntax is just a mouthfull of wats, whys and wtfs.

I can forsee a compile to Zig languge popping up sometime soon.