Live data from Hacker News

I'm too dumb for Zig's new IO interface

openmymind.net

311–320 of 329 posts

Re: I'm too dumb for Zig's new IO interface

#311

I'm not a Zig PM but the first obvious fix for the issues the OP wrote about is to write better documentation, including usage examples (the more the better, almost to a fault). Also doubles as a good time to reflect on whether the user is having to do too much. If the tradeoff was absolute performance/avoiding introducing load-bearing performance-lowering abstraction I think that goal was achieved, but DX may have g…

I'm not a Zig developer, but I imagine one reason why the Zig documentation is so spartan is because the language is still young and constantly evolving. It's really hard to devote the time and energy to writing documentation when you know that what you've written will just be wrong at some uncertain point in the future.

Many would argue that Zig is not to be considered a young language anymore. It's been out for 9 plus years already.

A different answer to that question, could be that its still unstable and making breaking changes (not 1.0), thus a reluctancy to focus on documentation to a level many consider satisfactory.

Re: I'm too dumb for Zig's new IO interface

#312

Earlier quoted context omitted.

I do not think this is a viable excuse any more. I am just editing docs now that Claude Code writes for me. I am fanatic about developer docs (and I guess an exception as I love writing them) but with a set of concise instructions for CC and some writing style examples I get 90% there, sometimes 99%. If you believe you don't have time for the last 1--10% you should not be in charge of writing any API used by anyone b…

Ai is great at block comments, there is no excuse. Add to that a small anotated usage example written by a human and this whole post would have not existed. Lack of docs also cripple AI from understanding, so future adoption becomes even more bleak. If an api or library developer didnt bother doing even bare minimum docs, my confidence in the library drops aswell. Did they skip testing aswell? Ran the happy path for…

There's also a fundamental difference in Zig and Rust. Ever tried reading std code in Rust? If you have, you would notice one thing really quick: it's borderline unreadable. It's a hornet's nest of Generics over constraint generics calling into indirections.

Of course, this isn't meant to be a defense for the lack of documentation on Zig's side, but in my experience, Zig's code definetly is much easier to read, just because for the fact, that Rust's std code is akin to C++'s stl.

One of the personal grimes i have with Zig is, that `anytype` makes the function contract kind of meaningless, because you can't see what is expected purely on the function definition.

Re: I'm too dumb for Zig's new IO interface

#313
post #296

Earlier quoted context omitted.

> The talk you're so excited about actually shows this asymptote. Oh, I see the confusion. That asymptote is for the hypothetical case where the allocation rate grows to infinity (i.e. remains constant per core and we add more cores) while the heap remains constant. Yes, with an allocation rate growing to infinity, the cost of memory management (using any algorithm) also grows to infinity. That it's so obvious was hi…

> When you claim some technique would give a corporation a significant competitive edge, and yet most corporations don't take it (at least not for most projects), then that is evidence against that claim because usually companies are highly motivated to gain an advantage.' Corporations will generally want to optimize for ease of development and general ecosystem maturity. Rust is at a clear disadvantage at least wrt.…

But C++ is over 40 years old, and Java et al. displaced it in like five minutes. And that the footprint savings aren't worth much is pretty much the point. If you get 1GB/core and you use less, then you can't run more programs on the machine. The machine is exhausted when the first of RAM/CPU is, not when both are.

Re: I'm too dumb for Zig's new IO interface

#314
post #304

Earlier quoted context omitted.

It is also not "extremely difficult" to avoid memory-safety issues in most code, although I agree that Rust has a clear advantage. Essentially you need to have a clear policy on memory ownership and avoid pointer arithmetic by using safe buffer and string abstractions. That this often not done in practice is the issue, but I think the narrative that it is impossible in C or "extremely difficult" is more harmful than…

Easier said than done. In the real-world, in real projects, sustaining zero memory-safety bugs in large C codebases is exceedingly rare. Microsoft and Chrome have each reported that ~70% of their serious security bugs are memory‑safety issues, and curl attributes about 40% of its vulnerabilities to using C. Memory safety problems are really hard to avoid in practice in large C codebases. You can't just blame develope…

