‹ BackHN Continuity

Thread

What Zig felt like, coming from Rust

282 points · 351 comments · ksec

  1. plqbfbv · · focus · HN ↗
    Maybe I'm not that deep into programming, but I don't understand the hype about Zig?

    I programmed in rust a bit and can't say I'm an expert, but in my view rust mostly-solved the memory management problem at compile time and without a GC, and it works very well. The biggest con and cost I've always seen repeated so far is that "it's slow to compile", and I get that, if you're past 250 crates the final --release link tends to become noticeable, but there were improvements to incremental compilation.

    On the other hand - looking at the syntax from this post - Zig feels a blend of javascript, python and golang syntax that still requires memory management. So a nicer-written C that inherits all the issues from C? From the post: no functional programming, data mutation, memory leak, double-free, memory corruption.

    Personally I'd rather trade a couple minutes of final link every time when this is the other option.

    1. kllrnohj · · focus · HN ↗
      Zig is exciting to people that still actually like C. Is that a rationale choice? Not very often. Is it a wrong choice? Also again not very often. At least, not for anything in scope of a solo dev.

      The industry where it seems strongest positioned is embedded. Will it actually break into that domain? No idea.

      1. epolanski · · focus · HN ↗
        People that like C, won't move from C and don't have many reasons to do so.

        It's the lingua franca of software development.

        Zig is appealing to the "I'd like to work in a C-like system programming language but I'm not a C veteran" crowd.

        Not a small crowd by any means, but will always be a niche.

        1. a96 · · focus · HN ↗
          As a C veteran, Zig is interesting to me because of the compiler that still happily eats C. It has potential as a (cross!) development tool that can do a bit more than C tools alone. Which also describes Rust to some extent, but I think Rust would be more a full replacement. Which in turn is exciting because there hasn't been anything before that might replace C in my (embedded or -ish) environment.

          I haven't actually tried to find out if that Zig promise is real, though. Just some trivial little things. No day job excuse and no personal projects where it would fit.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.