Live data from Hacker News

Maintain It with Zig

kristoff.it

11–20 of 286 posts

Re: Maintain It with Zig

#11
If zig.build can alleviate the pain of building C/C++ projects, then it will surely to replace C in the future. So, IMHO, it's more important to get zig.build right than zig itself

Re: Maintain It with Zig

#12
Agreed for sure that working with C and C++ is the only way forward for systems languages. Rust's expression of this is the zero-cost C FFI, using native platform tooling, and stuff like that. Rust was never about re-writing the world, after all, its reason for existing was to eventually improve Firefox. The very first presentation about Rust (http://venge.net/graydon/talks/intro-talk-2.pdf) says "We are not “rewriting the browser”. That's impossible. Put down the gun."

Zig's cross compilation stuff and general compiler features, that this post talks about, is excellent, awesome, and makes me quite jealous frankly.

Re: Maintain It with Zig

#13
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?

> Would it be fair to say that Zig is to C, what Rust is to C++?

There's definitely something to that analogy, but I think it also misses a lot of really important details. For example, Zig has generics, which right off the bat makes it hard to say that it's "like C". Also Rust enforces memory safety, which isn't like C or C++.

Re: Maintain It with Zig

#15
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?

I think that's correct with some overlap, yes. Zig's explicit goal - as stated by the creator - is to replace C. Nothing more, nothing less.

I feel like Rust wants to replace C but it also wants to replace C++. And given the complexity difference between the two languages, that means that Rust will end up closer to C++ than to C.

So there's some overlap based on how Rust positions itself, but not based on how Zig positions itself.

Re: Maintain It with Zig

#16
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?

I think they solve some similar and some different problems, with some similarities and differences!

The biggest difference in the problems they solve, in my view, is that Zig does not aim for safety. It'll be easier to write safe programs yourself with Zig than it might be with C, but it doesn't give you any guarantees.

Zig also seems like it may be a better fit for embedded programming; there's a big community around embedded Rust, and it sounds like there's a lot of progress, but still an uphill battle.

But yes, Zig:Rust :: C:C++ has merit in that Zig is a much smaller, less feature-rich language.

Re: Maintain It with Zig

#20
> added a Rust dependency which in turn changed the list of supported platforms

My understanding is that `zig cc`/`zig c++` are thin wrappers around LLVM, so doesn't that just reintroduce the same problem?

Post reply on HN