The real-world is complex with many trade-offs. The real question if in a 1:1 comparable situation and using similar efforts, you could achieve good memory safety in C. I believe this to be the case. I think the statistics we have seen are highly biased and partially misleading and the actual differences in the number of CVEs have many reasons (including legacy code, priorities, usage scnarious, culture etc). I mean, why even mention Curl, a project with portability requirements so extreme that it sticks to a long obsolete C version (30 years!). Proving the absence of memory safety issues entirely may indeed be harder, but ensuring a reasonable safety level is quite possible in my opinion. One should also point out that only safe Rust has guaranteed absence of memory safety issues, but it is Rust - and not safe Rust - that is competing with C.

Re: I'm too dumb for Zig's new IO interface

#315

Earlier quoted context omitted.

> Maybe, or maybe the fact that Zig is a small independent project with limited resources has also something to do with it Or, maybe it's this kind of redirection and evidence of a victim complex. Part of the reason that there's a patina of anti-Rust sentiment includes the dismissive attitude and swipes you, a the VP of Community at the Zig Software Foundation, take towards Rust and Rust developers by writing about t…

Much of that bad blood comes from how Rust's leadership attacks other programming languages, online and offline. pcwalton infamously declared zig was "a massive step back for the industry" https://x.com/pcwalton/status/1568306598795431936?s=46&t=OCi... . He and the Rust Core Team had a big reputation for burning bridges. Even to this day, the new Rust leaders are happy to attack other memory safe languages like Go, d…

https://news.ycombinator.com/item?id=4467200 is not about Go/memory safe btw

Re: I'm too dumb for Zig's new IO interface

#316

Earlier quoted context omitted.

Personal attacks like this have no place on HN.

Then Loris should have been perma-banned long ago. Until this is done, we'll have to warn people about engaging with him…

NOBODY should EVER be perma-banned just because you disagree with them! What the hell?

Re: I'm too dumb for Zig's new IO interface

#317

Earlier quoted context omitted.

Then Loris should have been perma-banned long ago. Until this is done, we'll have to warn people about engaging with him…

NOBODY should EVER be perma-banned just because you disagree with them! What the hell?

I don't know hat makes you think I'm talking about disagreement, but that's not what I'm talking about, if one cannot help insulting people on a forum, then what they deserve is a ban. First a temporary one, then if they still can't behave then a permanent one.

Loris is a bully, that's the problem, not his opinions.

Re: I'm too dumb for Zig's new IO interface

#318
post #293

Earlier quoted context omitted.

I don't think Andrew is anti-Rust. But Loris, whose hn profile says he's “vp of community of the zig software foundation” is as anti-Rust as you can get: he's pathologically obsessed by Rust and spent significant amount of energy outright insulting Rust maintainers here or on Twitter (when he's not buzzy writing anti-Rust rant on his blog). But as you say, there's no reason why Zig ought to be anti-Rust, both languag…

Huh, it all started with a Rust developer ceaselessly picking on Zig been memory-unsafe on social media. It would be one thing to write some technical post and be done with it but this obsession with Zig by Rust dev was infuriating to put it mildly. The same dev was very anti-Go in past and would post endless comments on Go here and elsewhere.

I used to follow pcwalton on Twitter back then (before it became a nazi bar) and that's a complete mischaracterization.

While he can get petty when talking about memory safety, he was never obsessed by Zig in any way, his tweet that ended up with Loris calling him “Coomer” among other names was a response to someone mentioning that Zig wasn't memory safe. I've never seen him mentioning Zig first on Twitter.

And on the other hand you have Loris, obsessed so much by Rust he can't help spawning in Rust threads or write dumb anti-rust rants on his blog…

(In fairness, I must say that Loris isn't even the worst offender, that title goes to M. Presler, who keeps spawning every Rust thread telling everyone who want to hear it that Zig is much better, despite having seemingly no stakes in the game (being a Java guy and having no public Zig contribution or even documented use of the langage). Sounds like the “Rust evangelical strike force” emotionally hurt a bunch of people so much they became lifetime haters).

Re: I'm too dumb for Zig's new IO interface

#319
post #315

Earlier quoted context omitted.

Much of that bad blood comes from how Rust's leadership attacks other programming languages, online and offline. pcwalton infamously declared zig was "a massive step back for the industry" https://x.com/pcwalton/status/1568306598795431936?s=46&t=OCi... . He and the Rust Core Team had a big reputation for burning bridges. Even to this day, the new Rust leaders are happy to attack other memory safe languages like Go, d…

https://news.ycombinator.com/item?id=4467200 is not about Go/memory safe btw

Good catch, the link should go to https://news.ycombinator.com/item?id=44672003 (the 3 was missing)
Post reply on HN