logoalt Hacker News

Zig – io_uring and Grand Central Dispatch std.Io implementations landed

333 pointsby Retro_Devtoday at 8:22 AM237 commentsview on HN

Comments

portlytoday at 6:15 PM

As always with Zig posts, here come the haters. I really wonder why you even care about it. Can't we all be happy that Andrew and his team are doing their damnest to create something they believe in? Myself I am deeply inspired by their engineering spirit. In other posts I see people "worry" that Zig might not become mainstream. Why do people worry about these things? Just use the language if it helps you solve your problems. You don't need to treat it like an identity.

show 3 replies
bastawhiztoday at 8:03 PM

I'm not a zig fan myself, but I'm glad to see a substantial project with momentum and vision moving ahead. It's not languishing. It's trying interesting new things. It's striving for incremental gains consistently over time.

There's a lot of hate in these comments. Nobody is forcing you to use Zig and it's not trying to be "done" right now. And in fact, if the only thing they were focusing on was putting a bow on the project to call it "1.0", it probably wouldn't achieve any of it's long term goals of being a mainstream systems programming language. If it takes another five years or fifteen, as long as the project moves forward with the same energy, it's going to be fine.

For a fairly small project that's largely one dude, this is far more than most of us have or could hope to ever achieve ourselves. Give the people putting in the work credit where credit is due.

show 1 reply
BrouteMinoutoday at 11:26 AM

I feel like it's worthless to keep up with Zig until they reach 1.0.

That thing, right here, is probably going to be rewritten 5 times and what not.

If you are actively using Zig (for some reasons?), I guess it's a great news, but for the Grand Majority of the devs in here, it's like an announcement that it's raining in Kuldîga...

So m'yeah. I was following Zig for a while, but I just don't think I am going to see a 1.0 release in my lifetime.

show 12 replies
Seattle3503today at 7:16 PM

It's interesting to see this land while Rust support of io_uring in a mainstream library is lagging. And not for lack of trying, its just difficult to design a safe (zero-cost) idiomatic Rust abstraction over io_uring's completion based IO.

lukaslalinskytoday at 11:40 AM

I don't want to be the negative guy, but this is news about two unfinished implementations. There is a lot of work needed for this to be considered done. For example, no networking in the GCD version yet. And as these are being implemented, the interface stops being an interface, the vtable keeps growing, and it's just the current snapshot of what's needed by the std implementations.

show 1 reply
srcreightoday at 5:56 PM

There's a relevant open issue[1] here about stack memory optimization. It would be nice to be able to use a [500]u8 in a block and another [500]u8 in another block, and have that only contribute 500 bytes to the stack frame, but Zig can't currently do this.

(The green threads coro stack stuff makes this more important.)

[1]: https://github.com/ziglang/zig/issues/23475#issuecomment-279...

jauntywundrkindtoday at 11:39 AM

Contrary to the neggies, I am positive in Zigs effort to iterate & improve.

Right now there is no language that is good at io-uring. There are ok offerings, but nothing really has modern async joy that works with uring.

Whoever hammers out a good solution here is going to have a massive leg up. Rust is amazing in so many ways but it has been quite a brutal road to trying to support io-uring ok, and efforts are still a bit primitive, shall we say. If Zig can nail this down that would be fantastic!!

I would way rather Zig keep learning and keep changing, keep making new and better. Than to have it try to appease those who are too conservative for the project, unwilling to accept change and improvement, people focused on stability. It takes a lot of learning to make really good systems, to play with fit and finish. Zig is doing the good work. Imo we ought be thankful.

show 1 reply
Cloudeftoday at 1:41 PM

I like that zig takes freestanding target seriously. And seems like 0.16 becomes even better for freestanding code reusability.

khalictoday at 10:53 AM

Haven’t looked into MacOS internals for a while, happy to see they stuck to GCD, great middle ground for parallelisation

gethlytoday at 9:18 AM

[flagged]

show 13 replies
up2isomorphismtoday at 5:09 PM

When a language starts to do this kind of thing, you know it isn’t going to replace C.

nesarkvechneptoday at 11:56 AM

I’m waiting for the kqueue implementation.

show 1 reply
toshtoday at 9:31 AM

> Both of these are based on userspace stack switching, sometimes called “fibers”, “stackful coroutines”, or “green threads”.

show 1 reply
small_modeltoday at 12:07 PM

I like Zig, lots of great features that work in unison. However the worry is by the time it reaches v1 Rust will have consumed the space that C/C++ used to. I think it will be a mainstream language though and gain a lot more traction after v1. There is also the issue of will people actually code by then.

show 7 replies