In about 1.5h from now Andrew and I will do Zig SHOWTIME #42 to demo all the ideas behind the async I/O design that were not demoed already (or at least not as explicitly).
VOD
In about 1.5h from now Andrew and I will do Zig SHOWTIME #42 to demo all the ideas behind the async I/O design that were not demoed already (or at least not as explicitly).
VOD
I hope you donât mind I broke this off to give it more prominence.
That was very interesting, thanks, I just caught it in time. But I was hit by an advert at start, and so didnt register with the platform, hence a couple comments here, âdesign participationâ I think Andrew called it
The comment about cancel returning a possible result if already completed, how about just passing a cleanup fn into cancel? It could also handle errors and cancel has no return.
The redis example reminded me of the early days of dependency injection just before Spring destroyed Java. It can get messy real quick. Next thing that happens is a ReaderFactory, then and AbstractReaderFactory and before you know it you are looking at the redis protocol bit, but cant really reason about how it is interacting with anything passed in through a generic interface because the concrete implementations are so far away. And then you realise actually there is only a single concrete impl, unless you count a mock, and so why abstract it away.
I didnt know about globals like std.log. Are there also std.allocator and std.IoImpl proposed? than can avoid fn signature clutter?
Maybe relevant to my SoC stuff, I spotted some other magic dust sprinkles. builtin.singlethreaded I think it was called? What magic does that trigger? Are there others?
Anyway, very interesting, and my confidence in Zigs future grows. I also watched the road map, also very interesting, and I wish I could contribute more, but still catching up on 2 years away from Zig. Great that your share these discussion, thanks.
I have to say, you both have slick development setups there, impressive to watch. It might be nice to have the zig team have an about page, with the OS/editor/tools they use. I havent been that efficient with an editor since the early days of Java and eclipse when they got the realtime compiler dropping errors directly into the code as you typed. I guess Zig is also getting close to being able to do that with the new compiler tech.
defer myCleanupFunction(future.cancel());
No, logging is the only global of that kind.
Itâs a build option that you can pass to the zig compiler to build a program in single-threaded mode. I have it enabled in Zine for example:
zig build -Dsingle-threaded
And that gives you a single-threaded build of Zine :^) The stdlib recognizes that flag to turn mutexes into noops for example. You can create your own custom flags to have any kind of comptime specialization of the code.
I use Mitchell Hashimotoâs NixOS VM setup on a macOS machine. I like that a lot but afaik nobody else in the Zig core team does the same. Andrew runs NixOS natively for example.
The editor is Helix but thatâs not too relevant, errors, symbol renaming, doc comments, and goto definition come from the Zig Language Server (ZLS) which you can use with a variety of editors.