Live data from Hacker News

Maintain It with Zig

kristoff.it

41–50 of 286 posts

Re: Maintain It with Zig

#41
post #15

Earlier quoted context omitted.

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 pos…

> Zig's explicit goal - as stated by the creator - is to replace C. Nothing more, nothing less. The ZIG compiler requires a C compiler to compile to a native executable though.

> The ZIG compiler requires a C compiler to compile to a native executable though.

Do you mean compiling the zig compiler or zig programs?

I think neither is quite the case. zig itself can build both Zig programs and C/C++ ones. Zig doesn't need to use a C compiler to build native Zig executables. It does need a linker, as does Rust, as do C/C++ programs and AFAIK zld is not yet ready.

However it's accurate to say that it's only able to compile the C/C++ code by leveraging libclang, the C/C++ compiler underneath.

Re: Maintain It with Zig

#42

Earlier quoted context omitted.

It is a weird self-fulfilling thing. People talk about it like it's a thing, so it's a thing, even if there's very little actual evidence of anyone sincerely holding this belief. People repeat that there's this plague of folks requesting that projects be re-written, and while it is literally true that I have seen two or three instances of this (you link to one of them, and notably it is not anyone harassing maintaine…

Why does it matter?

I think it matters less and less, which is part of why I didn't follow through on publishing.

As to why it used to matter, well, it is tremendously difficult to bring a new programming language into popular usage, and even more in the systems space. It requires tireless effort by a large number of people. It is a very fragile thing. The stories we tell ourselves and others matter, and they influence what happens.

That's all I'm willing to say right now :)

Re: Maintain It with Zig

#43

Earlier quoted context omitted.

Not sure if this transpired in the writing, but my interpretation of RIIR, partially informed by the chat with JT [0], is that this is a sentiment that I guess is there in some people, but that it was never something officially sanctioned. [0] https://www.youtube.com/watch?v=X7ny7Qrsbd8&t=5391s

It is a weird self-fulfilling thing. People talk about it like it's a thing, so it's a thing, even if there's very little actual evidence of anyone sincerely holding this belief. People repeat that there's this plague of folks requesting that projects be re-written, and while it is literally true that I have seen two or three instances of this (you link to one of them, and notably it is not anyone harassing maintaine…

As a counterpoint, I remember when someone satirized RIIR on HN and the post was flagged into oblivion even though the comments section was mostly approving.

https://news.ycombinator.com/item?id=25198571

Someone reposted the same document with Rust replaced with "$hotlang" which, for a reason you can guess, wasn't flagged at all:

https://news.ycombinator.com/item?id=25208313

My impression is that there are more than a few Rust developers who dearly believe in rewriting in Rust and were sincerely, bitterly offended by a joke to the contrary.

Re: Maintain It with Zig

#44

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 “rewri…

I admire your use of special quotes to not break my mental parsing of your quote.

Hilariously it was a copy/paste situation that I went "oh, that's kinda neat, I'll leave that" so I'm glad you noticed. (I am often guilty of nesting thoughts (inside of other thoughts) which is kind of amusing (even though I've never found lisps particularly easy to read)).

Re: Maintain It with Zig

#46

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

Aren't C projects relatively easy to build? C++ is a little more complicated, so there is more of a push for header only libraries there. I see the problem is probably with external libraries, but that is largely not a huge problem on Linux/Unix. Windows was more of a pain but msys/mingw alleviated most of it.

Re: Maintain It with Zig

#49

Earlier quoted context omitted.

I admire your use of special quotes to not break my mental parsing of your quote.

Hilariously it was a copy/paste situation that I went "oh, that's kinda neat, I'll leave that" so I'm glad you noticed. (I am often guilty of nesting thoughts (inside of other thoughts) which is kind of amusing (even though I've never found lisps particularly easy to read)).

I think typical writing style guides suggest the single-quote for nested quotes.

"I think he said, 'No way?! Zig for the win!'"

Re: Maintain It with Zig

#50
post #8

Earlier quoted context omitted.

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++? I don't think that's the parallel I would draw. Rather, I think both Zig and Rust aim to serve the use cases C and C++ do, but Zig and Rust pick different points on the tradeoffs involving safety. Zig feels like a "better C", in the sense of bringing modern language features to C, but it chooses safer rather than safe . Rust supplies modern language fea…

disclaimer: I haven't actually used either, just done a lot of interested reading and a little toying around.

One thing that impressed me about Zig is how simple the language is. I get the impression that it would take very little time to properly learn the language and become effective at it.

Rust, on the other hand, has a whole lot of complexity even without the ownership semantics. So much to learn and understand. And, in some cases, work around. It seems, from looking at others' code, that there is a very strong temptation to lean on `unsafe` instead of figuring out how to solve a problem within the constraints it normally applies.

That has me wondering if there's really all that much safety difference in practice? Simpler code is generally easier to understand, and it's generally easier to find and fix bugs in code that's easier to understand. I can imagine a world where it's a tradeoff between, "You definitely won't have any of this relatively narrow category of bug, unless of course you opt out of the static checks, which you will probably do sometimes, even though we tell you you shouldn't," and, "There are no particular guarantees, but you're generally less likely to have any of this broader category of bug."

Post reply on HN