Live data from Hacker News

Maintain It with Zig

kristoff.it

1–10 of 286 posts

Re: Maintain It with Zig

#2
Interesting read and I agree that growth in technical debt is something to worry about. I want to get more involved and been trying my best to learn the skills needed but there’s so much to consider that it’s a bit overwhelming. I’m not familiar with Zig, it’s neat that it has a toolchain that can compile C/C++ but it reminds me a lot of Nim. Could someone explain to me some differences between the two and why you would pick Zig over the other besides personal preference?

Re: Maintain It with Zig

#3

Interesting read and I agree that growth in technical debt is something to worry about. I want to get more involved and been trying my best to learn the skills needed but there’s so much to consider that it’s a bit overwhelming. I’m not familiar with Zig, it’s neat that it has a toolchain that can compile C/C++ but it reminds me a lot of Nim. Could someone explain to me some differences between the two and why you wo…

I'd say Zig wants is really serious on wanting to be a better C, that is have the same (better?) access to bare-metal, memory and bits but with a better type system and error management and without C's footguns and cruft (build system, memory errors, preprocessor). I don't know Nim that well but it seems more ambitious and seems to cater to be more "general purpose" if that means anything. For example there's no hidden flow control in Zig.

Re: Maintain It with Zig

#4
Interesting; this piece advocates for porting only (or at least initially) the build system of C/C++ projects to use the Zig compiler and the build.zig build system for cross-compiling dependencies. A package manager in the works could be interesting too.

I don't do C/C++ development. How many headaches would using Zigs compiler & build system solve?

Re: Maintain It with Zig

#5
post #4

Interesting; this piece advocates for porting only (or at least initially) the build system of C/C++ projects to use the Zig compiler and the build.zig build system for cross-compiling dependencies. A package manager in the works could be interesting too. I don't do C/C++ development. How many headaches would using Zigs compiler & build system solve?

Zig has painless cross compilation, with gcc or clang it's a nightmare

Re: Maintain It with Zig

#6
Zig is a very interesting language. You are able to do thing that would require wizard level skills in C with simple plain language construct. Like serializing/deserializing an enum variants over the wire for example in the most efficient way (look at std.json.{parser, stringify} [0]).

> soon we’ll also have a package manager

This. If they succeed to do this (and I have my doubts) it will be a paradigm shift for low-level "system" programming.

Let's hope this is not vaporware.

Finally, it's relatively easy to contribute to Zig. Andrew Kelley is very opinionated on where the language should go with an emphasis on simplicity which sometimes can make things awkward but he is also persuasive and welcoming. I have been using Zig for a month and I am still positively surprised so he must be onto something.

[0]: https://github.com/ziglang/zig/blob/master/lib/std/json.zig#...

Re: Maintain It with Zig

#7

Interesting read and I agree that growth in technical debt is something to worry about. I want to get more involved and been trying my best to learn the skills needed but there’s so much to consider that it’s a bit overwhelming. I’m not familiar with Zig, it’s neat that it has a toolchain that can compile C/C++ but it reminds me a lot of Nim. Could someone explain to me some differences between the two and why you wo…

Nim is garbage collected, thus is a higher level language but doesn't fit the high performance low overhead of "systems programming" requirement.

While Zig is manual memory managed like C and nearer to the core, but harder to program.

Re: Maintain It with Zig

#8
post #6

Zig is a very interesting language. You are able to do thing that would require wizard level skills in C with simple plain language construct. Like serializing/deserializing an enum variants over the wire for example in the most efficient way (look at std.json.{parser, stringify} [0]). > soon we’ll also have a package manager This. If they succeed to do this (and I have my doubts) it will be a paradigm shift for low-…

I've been paying attention to Zig posts on HN, mostly just because it seems well-liked and I think Andrew Kelley is interesting/smart. Would it be fair to say that Zig is to C, what Rust is to C++? Or are they both just kind of...low-ish-level systems languages solving similar problems, differently?

Re: Maintain It with Zig

#9
post #8
post #6

Zig is a very interesting language. You are able to do thing that would require wizard level skills in C with simple plain language construct. Like serializing/deserializing an enum variants over the wire for example in the most efficient way (look at std.json.{parser, stringify} [0]). > soon we’ll also have a package manager This. If they succeed to do this (and I have my doubts) it will be a paradigm shift for low-…

I've been paying attention to Zig posts on HN, mostly just because it seems well-liked and I think Andrew Kelley is interesting/smart. Would it be fair to say that Zig is to C, what Rust is to C++? Or are they both just kind of...low-ish-level systems languages solving similar problems, differently?

Zig/Rust aim to fit in the same systems/general purpose space which can be viewed as alternatives to both C and C++.
Post reply on HN