Live data from Hacker News

Maintain It with Zig

kristoff.it

51–60 of 286 posts

Re: Maintain It with Zig

#51

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…

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…

See, I see that as the opposite: it is easy to get offended by the joke precisely because it is not true. IMHO, the second version is better because, by removing the language at hand, it directs the joke at the idea of re-writing everything in the first place, rather than at some specific niche of people who may or may not even actually exist.

I could/would also get into a debate about "satire" and what exactly it is and means, but I have complicated feelings about it, how words change over time, etc.

Re: Maintain It with Zig

#52

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…

[deleted]

Re: Maintain It with Zig

#53

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

‘zig cc’ is more than that. You get a very powerful caching system, and built in support for cross compilation to a huge range of targets (via zig shipping with libc sources). Zig is extremely impressive.

Re: Maintain It with Zig

#54

> To improve our critical infrastructure we must improve the developer experience (DX) of systems programming, but rewriting everything is not the only answer. I like Kristoff from what I've read of him. He seems like a leader who will take responsibility and not shy away from hard decisions. On that quality alone, my money is on Zig winning systems programming over Rust in 10 years.

You can build C projects using Rust and Cargo as well[0], but it requires more work than Zig appears to need.

Rust also has good C FFI story and honestly I think we will still see a lot of important code rewritten in Rust.

That said, a more ergonomic C which seamlessly replaces the often bloated build configuration of C/C++ projects while allowing a far nicer language to slowly replace the existing code feels like TypeScript for JS (which I consider a good and smart thing). Definitely agree it's going to get far more use than I'd originally have guessed.

[0]: https://adventures.michaelfbryan.com/posts/how-to-riir/

Re: Maintain It with Zig

#55

Earlier quoted context omitted.

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

"simple" is, unfortunately, not a simple concept, nor does everyone agree on its effects on programs written in a language that is or is not simple.

Some people do believe that, let's say "conceptually parsimonious" languages (using complicated words to describe simplicity is amusing to me, sorry) do exactly what you say. Others believe that complexity inherently exists, and you can put it in the language, where a compiler can tirelessly check certain properties for you or a runtime can do magical complicated work on your behalf, or you can put it in the programs, where users have to check such things themselves.

Another way I heard this expressed one time is Ruby vs Python. I once heard someone talk about how they preferred Python as a language more, because it was simpler, but enjoyed actually programming in Ruby more, even thought it was more complex, and they value simplicity. The reason is that all of that nasty ugly stuff Ruby lets you do makes you be able to make extremely nice APIs. Things you couldn't do, or just folks don't do, in Python. And therefore they ended up liking using Ruby more in practice.

I suspect that this is a topic that we, as a profession, will debate about endlessly.

Re: Maintain It with Zig

#56
post #48

Earlier quoted context omitted.

Can you clarify your point?

Probably related to the following: https://github.com/ziglang/zig/issues/3180

Gee, IIUC it looks like it's been addressed by offering a new allocator that's able to detect use-after-free.

Re: Maintain It with Zig

#57

Earlier quoted context omitted.

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…

See, I see that as the opposite: it is easy to get offended by the joke precisely because it is not true. IMHO, the second version is better because, by removing the language at hand, it directs the joke at the idea of re-writing everything in the first place, rather than at some specific niche of people who may or may not even actually exist. I could/would also get into a debate about "satire" and what exactly it is…

I think the seminal text on offense, jokes, and satires in the worship of programming languages is probably https://web.archive.org/web/20061110043911/https://fluff.inf...

I've found it be to pretty useful in determining why I'm much more sensitive to things I care about than the things I don't, and particularly when jokes carry an element of truth that I cannot bear to acknowledge

Re: Maintain It with Zig

#58

Earlier quoted context omitted.

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

In my experience unsafe tends to be used really sparingly by most users, if at all. And besides, unsafe doesn't really turn off static checks - it allows you to do a few extra things that can't be proven to be safe statically, in tightly scoped specially annotated regions. It's mostly about bending the rules temporarily, for 1-5 lines of code at a time.

Re: Maintain It with Zig

#59
What I don’t understand is why Clang doesn’t do this? What’s stopping them from shipping libc’s for cross compilation? Given that they are a C and C++ compiler, surely this is in their domain.

Re: Maintain It with Zig

#60

Earlier quoted context omitted.

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

> 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.

Are you sure those examples of unsafe Rust code were written using unsafe in order to work around safety constraints due to difficulty?

I ask because there are some very real and valid use cases for unsafe code in Rust that have nothing to do with the fact that writing the code safely might be more difficult.

Post reply on HN