Audio is good, video's good. Let's getstarted.So, welcome everyone. It's been a while.Uh, let's talk about what we didthat you might not know about. So, youknow, I see people tuning in. Probablyyou're interested in Zigg, but you don'tuse it yet. You want to know like, okay,I haven't really checked in. like whathappened in the last year and what arethose crazy people up to next year. Sothat's kind of what this stream is for.So,uh, to start, I'm just going to go oversome,uh, well, before I start, uh, Loris, doI need to make any announcements beforeI jump directly into, um, like like, um,recap and road map?Uh, or can I just go straight into theagenda that we already kind of hadplanned?That's a question for Loris. And whilehe's thinking about that, I willuh I'll just guess the answer to thatquestion. So, I think I'm supposed tomake an announcement aboutDermalsoftware you can love uh 2026.So, I don't know if Matt Knight uh Okay,this is the Italian one. Uh I think wealso have software.lo.There's the Canadian one. Okay. So, thewebsite is still on 2023.Uh, however, this is an announcement.Um, there will be a software you canlove Vancouver in 2026.So, uh, put that on your your mentalcalendar. I don't think we have datesyet. Um, but I know that Matt Knight hasalready started doing the organizationalwork. So, uh, yeah, kudos to Matt Knightfor taking that on. Anduh yeah, just just get ready cuz whenthat that's going to be a really nicethat's going to be a really nice event.So what's next? Uh I'll talk about theother announcement maybe afterwards. SoI'll I'll jump next intoumuh into kind of reviewing some of theaccomplishments that we've that we'vedone in the last year. So, if you don'tknow, uh, we do put a lot of work inthese release notes, so you can get alot of the information I'm about to giveyou by following it. But hey, this istext. Some people like text, some peoplelike video, and this is for all thevideo people. So, here you go. Uh,let's just review some some stuff. So,one thing um that we've focused on inrecently is a package manager. And so,some people are already using that. Andif I if I demo my little project here. Ithink I already have a a a binary I canrun.Oh, there we go. So, this is just alittle I'm I'm playing with a littlelike immediate mode UI. I'm doing somefont rendering. This is using Vulcanplaying with trying to learn Vulcanstuff. Eventually, I hope to turn thisinto like a like a music thing. Um, butwhat I want to show you now is just alittle feature that we added that maybeif you don't know about it, you reallyneed to know about it. And it's ZiggFetch. So zigfetch is part of our u toolchain for the package managerand what I want to highlight right nowis this particular workflow. So in thisexample um I haveuh let's look at my dependenciesbriefly.So I haveI have this dependency here on theshader compiler. Um this is a packagemade by u Mason Romeli uh which compilesum GLSL into Spearv.Um in the future we actually will have azig back end for this and actually wehave a proof of concept um that you canplay with. Uh shout outs to um AliChugri and uh Robin Verder for workingon that. Uh but in the meantime we havethis shader compiler and I need toupdate it. So one of the workflows thatyou can now do which is pretty handy isuh you can just take that if you want tojust update to uh like the latest masterfor example I can just do zig fetchsave and I do get plus and then thislink and that's going to get meit's not going tolink to the master one it's going toresolve it to a commit and put thatcommit in the um in the file. So thechange that that actually made was uhit's now fetching with git protocol.It's locking it into that particularcommit and it calculated the hash for meand and instal it on my system. So nowI'm ready to go ahead and rebuild. Umyou can see that change there. So if youhaven't been using uh zig build fetch,that's a nice workflow. So just keepthat in mind.Uh let me see what's next on our agendahere.I have a little We had originallyplanned for Loris to kind of like umwalk me through theseuh through the agenda, but now I got toI got to run the show. So, I got toscroll up a little bit on my my notes.One sec here.Yeah. And we will do um Q&A uh at theend. So feel free to get your questionsready.Okay, that was uh Ziggfetch. Let's moveon.So the next thing umI'll keep these highlighted. Uh the nextthing that I want to highlight isuh the fact that we've we've now made umx86 backend enabled by default in debugmode. So, if you didn't if you don'tfollow our um our devlog posts. Um it'skind of nice. There's an RSS feed, uhthey're all just kind of on one pagehere. Umand so there's this there's this this isthe post where we announced it, but I Ican give you a little demo here. Um themilestone that we've gotten to uhspecifically uh Jacob Young has gottenus to um and and Matthew Lug especiallywith like a lot of the front endimprovements uh have is that this thethe self-hosted x86 back end the onethat does not depend on LVM isum at 64-bit. It's nowuhit's now robust enough that it's now thedefault. In fact, let me show let meshow you something. Um, so here I havelet me actually just use one terminalsince I'm streaming here.There we go. Uh, let's take a look atrunning the behavior tests. And just tomake it even, I'm going to disable thesebecause those apply not to LVM.So I have a build here of the compilerand sorry it's over here and if I runthe behavior tests with LVMum we can observe how long it takes andwe can see how many tests it runs.Okay, so that was um 1,000.Let's just take note of this little datapoint here. Oops.Okay. And now if I get rid of this LLVMflag, it's now doing the default. Andbecause I'm on x86 computer, the defaultwill use our own back end. It will skipLVM.So you can see that was a lot faster.Uh anduh we can see actually it'spassing more tests. It's skipping fewerand it's um it's actually havingslightly more coverage than LVM. So uhyou know it's it'sthe story is a little more nuanced thanthat. But the point is that um the x86back end is if anything more robust thanthe LVM back end at this point. It's notstrictly better, but it is mostlybetter. And umuh so now it's the default. And it's thedefault because as you can see it's alot faster. Um just to do a quick littledemonstration of that, if we can go intohere, let's see my hello world here.Okay. And let's douhbuild exe hello.Yeah, that's what I want. And then liftLVM.Yeah. Okay. So, you can already see it'sa little faster, but let's let's racethose.And if I just collect about 5 seconds ofdata for each one. Let's take a look.Oops.Okay. Okay, so we can see that the usingLVM was this one. And by not using LVMand by compilinguh with Ziggs backend instead of LVM, uhwe went down from 1 second to um 225milliseconds. We used less memory. Uhand then this is kind of just anexplanation for why it's faster.Yeah, shout outs to um Matt Knight foruh naming uh for the name. We actuallynamed this um CLI tool on stream. So youhave embedded boy to thank for that.Uh okay. So that's that's the x86 backend. It's now the default. So try itout. Um that's um that's this is goingto debut in uh 0.15.uh which will be released in about amonth. Plan is for August 1st is atenative release date.Uh here's a good question. Um if yourproject uses a C library, do you stillneed to use LVM? No. Uh the um I don'tremember what the default is. We mightstill default touhif you have any libraries.No, we don't. Okay. No. Um the answer isno. This back end works fine if you linkCC code. Um you can still use it. Yeah.Um in fact, I'm pretty sure the projectI just demoed a second ago with thatlittle window was uh using theself-hosted back end. Uh and that'susing like um Vulcan C libraries andstuff like that.Uh and yes, it is also the default forrunning build.zig. So, your your Ziggbuild commands will now be faster aswell if you're on x86.Um, and now I know you might bewondering, what about if I'm on one ofthose Mac computers? Well,hold on. We'll get to that.All right. Why did I lose my littleagenda notes? Hold on. Sorry.We'll get there. That's a foreshadowing.Okay. But be for now, let's move on to adifferent topic. Uh so I want to showyou another thing that is now happeningby defaults.So ifuhlet's look at some C code.So one thing that um a lot of peoplediscover Zigg for is um Zigcc.So we have we have this it acts justlike a C compiler with caveats.Um and sorry before I move on to thistopic I do want to address CaseyBounder's point uh which is a goodpoint. I forgot to mention um on Windowsx86 backend is not the default yetbecause uh we need to make some coughlinker enhancements before we can enableit by default. Um so that that is acaveat there. Uh we'll get there. We'llget there. Yeah, one thing at a time.Um,and that's the answer to this question.So, the answer is it does work onWindows, but the problem is uh we needto make some linker enhancements beforeit's uh before we can turn it on bydefault. So, that's that's coming up.I don't know if we'll get to it in timefor 015, unfortunately.Um, but it it's definitely a higherpriority issue.Okay. Uh, so let's talk about Zigcc fora moment. So, one thing that's importantto understand about zigcc is that it'snot trying to be while it is trying tobe compatible with the C compiler uhcommand line interface, it's not tryingto be literally exactly the same as umas clang. Uh in particular, we havedifferent defaults.Uh and the defaults kind of map toZigg's paradigm.Um, in fact, the way that this works isthat we we collect the C command linearguments and then we translate thoseintothe equivalent of what zig command linearguments would would um would specifyand then we lower that intouh commands that we pass to clang andall things like this and that that'skind of a crucial part of what zigccoffers. I'll give you an example. So ifyou do zigccuh like O2um what actually happens is in thecommand line parsing we interpret O2 asreleaseuh release fast. But if you pass in O2uh F sanitize equals I don't know um Ithink it's just I I forget what thecommand is. Maybe it's just f Sanitize.If you pass if you enable um Ubisanuh oh there we go. If you do this one uhwe interpret this combination of flagsas release safe and then later weprobably just lower it to exactly theseum these flags again. So why do we gothrough that maybe seemingly unnecessarylike middle state? Because that middlestate affects all sorts of other stuff.Um so for exampleby default you're getting debug mode andbecause you're getting debug mode we doenable um undefined behavior sanitizerand one of the things that we recentlyum added uh shout outs to uh David RubinI believe that's your name. Um we nowhave a nice printing for this. So, forexample,uh some somebody shout out theirfavorite undefined behavior.How about How about signed integeroverflow?H gray header had it. Good job. Um okay,so we're going to douh arg ccompiling a file without a trailing newline.Oh man, that's a really good one.Okay, we're going to do arg plus umahwhat one to the uh 31.Okay,I guess I could have just done that,huh?Okay. So, let's tryuhthere we go. So, let's see what happensif we compile this. Oh,I'm too ziggpilled for this.Thanks, Matthew.Uh, okay. So, let's try um let's trycompiling this code with ZCC.Okay,there's a little spoiler. Lib Ubisandthere.Now, some of that stuff only hadhappened once. And I'll show you that ifI make some changes, such as by adding apointless comment. Uh, that was aninstant rebuild because those thingsthat took a while to rebuild, those werejust um like support libraries. Thoseonly have to ever be done exactly onceper target. So, I pretty much never haveto do that again until I switch versionsof Zigg.Uh, so no, let's try running thisexample. And it's going to Oh, II hit um I hit undefined behavior beforeI hit the undefined behavior that Iintended to hit. Oops.That's a perfect example of what I'mtrying to show.Well, just for fun, let's try to get theintended undefined behavior. But, uh,I guess that's why I instinctivelyreached for Python here. I just didn'teven trust C even a little bit.Okay, so let's try that.Uh,wait. Long. What?Format specifies type int but theargument has type long. Why is it long?Oh, wait. What?One doesn't fit in an int. What do youmean it doesn't fit in an int? Of courseit fits in an int. Oh, I need minus one.Oh, okay. Yeah. Yeah. Off I won.Classic. Okay. So, if I run my example,uhoh crap, I wanted six.I have to rebuild too. Okay, there wego. Well, this is the example I wastrying to show. Um now if I pass anargument I get a undefined behavior andwe get the uh actually nice panic with aback trace um with a message thatexplains the problem. So um anyway pointbeingthe default uh of zigccalready was uh was this turning onundefined behavior sanitizer. The newthing that I'm trying to show you thatwe did recently was adding by defaultthe uh undefined behavior sanitizerlibraryuh which tells you the problem. Sothat's a lot more friendly for umuh for beginners who are learning C. SoI would argue to you that um Zigcc is agreat way for uh students to learn Cprogramming becausethis isthis is so much more uh helpful thanjust getting like wrong behavior atruntime or like you compile withoptimizations on and then uh it stopsworkingand then uh yeah and the way this isimplemented by the Okay, it's it'sliterally just calling panic in the zigstandard library and then the zigstandard library is doing the stacktracing. So it's pretty it's prettyneat. It's pretty nifty.Okay, so that was uh undefined behaviorsanitizer with zigcc.Um moving on uh let's let's look at somelanguage changes.So again, I want to tell everyone thatif you read our release notes, this is agreat way to upgrade your code inresponse to language changes because forexample, if you go to language changes,and in fact, let's go to a differentone. Let's go to this one. Um, actually,let's go to a breaking change. Uh, thisone for example. Okay, so we'll tell youall about all the language changes. Forexample, export changed to be a pointer.Now, we'll give you a reason why wechanged it. And then we'll tell you ifyour code looks like this then you canupdate it like this and now it willwork. And in the best case scenariowe'll also give you like a compile errorso that you can search for the compileerror. I don't see too many of thoseright now but umanyway point is upgrade guide will helpyou if you're trying to upgrade. Um, butI want to show you uhone of my favorite new features in Zigg,which is um labeled switch.I think to demo thisum I'm going to open upuh the Zix tokenizer.So, if for those who aren't superfamiliar with compiler development, umtokenizer is kind of like the firstthing that a compiler does to yoursource code. It just looks at it andfigures out like what's a space andwhat's a keyword and what's likepunctuation and stuff. Um so, Zixtokenizer, it's going to in it's goingto input a string and it's going tooutput an array of tokens. Zix tokenizeris uh 1,776 lines andumit's basically a state machine. Prettymuch every tokenizer is a state machine.So here's our like state here's ourpossible states that the tokenizer canbe in. Uh it's just an enum and theheart of a tokenizer is just basicallythis. It's just a big big loop thatswitches on the state and what um whatbite in the stream did you look at next.Now, if you haven't seen this languagefeature, uh check this out because thisI think it's super cool. Uhas you may know, um Zigg does not havegoto. Uh as you might not know, uh Ziggactually used to have Goto. Fun fact.Yeah, we deleted goto.That was never against goto inprinciple. Um, but what I determined isthat it's redundant with labeled breaklabeled continue and especiallynow that we have uh labeled switchcontinue. So what you might findinteresting here is thatum let's look for lowercase stateand defer. That's a good point. Yeah. Umyeah. So the so what you do is you labelthe switch statement with a with a labeland then now it's eligible to becontinued like a loop. So what's superfunny about this is that when we switchwe're actually switching on a constantvalue. We're just switching on the startstate and we we don't even store thestate in a variable. See that? There'sno variable that stores the state. Sothis just control flow just goesstraight to here. It doesn't even haveto check a variable or something.Um so then we immediately start lookingat the next character and we handle uhwe handle like the end of the string orwe handle a space and everything. Everytime we terminate um one of theseblocks, we do a continue, a labeledcontinue. So this basically just jumpsback to the switch with a differentuh value. And so but what's neat aboutit is that if if this value is umcompile time known, doesn't have to beum but if it is compile time known, thatis just a go-to. So for example, um thisis like continuing with uh stringliteral enum value that's going to jumpdirectly tohere. That's a go-to.That's it's just a go-to, but it'sstructured. So it's not going to likenot initialize variables or something.Uhand we can also find examples of notcompile time continues.Umwell a lot of them are compile time butum point is that that generates reallyideal machine code and even if we use aruntime value which I didn't find aninstance of um but if we did what's niceabout that is that it will then do thebranching logic at that location andthen jump directly from there to anotherlocation. So what that does is it movesum instead of there being like a whileloop here where that's uh there's areally like um mispredicted branch,right? Because uh this this switch herewill be mispredicted if it's in a whileloop because it's it's not likely thatthe next bite in the source code isgoing to be the same bite as theprevious one. That's kind of the point.Um, but when you move all of thebranching into these inside here whereit jumps directly to the next place itneeds to go, what you get is a um morebranches to be predicted. And well, herethey're not even being predicted.They're just jumping directly, which isnice. Um, but even if they're runtime,you end up with more branches that canbe more likely to be predicted. So itreally helps the branch predictor uh touse this pattern. Uh and in fact when weswitch the tokenizer to this pattern andto take advantage of this new feature uhdoes anyone rememberuhwas it this one?Okay. Yeah. So this person updated thezig tokenizer to use labeled switch andthe they reported uh 13% speed up justby doing that switch. So that's prettyneat. Um, and what I really like aboutthis is that not only is it faster, butit's also nice. Like I actually thinkthat the source code reads better thisway than with a while loop. Cuz if youjust goes from here to the end of theloop, you kind of have to check twoplaces to know where it's going. Buteven if I'm in the middle of this bigstate machine and I see this, I knowexactly where this is going. I know it'sgoing to right here. I don't even haveto like double check the top of thewhile loop, for example. So, I I reallylike this u this syntax. I'm happy withthis.Nice.Uhnice.Okay. Well, let's move on to the nexttopic. So, that was uh labeled switch.Just a little highlight from the lastyear.Um okay. Yeah. Next, I'm going tohighlight some tool chain improvements.Um, these come from uh, Alex RonPeterson, our newest core team member,and he has improved our target support alot um, in more ways than what I'm aboutto show you. But what you might havenoticed, or maybe not if you're just tuntuning in out of curiosity, is that ourdownload page is quite a bit bigger.Uh it doesn't even fit on one screenanymore. So in addition to Windows x864,ARM 64 32-bit, all the Linux stuff wehaveum actually adding Long Arch and S390X.These are thanks to uh Alex RP as well.But not only that, he also went in andlearned how um uh how our gibby andmuscle lipsystrategies worked. He adapted them forum FreeBSD and NetBSD. And then look atthat. Now we even have all these. Andthese are all automated on the CI. Sonow every every dayishum if you're on any of these operatingsystems, you got to build a Zigg. Andthat's just going to you're going to beable just no uh no no no dependenciesother than lib C. So you can justdownload that, unzip it, and uh andyou're you're off to the races. Umand so we already have the ability tocross-co compile these things. So forexample, if I just did uh if I just runlike the standard library tests, I coulddo umFreeBSD for example.Uh but will yeah I think pretty surethis worked before. Umbut the thing that worksnowis we also provide headers.I guess I need lib C.Uh we also provide headers. So, okay.Well, I'll have to look into this. Thisseems like a recent regression of sorts.Um, so that means that I should be ableto demo I thinkuhI should be able to do our our C examplethen. Okay. So, that's just a standardhello world. And I can even do CC hello.So, this is if this is for native. Okay.obviously. But now we can do let's do aweird one. Uh power PCbig Indian power PC 64 freeBSD.How about that?And we even have undefined behaviorsanitizer. Amazing.Okay, so I'm hitting that same problem.We'll figure out what's going on there.Does anyone Does anyone know already? Ihaven't actually tried this before.I mean, we got builds. So,am I supposed to douhI don't know. Anyway, this is this isnot going to be a problem. I'm sure wecan get this fixed before the release.Um, so sorry for the bad demo, but yeah,shout out shout outs to um, AlexRP forall this uh, tool chain support. So,we're we're going to be looking at allthe targets kind of moving up the tierswith this next release. More support,more testing.Jacob is saying, I need LC for Zig CC.But what you might not know already,Jacob, is that that is the default withZigcc.That is fully redundant to pass in LCwith zigcc.I also tried it over here.Yeah, I don't know. I think it'sprobably just like a recent regressionof sorts, but yeah, we'll get thatfixed. No problem.Okay, soOh, that's what it was. Yeah, I knewthere was something I was forgetting.Okay, thanks Alex and thanks Matthew.Right, so uh yeah, he mentioned this tooand I just totally forgot. So part ofthe Zig Target triple is um operatingsystem versions and um so he made thedecision to support starting with 04starting with 14.0.Uh so there we go. That'll work now.Uh there was some reason that it wasgoing to be a bunch of trouble to targetum13. Anyway, um so there we go. And Ican't run this because this is a FreeBSDbinary. Um, let's see if file knowsabout it.Well, yeah, I also can't run it becauseit's Power PC.Okay, there you go. So, we just made auh Hello World for um 64-bit big IndianPower PC for FreeBSD 14, which is thenewest release.Uh, pretty cool. Pretty cool.Yeah. And uh and Alex did a great job umuh contributing to the um uh the libctool chain that we have for keeping thestuff up to date. He did a good jobkeeping all of our um like we have thesewiki pages for updating libc.Uh and so like here's what you have todo when gibb updates and like here'smuscle and then um now there's a sectionfor freebsd and now there's a sectionfor netbd. So, he's done a great job umdocumenting everything he's doing andmaking it a repeatable process for usall. Uh so, yeah, that's some reallygood work.Okay. Uh yeah, thanks for uh figuringthat out, Matthew. It's good.Okay, moving on.So, that was uh yeah, some tool chainupdates. Ah, yes. Okay,let's move on.Did he get a dedicated welcome blogpost? Yeah. Yeah, I did that for sure,didn't I?Don't tell me I forgot to do that.Wait, I thought I did that. Oh no.Okay, well that's on me.Why do I remember typing a welcome blogpost for him? Did I do it in the releasenotes? Maybe. I don't know. Did I do adraft and never publish it?Oh no. Okay, that's my that's myfeeling.Did I dream doing that?Okay.Well, let's move on for now.Okay. So, let's talk about file systemwatching.File system watching. Yes. Yes. Yes.Okay. How do I even want to startshowing this off?Well,I think I'll start by showingour workflow for building the compiler.Um, I'm on master branch right now. Uh,let'slet's undo these changes.Uh, yeah, we will. Don't worry, I won'tI won't forget about saying this.our workflow. Uh, sorry, let me back up.Right now, I have another branch thatI'm working on that has required a lotof changes. Uh, it's required workingthrough a lot of compile errors and um,let me show you what that workflow lookslikeuh, a little bit. So, there'sYeah. And if you if you haven't beenpaying attention to Zigg recently, thisis this is the part where you shouldlike put your uh I don't know, put yourcounter strike down and and payattention for a second.So, here we're going to build thecompiler. Uh I'm going to turn off somestuff I don't want. Uh I'm also going toturn offlike um building an executable. I justwant compile errors. And I'm going toask the build system to stay alive. Andnotice when any input files changeand re and rebuild. And I'm alsogoing to enable incremental compilation.AndI'm going to make compile errors printat the bottom for convenience.So this is going to build the compilerall of it from scratch. And it's doingthat right now.Um, nothing is cached other than likecompiler RT. So, it's it's rebuildinglike 100% of the compiler from scratch,15 seconds. And that was with our ownx86 back end that I was demoing earlier.So, that's uh about half a million linesof code done. Now,uh let me put this on the bottom for asecondand let's go start editing.I know I passed no Ben. I'm I'm onlylooking for compile errors right now.So, let's say I want to go in and I wantto actually delete the um I want todelete the uh breakpoint builtin. Ithink it's a bad built-in. I'm going todelete it actually. So, let's go. Let'sgo find that.Okay. Okay, I think I found this. So,I'm just going to delete this code here.Okay, I got some errors.Okay, let's let's keep that up there soI can see those. Well, that makes sense.I just deleted something, so I'm goingto get an error. Um, I better go intohere and delete that then.Uh,okay. That had to rebuild quite a bitactually.Let's keep going. Um, so now I want I'min this file.Okay, I got to delete this.Oh, okay. That one was pretty fast.Gota delete this.[Music]Do I delete what's going on here? Switchmust handle all possibilities. Okay, soI need to delete some break points.Okay, now you get the point I'm makinghere. I I am getting instant feedback onon all these changes that I'm making. Uhlike if I want to go in here165. So I'm going to handle this compileerror now. Save.Okay, that one took a little while.We're going to have to redo some uh x6back and stuff for some reason.Uh, let's see what else.Let's delete from here. That one wasinstant.Uh,print here.Delete from there. Instant.So, what you're seeing right now is I'llshow you my command again. Um you'reseeing a combination ofum turning off building a binary,having the build system watch forchanges automatically, incrementalcompilation, and just showing all thecompiler errors at the bottom. And whatI'm trying to show you is that you canget instant compile errors in yourworkflow uh by setting this up foryourself. Uh and that that is new and uhas in the last year.So,if you don't have this setup, uh Ihighly highly recommend the setupbecause you're going toumit's really going to unlock uh per likeyour own potential as a softwaredeveloper because when you get instantfeedback like this, you don't you losethe temptation to, you know, alt tabover to Firefox and like look at socialmedia or something. You know what Imean? Like you can stay focused a lotbetter.Yeah, worth noting ZLS can leverage thisfeature. So, you get squiggies, right?Is that is that how it does it? Um,yeah, this is in 014. Uh, and it's also,correct me if I'm wrong, Matthew, but Ithink it's improved since then. So, likebug fixes and enhancements coming out inthe next release.Uh but alsouh that's sorry that's the next topic.Okay, let me just see if there's anyquestions here. Uh this example is isgoofy. I'm not I'm not actuallyintending to do that. So you can justforget about that. That was just anexample. I'm just trying to show offthis combination of of stuff.Uh clearing the screen for printingerrors. That's probably a good idea. Ithink we have an issue open for this.Another idea would just be putting a ablank line. Well, yeah, we'll get there.We're working on that. That's the easystuff, you know? That's the stuff thatyou can That's like kind of the paint ontop that's easy to to to tweak.Umyeah, so if you don't have thisworkflow, uh I recommend upgrade, figureit out. Make sure you get this workflowbecause it's really really nice. Now, umyou might have noticedthatuh oh yeah, and Matthew just confirmedwhat I said. So, this is available in014, but um there's been enhancementssince then. So, um it be it's good toit'll be good to get the upgrade.I hope that you can map that in thequick fix list in Vim. I would lovethat. I I I don't know how to do thatright now. I don't I do my best not toedit Vim plugins.Okay. Yeah. Now, this is the topic I wasabout to get to. So, you may havenoticed that I disabled um outputting abinary. So, this is the equivalent ofpassing no emit bin to build.exe. Andobviously, that's not ideal. What wewant is we want to get instant rebuildsthat we can also test. Um, and that doeswork experimentally. So I canum actually let me just try this and I'mgoing to try this knowing that it mightit might fail. So just keep this inmind. Um but going back to this DAWprojectuh I think I need I need some likeVulcan stuff in my path. Uh I might notbe able to build this. It might have torequire updates. So bear with me here.Um but I will tryturning it on.And this is withumcreating an executable. So I I'll make achange and then seeuh I don't think I have wayenabled so I need X11.Oh, is this because I made that change?Oh yeah. Oops. Well, I updated theshader compiler, so I have to rebuildit. Let's just let that run for asecond. I think it should be fine. I gota pretty beefy setup over here. Um, butthe point that I'm getting atisuh the thing that we're working on nextis making this also work when you're uhoutputting an executable, not only whenyou turn that off. So, yeah, we'll getthere. As you can see, the front end isworking quite well. And um the thingthat's holding us back isumuh the linker. So, we need to make somelinker enhancements. And then we can umuh then you'll be able to do this whilegenerating a binary and testing it andgetting instant rebuilds.Uhas for this question, I think I merged afix to that last week. So if you haven'tchecked in a week, uh try now. Um but soI've I've done watch on this. Now thisgenerated aum so let's just do a new windowactually.Okay. So I can run uh I can run thethe program. It's still watching it. Solet's go ahead and make an edit. Um Idon't know what kind of I haven'ttouched this project in a while, butlet's justuh let's let's Let's make it read thewrong font name and crash.Okay, so I actually hit save on that.And now it should crash when I try torun it because it can't find the font.Okay, now see this this said success,but it generated a a not viable binary.The linker did a miso compilation there.So that's a problem. And if I go back,it's still Yeah, it's not it's not good.So as you can see uh this feature is notquite ready for prime time when it comesto generating executables. Um but itwill be after we make some uh linkerenhancements. Uh in particular that onewas for the elf linker and um earlier wenoted that we needed cough linkerenhancements to make x86 back endenabled by default for Windows. So yeah,we'll need to make some nice linkerenhancements um to unlock some of thenext things coming up for us.Um, was that all I was trying to sayabout watching an incremental? Let'stalk about bugs.Um,yeah. So, we recently until we untilrecently we had a bug that caused notsame file system error on Linux. Ibelieve that has been fully fixedas of last week. Um, however, on Mac OS,uh, there's stilla problem with the watch system.Unfortunately,uh, Mac OS doesn't give you very goodwatching primitives. Linux actuallygives you pretty good watchingprimitives with the FA, what is it? FAnotify.This API is pretty nice, actually, uh,especially after like 5.1.Um,but Mac OS unfortunately is not good.So, we did the best we could with onlyusing like Mac OS SIS calls. Problem isthat it only detects um like editorsthat atomically update the files. Ifthey actually just make writes, then itdoesn't detect updates, which is aproblem. Um, so our plan is to switch tousing whatever that stupid foundationis. I forget what it's called. Umthere's some like framework you have tolink for watching like file systemupdates andit umI don't know I think it just watches thewhole file system or something in userspace and then you basically arequerying that database but I guess yeahfs event stream. So I think we justbasically got to dl open this thing inthe build system and then that'll fixthe problem but uh that's not done yet.So file watching on Mac OS is uh it'sgot a big asterisk next to it.Um what else?I think there was one more thing Iwanted to mention here.UhI'm sure I'll remember it in a moment.Okay, I thinkthat is my segue.Okay, let me briefly speak aboutYeah, we'll get we'll get there. Uh, onemore thing before I segue into that.Uh, okay. Translate C. Sofor a while uh just kind of quietly inthe background um Vea has been workingon a translate C package for Zeg whichis based on his uh C compiler which iscalled arrow or ARO I don't knowuh and it's done. So this packageactually is fully compatible with ourexisting translate C test suite. Uh it'sready to roll.Um, so right now when you useuh let me just go into Oops.Let me just go into a directory here.So here was our example from earlier.Okay, if I do zig translate c,it's going to spit out some text. Iguess I have to link lib. It's going tospit out some text. And uh there's abunch of crap that C defines, but we'realso going to get our main. And hey,there it is. So this is um this is ourcode translated into Zigg.Anduh it actually works. So if we like forexampleumdo this and then we dowe do build actually I can just do runthere you go uh so this totally worksthis is based on clang so we are usingum we're using clangauh to to iterate over it and then umtranslate that into zig. What um betahas done isumcompletely bypass clang. So this thispackage works on on his um C compilerwhich is written in zig pure ziguh and it's it's up to par. So forexampleumwait I don't actually have this packageintegrated yet. So, I would have tospend a few minutes setting up anexample. Um, butthe next step here would be changing itso that when we run thiscommand line, uh, it just doesn't evenuse clang at all. It just uses ro libc.What's interesting about this is that,uh, we actually could hook this upto the back end. So, for example, wecould implement like zigcc that doesn'tlink clang at all and it would just doRO translation and then run that throughZG and then we get something out theother side which um could be a funstream. Maybe a follow-up stream orsomething if we if we have a whole bunchof time remaining.Uh but we're not going to do that rightnow. Um, suffice to say,we're well underway for eliminating ourclang dependency. We're well underwayfor eliminating our LLD dependency, andwe're well under the way for eliminatingour LLVM dependency. And with that, Ithink that might be ouruh segue into revealing the secret.Okay.So, uh, for people who haven't beenfollowing along too much, don't worryabout it. For people who have, uh, youmight be maddened by the fact that, uh,Jacob Lee has been teasing us all withhis secret project, and he's not tellingus what it is. Well, he told me finallyso that I could demo it for you onstream.So, I know the secret. And the secret isit is a ARM 64 back end.Tada. Oh, wait. I'm not in the rightdirectory.Tada.Okay. Uh, let's play with it. Let's seewhat it can do.So, I'm going to build it from source.Okay. So I'm running build the compiler.Okay, it's built.And so now we have a stage 4thatcan do ARM stuff. So what should we do?Uh let's try running the behavior tests.Now I am going to have to add some flagshere since it's a work in progress backend.Um, so here we're saying target ARM 64Linux. We're saying don't use the LLVMback end. Obviously,uh, Zig's debug mode is actually prettysophisticated. Zigg's debug mode has allsorts of safety checks and all thesefancy stuff. Uh, so by passing reallysmall, we actually make the task thatthe um, backend has to do smaller.Um, we also don't support compiler RTyet. that requires a bunch of AI stuffthat's not done yet. And finally, I'mgoing to run the tests in Kimu so thatwe can actually run the behavior tests.Okay, that was fast.Uh, and there you go. So, we're passingum,154 tests and skipping, 129. So, alittle over half are of the behaviortests are passing.Now, uh, don't get too excited because,um,a lot of these are testing the frontend. So, kind of like once you pass thefirst test, you pass a bunch of them.Um,but, uh, it's good progress. And now,the other thing that's interesting aboutthis is that, uh, Jacobly has shared,well, we you can also just look at thecode. It's public. Um,oh, M. Matthew wants to see the uncashedbuild. All right. All right. All right.Here's your uncash build.Okay. Yeah, that was definitely cached.Okay. It's still fast.Is this still uncashed?Well, this is a debug build of thecompiler. So, we're actually kind ofmeasuring the machine code quality ofthe x86 backend. Uh, so that's that'swhat that's doing. We're we're measuringthe machine code quality of debug modex86 back end. Okay. Anyway, uh what wasI saying? Right. Okay. So, um Jacob hasshared uh some of the cool things aboutthis back end and it is a it's kind of afresh take on on on the back end. Umit's got some unique ideas in it. He'splaying with different data structures.He's already done a couple rewrites totry different things. Um so he he gaveme this little demo to show. So here wehave uh a filejust to show a couple different kinds ofcodegen. Um so the idea here is thathere we're getting four arguments butwe're kind of umpassing the arguments shifted one to theleft. Here we're getting four argumentsbut we're kind of passing the argumentsshifted one to the right. And this iskind of an a neat little optimizationdemo available here. So if I run uhif I run the back end,I can compile an object file. Uh I cando an object dump on that.Andlet's take a look. So let me actuallytry to separate these.Okay,so what's interesting about this isbuild select. Okay, notice here thatwe've moved um these registers in order0 1 2 3 in order to call the nextfunction right here. But in this oneum we it does it backwards. See this 3 21 zero. So this allows it to use exactlyonly four registers to make this call.Exactly only four registers to make thiscall. However, for these it's actually arotation. And so um there it's likemathematically necessary to introduce atemporary. So then we have a temporaryand then four registers which makessense. Um but it's just kind of neatthat already it's a debug backend andit's doing little little things likethis that are nice.Um, and so yeah, it's still it's stilltoo early to make, you know, concreteclaims. Um, but I will say that ourgoal, and and Jacob can get after me ifI shouldn't say this, but our goal is tonot only beat LVMat um compilation speed, but also beatLVM at uh machine code quality for debugmodeuh at the same time.And I it's it's it's looking possible tome based on uh Jacob Le's work.I'll I'll give him a minute to object.All right, let me look through some ofthese questions.Uh what's up with this Kimu thing? I'llanswer this question. Um, so part of theZigg build system,well, let me let me back up. Uh, nottalking about the build system yet. Partof Zigg's unit testing system,uh, is,uh, let me go to just like a fresha fresh example.Okay. Okay. So, if we just make a unittest,um it's just going to be empty. Okay.Just an empty unit test. So, if I do zigtest example.zig,uh it's going to run that test. And thedefault thing it's going to do is justrun it natively. Um but, um you can justtell it um to run something with adifferent command. So, if I just saylike echo, for example,that's just going to run echo, nothingelse. If I dothis, it's just going to print the nameof the test. So, what another thing youcan do then is just give it a differentcommand like chemo uh arch 64.And now it's going to just run it'sgoing to do run this in ARM 64. Butobviously that's not right. So then Iwould also need to uh do this and thenthere you go. You can now run unit testsfor a foreign architecture.Um, this is also hooked up into thebuild system. So, for example, if I doum build, I just get the help menu here.Um,uh, right. So, this option is alwaysavailable in ZigG build. um you can justenablethis flag and if you do that then whenyou try to run tests with the buildsystem uh the build system will detectwhen uh it might need to use Kimu to runyour binaries and it will just do that.Um or you can just not set that and notworry about it but it can be uh can behandy. Generally the rule of thumb thatwe have here is that we'll addintegrations for popular projects likethis but they'll never be enabled bydefault.Um, okay. So, let's see what else isgoing on.Uh, what about release mode? Yeah, theplan right now um for for theforeseeable future is the default forrelease mode will still be LLVM. Um,however, in a long-term future, I I canenvision a world in which we haveoptimizations and uh just completelypart ways with the LVM project. But thatis probably a post 1.0 um idea. I don'tthink I'll try to do that before 1.0.That's not a question for me, is it?Okay. Um,so I think maybe we can move on fromthat topic and feel free to uh ask me aquestion later in in the official Q&Asection and we we can revisit the topic.Uh, but for now I'm going to move on.Uh,okay. Yeah. So, next I think I'll showyou a little bit about what I've beenworking on.Yeah, I'm I'm fine with it. you can dothat. Okay. So, what I've been workingon isresurrection of async awaits. However,it's so much more than just that. Um,I actually gave a talk on a lot of thesetopics a couple weeks ago in Amsterdamand I will post the talk here when it'savailable. It's not available yet. I putall my talks on my website in order. Um,but I can also just go over some of thebasics again. So, here's a branch.Um, I'll preface by saying I feel likeI feel like it's solved in theory. Uh,I like the the stuff that I did withasync weight before it never feltfinished. It never felt like it was goodenough. Um, I feel like there is a pathtowards realizing my vision with thisnew thing. So, I'll preface it by sayingthat. And the idea iskind of simple actually. Uh, it's justfor some reason some of the simpleideas, they're just hard to think of.Wait, this is not what I wanted.Okay, so you know how in Zigg programsyou always have to pass an allocatoreverywhere? Okay. Well, now you're gonnahave to also do that with IO.IO. What is IO? IO is everything prettymuch. So, like async is part of IO. Um,await is IO. This is a little homage tothe Go programming language. It'sbasically um async uh without an await.It's just like crippled async8.Um, we also have cancellation. I'll getinto that in a minute. But then thingslike opening files, uh doing networking,mutexes, conditions, uh timing,and there's going to be like much muchmore.Um it's all related. Anything that canblock the current thread of execution,including like large CPU tasks, uh theybelong here. And so what this means isthat in in Zigg projects kind of one ofthe first things that you'll do,you know, in like your mainis you'll either well you'll yeah you'llyou'll either choose or you'll implementa um IO implementation.And I have an example of this.UhI think I'll just find it on my G.Oh, here it is.Okay. Okay, so I put this togetheralready. Um, so kind of in Maine, one ofthe first things you'll do, you pickyour allocator. This is a familiarpattern, right? Okay, you're also goingto have to pick your IO implementation.So maybe you pick an implementationthat's based on a thread pool, okay, andthen you grab your IO from there. Ormaybe you pick your implementation fromuh a like green threads event loop andthen you get your IO from there. Doesn'tmatter. In this example, I can uncommentthis one and comment this one and theprogram will have the same um output.Not the same behavior, but the sameoutput. And then you're going to getbasically async. And keep in mind thatum once the keyword is dropped, thesecan go to being a regular function name.So they won't have this weird syntax.It's just a function call. Okay.Uh now the point of this, and this iskind of like a lot of demos all squishedtogether into one. Um but the point ofthis is that you can encode into yourlogic doing stuff in parallel. So here Iencode the idea that I can calculate thefirst half and the second half and thenonly lateronly later do I need the results. So Istart this stuff I do a bunch of othercrap while I'm waiting and then now Ineed the results. This allows you toencode that logic and then um the userof this code which could be a differentperson gets to decide how to executeyour logic based on which IOimplementation they pick.Exactly like how you take an allocatoras a functionand the caller gets to decide how youallocate your memory. There's a ton ofbenefits for this. Um, just off the topof my head,uh, resource leak checking, um,uh, testing, better testing, um, nothave to write your code twice dependingon whether someone wants to use it inevent event loop or not. That's the bigone. Um, there's a bunch more. What am Iforgetting?Uh it's just so nice andalso by doing this in um yeah bring yourown operating system. That's a goodpoint. So you can take a package thatnow that used to have a dependency onthe operating system and now it only hasa dependency on the IO interface. So ifyou make your own operating system, allyou have to do is implement thisinterface and now you can use all thisZig code that's now works on your hobbyoperating system. No one even had tocare about it. They just had to use theinterface.Uhyeah, and then because it's in userlandand it's not like keywords of thelanguage, it actually becomes a loteasier to implement some of these likeuh nicities like cancellation andselect. So for example, I implementedthis Q. This is the equivalent of a gochannel.Um I also was able to implement selectin um in userland in the interface. Sofor example, and this works by the way,this is a working example using thebranch I just checked out. Uhsoselect is a feature where you give itmultiple uh asyncs and then like thefirst one to finish you get it gets run.Um, now what's interesting about thisone is that it's also combined withcancellation. So you can see here westart these three things and then wedefer a canceldefer cancel defer cancel. So umwhenever we return from this function uhall these resources are cleaned up andeverything. So it's what what I think isinteresting about this is that zig isnot a garbage collected language.However,there is pretty minimal boilerplate herecompared to like what this would looklike in Go, for example. Um,I mean, arguably it might even be longerin Go because of the lack of try.Uhso to me this is the dream because now Ican encodeuh I can make like a reusable packagethat doesn'tdecide which operating system it has torun on and it doesn't decide what orderthings have to be run in. Like if I cando two things at once, I can encode thefact that I'm doing two things at once.And if my user just wants to like use myZigg library inong along with some likebasic C code, they can do that. All theyhave to do is choose the the IOimplementation that's the dead simpleone that just does things like rightlike um it does things eagerly at theasync and then await becomes a a noopand then it all works.Um, so this this is the future of uh ofasync8 and we're headed this way and umother programming languages can't dothis because they don't have Zigg's umsingle compilation unit strategy. So allthat work we put into incrementalcompilation, all that work we put intomaking our single compilation unitstrategy work is what's enabling us tomove forward in this way. And it's alsogoing to depend on uh restrictedfunction pointer types which is quite aninteresting proposal. Um which longstory short just makes this code be uhnot have some downsides that it wouldotherwise have.Um where am I going with async away?What am I missing? Matthew, are youpaying attention? I think I think I hitall the points here.Uh right. So then the only questionthere is what about um co- routines andthat just becomes a question of uh is itpossible toumthat just becomes a question of is itpossible to make an IO implementationuh with uh stackless co- routines andthat's at this point it's a separatefollow-up question. Um, so that's umI'm thinking likely yes because we'llneed to be able to do that for certaintargets like if the target doesn't havethe ability to implement yield in userspace then we need the ability to do itwith stackless coins. um butthey will become a much lower levelprimitive that users usually won't touchlike they will become umuh they'll become an implementationdetail of an IO implementation and notsomething that users need to care aboutat all who are writing even who arewriting package reusable packages. Soonly like standard library authors orlike people who are creating likealternate IO implementations or otheradvanced stuff will care about these umstackless corine primitives. Uh let metry and click this link.Oh yeah yeah yeah. Okay.Why does single compilation unit enablethis type of async? um particularlybecauseuh what we need it it all has to do withstack usage. So the problem is that umwhenever you do two things in parallel,you are now heap allocating the stack ofthe other thing that you're doing inparallel.Andwhen you have a v table, in other words,when you have a reusable interface suchas allocator or um or IO,you're going to have a function whosevalue is known at runtime. The problemis we need to know upperbound stackusage of that function. But if you onlyknow which function is being called atruntime, then you're going to haveyou're not going to know the upper boundstack usage. There's also a problem withrecursion, which we can get to in aminute.What this umwhat this proposal accomplishes isit means that you'll be able to markfunctions as being uh it means that thecompiler will be able to automaticallydetermine that a given function pointercan only be one of a limited set ofthings. And because of that uh it cansay that the stack upperbound usage isthe maximum of them. and and that allowsum that allows you to pre-allocate allthe possible function call stack thatyou need in order to do something inparallel.Um and if we didn't have everything inone compilation unit, then we wouldn'tknowuh we wouldn't be able to do thisproposal because you wouldn't youwouldn't be able to know what um youwouldn't have a closed set of possiblefunctions that a function pointer couldpoint to.Is this something I should click? Oh,yeah. This is the say I I know like aset of zig issues with just by number. Ithink this one's called like saferecursion.Yeah, I got it.Yeah, that's related for sure.Uh yeah, so that's where we're headed.And in the meantime, the reason that I'it's been taking a while uh for thisbranch to make progress and get mergedis because um I'muh I'm also right uh I'm changingstandard io reader andstandard.io.riter.Um I'm preparing them to be assimilatedinto this pattern and into the asyncatepattern. Um and that's unfortunatelyquite an involved change. Um, but I'veuh I've switched tactics recently to tryand do this more peace meal. So, I'mexpecting to make progress on that soon.Um, but I have to say uh you I'm sorry,but you have to prepare for some majorbreakage becauseum changing standard io reader andwriter it reallyuh it basically just makes you likefully rewrite any code that touches itand it's a huge pain. So, uh, I'm sorry,but I I'm strongly convicted that thisis the future. It's going to be great.I'm sorry that I didn't get it firsttry. I think this is my like fourthiteration on Async8. I I really tried alot of other things first. Um, yeah. Idon't know. I'm not I'm not smart. Ijust try a lot and and never like settlefor something that's not perfect. That'sthe only like thing I bring to thetable. So I that's the the downside is alot of breakage. So I am truly sorry forthat. Uh but I really believe in how inthis being like a good strategy for thefuture and I'm really excited about it.Umyeah. All right. Let's see if there'sany questions here.Does this mean that async8 won't workacross dynamically linked boundaries?Kind of. Um, so you can annotate uhextern functions and then you'll be ableto have them called. Um butuh it's kind of the same problem that umlike out outside of uh like if you haveif you have an event loop umyou really don't want some third partycode to then do a bunch of like filesystem reads and writes uh outside yourevent loop. Kind of defeats the purpose,right? You need it to participate in thesystem. Uh so it kind of creates thatproblem. However,because we have IO as an interface, umone thing we we can do is we canimplementum well and on uhand for some targets we actually controlthe lib C code too. we actually canprovide libc functions that thenactually just uh call into the IOinterface. And so in some cases weactually would be able to make thissituation work optimally because uh aslong as we we can calculate upper boundson the stack of the functions that arebeing called um and as long as we cancontrol like uh the IO then we cantotally make it integrated. But there isalso still the possibility that like youcan just write some code that does thewrong thing, right? You could literallyjust write a function that says likecrash the program and put that in adynamically linked library and then likeyeah if you call that you're going tocrash the program or if you just put abunch of if you just put like sleep 100you're going to mess up the event loopyou know in in that code. So in otherwords um there's definitely a potentialfor code on the other side of adynamically linked library boundary tonot work. However, there also will be alot of tools to make it work if you try.Uh, I hope that answers the question.Will there be sync and async reader andwriter? Uh, so yeah, the way Yeah, Ididn't explain this very well. Uh, sothe waythe way that this is going to work thatI the way that I tried to make this workin the past was by like makingeverything generic. So you'd have you'dhave the same code but then it would getinstantiated in a sync way or it wouldget instantiated in an async way. Uhwhat I've what I've moved towardsinstead is auma non-generic approach. So the new thenew writer and reader uminterfaces for example. Let me let mebefore I switch uh let's look at thecurrent one.So let's look at writer for example.Uhhow does this how does this work?Okay, this is kind of like the writer. Iwrapped it around this anything but it'sreally not a good idea. So forget aboutthat for a second. This is basicallywhat everyone uses generic writer andit's relying on generics obviously.Okay, now let me switch branches. I'llshow you briefly what I'm working on.Okay, so the new writer is not generic.So this is just a file. This is a strct.It's got some fields and when you wantto satisfy this interface, you have toprovideuh some you have to provide thisfunction and optionally these functionswhich have defaults. And if you do that,then you get all these methods for free.Um, and what's nice about that is thatall the code in this file is notgeneric, which means that the samemachine code, you'll notice a lot of itis formatting code, the same machinecode will uh be used in all of thewriters uh in all of the streams.Uhso there's no opportunity here for thisto be generic or in other wordsinstantiated in an async manner orinstantiated in um in in a in a syncmanner.Umso where was I going with this? So mypoint is thatit all depends on how you implement theIO interface. So if you implement the IOinterface for example um in a singlethreaded blocking manner then you'regoing to get singlethreaded blockingcode here like you're going to implementdrainand well in many cases you actually justchain these things together right solike for example if you have a uhcompression stream then you you providea writer that you can write bytes intothe compression stream like like um uhgzip for exampleyou provide a writer so that you canpush bytes into it and then you alsouh are given a writer that you pushbytes out to. So it just kind of livesin this this kind of chain. It actuallyhas no actually doesn't need to knowabout IO at all. Uh you can just make ita almost like a pure function if in asense right it just takes in the bytesit does something and it pushes out thebytes. It doesn't even know about theoperating system doesn't know about IOblah blah blah blah blah.Umin some cases though you're kind of atthe end of the chain. So for example umthe implementation that is in file. Sothis is the writer that provides thewriter interface but at the end of theday it has to write to um an actualfile. It has to actually do like youknow pix.rightv for example.Uh what's my point?My point is that this uh interfa thisthis implementation of writer will needan IO interface. You'll have to it'llhave to be given one and then it willdecide it it will be calling io. write Vor whatever. Andthat call will determineum whether or not the drain function isasync or sync. And thenuh the restricted function pointer typeswill be able to do just like it takesthe upper bound of the stack. um it willtake the like if they're all sync thenit makes them all sync but if any of thefunctions are async then it makes thefunction pointer um async and because itknows that they can um anyway point isit has enough information to make it allwork um and we don't have to implementstackless co- routines for this toalready be useful because we can evenjust provide a thread poolimplementation we can provide a singlethreaded blocking implementation we canprovide a green threads implementationAnd those are already like extremelyuseful. And then we can additionallyprovide a fourth implementation based onstackless coins later enabling more usecases that weren't possible before. Butit's already uh enough. It's like it'salready the concept is proven like weknow it can work. There's not a dangerof that not working.So it all depends on the IOimplementation what you do basically.And the point is uh the point isreusable code like you can see it righton the homepage right like what's thepoint of Zigg it's a general purposeprogramming language for maintainingrobust optimal and reusable reusable issuper important all three at the sametime the point is you should be able tomake a package that is not only robustand optimal but at the same time is alsoreusable for everyone else even ifthey're on the hobby operating systemthat they just wrote yesterday theyshould be able to use your I don't knowlike JPEG package that you made twoyears ago. They shouldn't have to addlike special support. It should bereusable code. Not only reusable from umsource code perspective, but also inthis case literally reusable machinecode like the same, you know, ARM 64machine code that this generates will beused in uh in the binary under likemultiple conditions. So there's kind oflike two reusable code angles to that.All right, I hope that made sense andit's a little bit rambly.Okay, let's move on. I know peopleprobably have questions. Keep thequestions and we'll do actual Q&Asession momentarily.Um, yeah, actually I only have one moretopic to get through and then we'll doQ&A and then we're I think I have onemore announcement and then we're done.Okay. So,nextask me this later. I will I can go overthis. That's a good topic. But before wedo that, let's move on.So, let's go back to master branch.Uh let's talk about fuzzing. Now,unfortunately, I haven't had a lot oftime to work onfuzzing. Okay, good. Keep those in mind.We'll get we'll get there momentarily.Uh, now I haven't touched this in awhile, but it is definitely mostcertainlypart of the road map. Uh, because Idipped my toes into fuzzing a littlebit. Um, thanks to uh Loris for gettingme kind of like showing me the ropeswith AFL. And I read I read the AFLsource code, which is pretty neat. And Istarted working on an in-house uhfuzzing tool chain. And I'm now beforeanyone says not invented here syndrome,like sure we're definitely guilty ofthat. U proudly guilty of that, youmight say. But man, having an in-housefuzzing tool chain is going to be agamecher. Like there is so much you cando with in-house fuzzing. You could likethe worst thing about fuzzing is howannoying it is to set up all theinfrastructure around it and like it's atotal pain in the ass, but people stilldo it because how much value itprovides. Um, so if we can haveintegrated fuzzing with with Zigg, it'sgoing to be crazy. Like it's soconvenient. like people will uh itactually saves you time because you canwrite a 100 unit tests and spend likeweeks on that or you can just write onefuzz test and then delete 99 unit tests.It's so good.Um but in case you didn't see what isdone and what is available, I think Ithink we have something in the likehello or the init template.Uh, let'slet's go in here. So, I don't know,maybe I broke this because I haven'ttouched it in a while, but let's take alook. So, this is our init project.Uh, let's doit. Build.What are we doing here?Okay. Oh, big help. That's what we'resupposed to do. So, this project offersus run and test. Let's do test. This isour init project. I think Loris workedon this recently. Okay, that seemed towork. I don't see the text uh one fuzztests found though.I wonder why. I was expecting to seethat.But anyway, if I look at the sourcecode, I see try passing fuzz to ziggtest and see if it manages to fail thistest case. Um let's indeed let's trythat.So when you do fuzz mode, it actuallyruns unit tests once, finds out whichones are fuzzing test cases, and thenrebuilds your unit tests in fuzz mode,which instruments the binary and alsodoes things to help fuzzing work better.Um,andthis isa regression in the build system. So, II think I probably broke this,but you can kind of get a little senseof uh what's going on here. Um, itactually creates a web interface thatdisplays your source code using the samelogic, the same like web assembly binaryas the Autodocs, and it shows theselittle like traffic lights, you know,red uh red or green depending on uhwhether the fuzzer found that line ofcode or not. UmI think let me tryjust one thing really quick.Seems to be like a debug info issue. SoI was just going to try a differentrelease mode.You generally want to run your Oh, therewe go. You definely want to run yourfuzz tests in um release mode becauseyou want more iterations.Uh I haven't played with this in awhile. I imagine it might be broken.Okay, there does seem to be a problemthere. Okay, well you can kind of getthe idea. So it puts these little littlelights on like areas of interest and ifit got run it turns green.So I think something regressed becauseuh at one point in time it wouldbasically just find this passwordinstantly. Um but yeah, like I said,unfortunately I've been a bitdistracted. Uh so it's just all veryexperimental. Um but it is relevant forthe road map because it is somethingthat I fully intend to get back to. Ummy plan is to make uh Oh, Casey Banneralready knows the issue. Okay, let'stake a look.Okay. Well, we can look at this later.Um,what was I saying? Yeah. So, it'sextremely experimental. It's just justdipping my toes into this thing. But umman, when we when we have this thinglike full like when we're ready to saythat this is like ready to go and it'suh ready for prime time, this is goingto be gamechanging becauseif you've never played with fuzzing, youshould try it because it's incredible.Like the genetic algorithm just figuresout how to explore your code. It figuresout which inputs are good and it justit's it's like find your bugs beforeyour users do. It's like you don't whydo you you don't need a bug tracker.Just find all your bugs. It's so good.So that's that's where we're going togo. Um yeah, so unfortunately, you know,small team can only do one thing at atime. Lots of uh lots of big things todo, but um it's coming for sure. It'scoming for sure. That's the point.Okay.Okay. Well, I think I think that waspretty much everything I wanted to goover as far as demos and road maps go.So, I think we're ready for doingcommunity announcements.Uh,now I think I know one of them, Loris,but is there anotherset of community announcements? CDMs.Okay. Yeah, figured.Okay.Why is myOh, there we go.Okay. I got I got the list, right?Okay. Three announcements. Number one,uh, if you are, you might notice thisnew little thing here, setting upautomation.If you are setting up your CI and youwant Zigg on there, um, have a lookbecause you canuh, well, you probably don't want anydowntime on your CI, right? So, youmight want to have a look at communitymirrors. Um, this is a way for uh if youwant to volunteer and run a communitymirror, you can help uh you can help ZSFby just mirroring the tarballs.Anduh if you are a user of of Zigg and youjust want the tarballs um you can getfaster downloads and avoid downtime byintegrating with community mirrorsbecause uh we do not guarantee an uplineuh sorry we don't we do not guarantee auptime on ziggling.org. We do our bestbut we optimize for cheap running on acheap computer and not worrying about ittoo much. We don't we don't no one's oncall. We don't wake up in the middle ofthe night if it goes down. So, uh, souse mirrors if you want your CI to stayonline.Um, and if you, some people are alreadyrunning mirrors. Uh, thank you for that.Let me just take a look. So, yeah, thankyou to um, Emmy, thank you to Stevie,thank you to Linus Grow, and thank youto Silver Squirrel.Uh yeah, more details on that page.Okay, next we haveuh Okay, I already made thisannouncement at the beginning, but let'smake it again at the end.Oh, also thank you to Frank once we fixour own TLS implementation. Yeah.Uh okay. Uh, in case you missed it atthe beginning of the show, um, softwareyou can love Vancouver 2026 has beenannounced. So, I think theThere it is. The only website I visit.Uh, okay. So, the website's not up yet.This is 2023. Um, but it has it is it'sofficial. Uh, Matt and I is planning asoftware you can love 2026 Vancouver.So, uh, just get ready.I don't think there's any call to actionitems beyond heads up. Yeah.Uh, you know, funny story, uh, soapboxrager, because, uh, we actually have a,um,here, let me show you.We actually have a Vancouver north ofPortland, but you have to keep goingto Seattle and then keep going to get tothe real Vancouver. But when you drivehome from software you can love, youleave Vancouver and then it says andthen there's a sign that says likewelcome to Vancouver. It's reallytrippy.Okay.Anyway, uh if you come to that 2026should be fun. Um we had a good timelast time and I think I think MattKnight has some nice ideas for uh how totake it to the next level this time. Andalso, if I understand correctly, Lorisis also helping organize it.So, should be nice.And finally, uh we have Zigg Days. So,Zigg.day, that's a new website. Um, oh,you know what? Shout outs to my wife formaking her first ever poll request ever,uh, which turned these little pins intothese little zero heads.Um, okay. So, this is a new thing thatwe're doing. Uh,there's a format for meetups that Lorisand I are a big fan of. And the formatis instead of sitting around andlistening to people talk all day, whatyou do is you meet up early, like 9:00a.m. and you you do a little icebreaker.You talk, you know, 30 minutes, you getto meet people a little bit, talk aboutwhat you're interested in. You go aroundthe circle and everyone talks aboutthings that they tentatively plan towork on that day. Everyone brings theirlaptops.Um, next you you sit around a bunch oftables and well people form groups. Soif you want to uh go join someone else'sproject, you can just do that. So thenpeople form groups and then for one dayyou uh just hang out with each other andhack on stuff and then at the end of theday you again before you like at 5:00p.m. or something uh before you disperseyou get together again go around theroom again and everyone just talks aboutwhat they learned that day or what theydid or just take takeaways from theirlittle hack session. Um, I personallythink this is a really fun format for ameetup and so, um, I'm looking forwardto hosting one in my hometown, or not myhometown, but my current town that Ilive in of Portland, Oregon.So, we didn't schedule an event yet, butmy uh my friend Mason is going to helpme organize, and we're thinking soon,like within a couple months.Uh I believe Milano just had onerecently. Yeah, May 17th. Nice.Uh I guess this shouldn't say upcominganymore, huh?Um, and I don't think San Francisco isready to go yet, but what aboutVancouver?No events planned yet. So, this is kindof like an upand cominging um up andcominging thing that we're starting todo. We're hoping to have our firstPortland one. Uh, yeah, within the nextcouple months. Andthere's one more point I wanted to make.I don't know. I forgot. Sorry.Right. Uh the point I wanted to make isum this website is also a call to um toyou if you want a Zigg day in your townwhere you live in. Um, you can be anevent organizer and Loris will give youuh kind of like code owners of a c of alike the subdirectory of of your cityand then you can kind of just run theevent and you can edit this website withautomated pull requests. I believethat's how it works. Uh, and then peoplewho want to come to your event forexample, they can uh they can getnotified and subscribe. Um so you cantake advantage of this platform to helpuh get your um meeting your meetup uhbootstrapped. So point of thisannouncement is to entice people whowant to organize an event to do so.Let's get some more Zigg Days going.Yeah.And of course you can um you can putyour own flavor on it. You don't have todo exactly the thing as I as I explainedit.Um, each event has email updates, RSS,and also an IAL.Uh, the link down here tells you how tobecome a Zigg Day organizer.Yeah. All right. So, that's Zigg Day.And with that, I think we are ready togo into Q&A.So, go ahead, hit me with them.This is where previously uh Loris wasgoing to do the umuh what's it called? Ch ch ch ch ch chch ch ch ch ch ch ch ch ch ch ch ch chch ch ch ch ch ch ch ch ch ch ch ch chch ch ch ch ch ch ch ch choosing ofquestions to ask me, but I think I guessI'm the I'm the one in charge. No.Oh, we forgot about Zigtoberfest. Okay,sorry. One more. One more qu beforequestions.Okay, Zigtoberfest. Yes. Oh, look, anup-to-date website. That's nice. Uh,right. Oh, cool logo, too.So, this is a event. Uh I I believe it'sa one-day conference and this is in uhwas it in Munich or Berlin? Uh Munich.Uhthe people who went last time, they saidthey had a good time. Seemed pretty fun.And uh I think it's mostly talks uh inthe beginning of the day and then maybeyou you uh go get some dinner after orsomething like this. Is there anythingWhat is there to say aboutZiggtoberfest?Oh, there's recordings from the previousones. I don't know. It could be a niceuh a nice event to go to if you're inthe area.Oh, and it's at University of AppliedSciences.Specy and pretzels. Oh man, that'smaking me not want to go to be honest.Okay, well there you go. It was nicelast year despite the spzy.Okay.Uh let's move on to Q&A.Solet's see here.Here's a question. Is stage two compilerthe same as stage three for x264 Linuxdebug builds?Uh if you're talking about literallythis binaryuhthis onethis binary is created by compiling thisfile. So if you want to know more aboutthisuh I suggest to readI suggest to read this blog post.Um, this explains how wehow we bootstrap. Um,this this explains how we build fromsourceafter we got rid of our C++ code.[Laughter]And so yeah, basically this file iscreated from web assembly and then wecreate this and then this creates thefinal one and then from then on itdoesn't matter like if you do a fourthone you get the same results out again.Umare timeouts in async code going to behandled through user providedcancellation logic? Oh yeah that's agood question. So basically everyfunction that does IO gets an additionalerror in the error set called cancelled.So pretty much every so so your functionis going to have to take uh you know dothing you're going to have to take an IOparameterI don't know like read file orsomething.So you're going to get this error setrightand there's a bunch of different waysthat reading a file can go wrong. Now,there's going to be an additional waythat file that that can go wrong andit's canceled. So, you're just gonnahave to handle that or usually justdon't handle it, right? You're going tojust do it'll just be part of your like,you know, elsereturn. So, now you're going to alsohave, you know, cancelled in your errorset or it can obviously just beinferred. And so, that'll just bubble upcorrectly. And because it's an error, ifyou have any like air defer blah blahblah, this is going to run in case yourIO thing gets cancelled. It's kind ofbeautiful, isn't it? Actually works likeextremely well.Uh, in our proof of concept, by the way,we have a proof of concept with IO ring.uh and can and cancelling stuff likereally cancels stuff like it it sendsthe the SIS call to the colonel um tocancel like an inflight cued operationum in the in the E-ring.Uh can you Okay, so I want to just keepthe chat alive by not scrolling up. Soif I didn't answer your question, canyou please just repeat it? Uh and thenI'm just going to like miss stuff, youknow, just repeat it like every fiveminutes or something. Does that soundgood?Right. So there's a question aboutfunction coloring. I want to addressthat. Uh soyou canthink of taking a um allocator as afunction coloring thing.Uh because let's say that you want tocall fu. Yeah. From do thing. Well, Iactually can't call it cuz I don't havean allocator.So, I kind of got to have one.And now I can call foo. So, that is kindof a form of coloring, I guess. But tome, this is a fine form. Like, it's nota problem. Uhwhat I didn't want was to have thisfunctionlike you know how uh like in Rustthere's what is it like async standardlibrary or something.That's not how you not how you spellthat. Okay. So this thing um which isnot official by the way. So this isdocs.rs RS async std.Yeah, look. See, this is not Rust. Thisis like a different group of people.I think.But anyway, my point is um that's what Idon't want. That's function coloring,right? Like the fact that you have tohave two standard libraries. I want onestandard library and I want it to workin a event loop context and also in asingle threaded context and also on webassembly and everywhere. everywhere.So, I don't know like what is or isn'tfunction coloring? Uh, it starts to getkind of like academic, doesn't it? Likereally the point is reusable code.That's the actual point and this patternuh does enable reusable code.Yeah, I I agree with this take. So,yeah, the problem with like functioncoloring is code duplication, notreusable. So, as long as you have thesame implementation fulfill all the usecases, you're good. And then yeah, whowho cares whether it's technicallyfunction clearing or not? Not not thepoint.Okay. Uhoh, here's one. Is there any big changesplanned for the Zigg build system orpackage management? Uhwell, there's plenty of things that havebeen important things that are not donethat have been planned for a long time.So, for example, if I look at buildsystem and enhancement,um, and maybe likeauthor me.Uh, so here's there's quite a few thingshere, especially if you kind of go tothe older ones.Uh,I would say that some of these I wouldcall big, you know, for example, um,yeah, like running build.ziglogic in aweb assembly sandbox, that's kind ofbig. That's also very breaking. Uh,well, I I guess wethere's some there's plenty of ideashere and a lot of these are planned andthey're just not done yet. So, like forexample, um, Zig Build System has somereally serious limitations that we'reall just kind of putting up with rightnow cuz um, more work needs to be done.And we'll get there. We'll get there.But like uh for exampleum detecting when a dependency has anupdate basic stuff we don't have thatyet. Um dealing with breaking changes ina dependency uh and and not having likea pain in the ass way to patch only onething. Um there's all these workflowsthat we have good solutions for like intheory like we have vaporware solutionsfor um but they just need to beimplemented and they're not done. So, inother words, um,is there anything big things planned?Well, yeah, the things the same thingsthat had been planned for a while andjust aren't done yet. And you can see abunch of these issues were opened, youknow, like years ago. And like we'll getthere. We'll get there. Just takes time,you know, and we'll try to do the mostimportant stuff first so that people canget unblocked. And, you know, uh I I Ithink that I know a lot of people arewaiting for 1.0, or at least they saythey are. They're saying, "Well, youknow, once it hits 1.0, you know, thenI'll then I'll jump in. And that'sunderstandable. That's reasonable. But,um, my goal personally is going to beto, uh, to make Zigg so compelling andso useful that people are willing to putup with uh, not being 1.0 yet becauseit's still worth it. It's still so goodthat they're willing to put up with theinstability. That's my goal. Uh, becauseI don't want to tag 1.0 until it's untilit's ready. And it's not ready yet.Uh, what's the blocker for getting thex86 back end to work with LLD?Uh, I don't know the answer to thatquestion, but um, to be honest, I I'mnot going to work on that at all. I'minstead going to work on eliminating LLDcompletely. Uh, it's just it's not toomuch work like we could like uh, youknow, trying to take on LLVM. That'sthat's a a super long like you knowyears'sl long effort trying to fullysubsume LLD that's accomplishable likepretty soon you know so I'd rather justkind of do a sprint on just eliminatingcough LLD dependencyuh and thenand then that question just doesn'tmatter anymore you know what I meanthat's kind of like my umuh avoid local maximumsmantraIt's like I'm just not going to spendany effort on that. I'm only going tospend effort climbing the big mountain,if that makes sense.Uh how would things like mutexes,futexes, etc. work with new IO?Uh is there any plan to control thecache size for incrementalUm let me address that second one first.So I think you're noticing thatincremental is using a lot of zig cachesize and reason for that is weuh incremental is designed to obviouslyto umtake an already existing output and thenminimally mutate it to the new state. Soyou build something, you make an edit,then the compiler makes a minimal editto the output to in correspondence withthe edit. Umthat doesn't fundamentally produce a lotof cache garbage. But because we don'tyet have uh robust state saving forincremental compilationum the default cache mode that we usecreates a new artifact every time whichcan build up um could build up a lot oftrash in the cache. So uhagain I'm not going to solve thatproblem bytrying to I don't know mess with howmuch size things are. I mean we alreadywe already optimized that a lot but mypoint is uh the thing to work on thereis finishing the state serialization sothat we can go back to the default wherewhen you use incremental mode it justupdates your already existing binary. Itdoesn't create a new cache entry. Um andthen that will stop creating garbagebecause it'll just keep editing the samefile over and over again.Uh let me let me get your other questiontoo because that one was also quitereasonable. I think uh where was that?Oh, I lost the other one. Sorry. Oh. Oh,yeah. Yeah. How does mutexes and futexeswork with new IO? Um they're part of theIO implementation. So the uhuh okay so the interface this is thepart that you interact with as a userhas to define like a mutx and this umI guess we have two possibleimplementations here.So we basically just define UTX as likean integer and um andand then a IO implementationgets to use that integer and they haveto fulfill mutx lock and mutx mutxunlock umuh vtable functions.Souh and but the important part theimportant point here is thatumthe locking is implemented in theinterface. So it does have to coordinatea little bit with the with theimplementation.So it is a little tricky. So theinterface has to have the state. Thestate can't be on the other side of thev table. Anduh so then in lockum it it it tries to do the lock withoutcalling the virtual function and then ifit can't then it calls into theimplementation there. So there is alittle bit of coordination that we haveto do like the the implementations dohave to satisfy like a certain AI kindof umuh but there's some there's some ways wecan tweak this and ultimately it's yeahit works fine. So then you can in inthis function you can implement it in away that integrates with your IOimplementation. So if that's a threadpool you literally just lock a mutex. Ifthat's um like I ring you actually justyield and start doing something else andthen you try to uh and then you youdon't even schedule the the the fiberuntil the mutex gets unlocked. It'spretty it's pretty nifty. So the mutexeswill work like correctly according tothe like IO implementation uh that youpick.Uh is the file system watcher codeaccessible from std? Okay, I understandthis question. So in the build system wehave uh let me go back to the mainbranch.So in the build system we have this umthis code which implements file systemwatching and as you can see it requireslike different logic on Linux or onWindows or on here or we have only KQand on Mac OS it has that limitationabout whatever that thing is. Uh so thequestion is like can this code be moregeneral purpose and I understand thedesire for that but uh having used theseAPIs a little bit I I kind of think thatfile system watching is just like notvery abstractable.UhI just I feel like whenever you do filesystem watching you kind of have totightly couple with the applicationlogic. It's just unfortunately it's justkind of a resistant topic toabstraction. So I have no plans to tryto like generalize this and put it inthe standard library. I think thatanswers the question.Loris, did I miss something good?How am I doing on QA?Shouldn't the allocator also be part ofthe IO interface? Couldn't gettingmemory also block on some systems alsomemory kind of is external in a sense asfiles are for example.So basically writing to memory versuswriting to a file for example could beseen as IIO like if you memory mapsomethingthat's an interesting pointHalso inuh just in kind of like collaborationwith this question if we look at uh theimplementation of a MN and like greenthreads event loop. Uhwe do have to allocate memory.So for example,like where do we even get an allocatorfrom? Oh, okay. So we actually have weactually just have to pass one in oninitialization and it has to be a threadsafe. Um it is pluggable though. Couldjust be kind of any allocator.SoI don't know. I could maybe seeuhwellno actually I think here's one answer tothis question one valid implementationof IOis again singlethreaded blocking eagerso whenever you call async it just doesit and then this is nothing and thenwhen you do this it's always a noop okaycancel does nothing. This does no. Hsorry this does nothing. This doesnothing. Mutexes do nothing. Conditionsdo nothing. These just do everythingimmediately. You get the idea. In such aIO implementation, which is totally avalid implementation of this interface,you actually don't need an allocator. Umit would be kind of inappropriate to putan allocator in the interface in thatcase. like what would it like it wouldbe it would expose memory allocationfunctionality and then nothing else likeit would nothing else depends on memoryallocation.Uh soso that's my argument for why it doesnot belong in the IO interface. It'skind of I think people have a tough timewith like well it's so big right there'sgoing to be so many functions in hereand like yeah it's going to get a lotbigger. It's probably going to take uplike multiple screens with how muchfunctions are in here. Um, but Iactually don't think allocation is goingto be in there. I think that's actuallya lower level primitive that doesn'tfundamentally relate to IO. Um, eventhough all these other things kind oflike counterintuitively do relate.That's that's my current opinion. But,you know, we can we can see how thesituation turns out.Uh, okay. So, here's a question. Readerhas a vableanduh reader has a vable and IO has a Vtable. Does that mean each read op goesthrough two levels of virtual functioncall? Oh, that's a good question. Um,yeah, I'm pretty sure that does meanthat. Uh, it's going to be one virtualfunction call per uh stream, right?Because also if you chain streamstogether, like if you if you take like anetworksocket reader and then you pipe thatinto like HTTP and then you pipe thatinto um uh like gzip or something, everytime you do that, you're going throughone like virtual function call.Um, and so yeah, one for and then at thevery very end of the pipe, uh, you'regoing to be plugged into the IO probablyat the beginning of the pipe and at theend of the pipe, right? So you're goingto have one virtual function call intoIO at the beginning of the pipe,probably like to read from the socket orsomething and then, you know, one at theend of the pipe like maybe you're you'rewriting to the file or vice versa.I think that answers the question. Uh ohyeah and then also related to that is uhyeah de virtualization.Uh yeah and this is where this thingcomes in um restricted function types.So if Yeah. Yeah. And and this is thisis critical. So if you only have one IOimplementation in your program which isthe common case it's not necessary butit is the common case. uh thenyour restricted function types for yourread table will all have exactly onepossible collie in all of the functionpointers. And so those basically becomenon-verirtual like for free. Like I'mnot talking about an optimization goingin and detecting this. I'm saying thatlike the front end of the compiler willjust spit out a direct function callbecause it knows that actually there'sonly one implementation for this givenlike function pointer. Yeah, that's agreat point. Thank you.Oh, so many good questions here. How amI doing? I feel like I'm I'm getting alittle umgetting a little tired like uhbeen talking for two hours, you know?Loris, do you have any uh suggestedquestions that I missed? I've been kindof um Yeah, I can I'm happy to do acouple more.I've just been kind of missing a lot, soI don't know what I um what I missed.Oh, this is a good one. So, what's onthe more medium to long-term horizon?So, not what I'm already working on, butlike maybe tackling after the immediatepriorities are handled.That's a good one. Okay, so immediatelyis streams for me, followed by um bylike async.io stuff, and then fuzzing.We already talked about all that stuff.Uhokay. Yeah. So, I I do I am lookingforward to getting more done on my musicplayer and my music production software.I've been kind ofuh unmotivated to work on those likeright this month because I really wantto use this async stuff in them. Um, soI think I'm going touhI'm going to want to work on that more.And that's going to make me want to doum well, it's ait's a web server, so it's going to makeme want to do a little bit more like webserver stuff. Um, I actually think Ziggcan be a great fit for web programming.Uh,andoh, that's a good one. Yeah. Um, I thinkright now it's not great and I'm notlike super happy with standard libraryAPIs related to web stuff. Um, butcontrary to popular opinion, uh, I thinklike once we kind of get the standardlibrary worked out and the async storyworked out, I think Zig is going to bereally nice for web development for likeservers and um, well and for the frontend if you're using web assembly and soI kind of want to I guess I want to getmore into the ecosystem, you know, likeI want to be a user of Zigg. I want touse Zigg to make a useful applicationthat users use to make music or tolisten to music andum and and help out with the ecosystemand and like make the package managerlike really convenient to use and stufflike that. So probably for me just yeahgetting more into like being a user uhin addition to um compiler dev, youknow.Hope that answers that.Um pin strrus. Okay, so pinstrusthe primary motivation for pin strruswas async8.I think this was an accepted proposaluntil recently.Tada. Uhnowthe new strategy for um async await doesnot require pin strrus.So that that pin holding the feature inplace is now gone.Additionally,uh speaking from experience, thecompiler code, not just theimplementation, but also as a userreading the code, it did become a lotmore complicated in order to understandresult locations. And I'm not talkingabout types, those are pretty handy. I'mtalking about pointers. So the idea thatif you like return thenuh sorry if you do like assignment forexample then like the expression getsthe pointer of the assignment result andthen if you have like a sub expressionit kind of gets forwarded through theresult and stuff. Uh also a lot ofpeople like to complain about thisbecause it can result in like aliasingproblems um which is annoying. Sowouldn't it be nice if we just didn'thave that anymore because we don't needit anymore. So that's kind of the likereason that this is now up for uhdiscussion again and not not alreadydecided.Uh and as usual the default in Zigg isno to any new feature. So you have toyou have to win against the nullhypothesis of don't complicate thelanguage.Um,so in order for this to be acceptedagain, there would need to be acompelling reason to add a feature tothe language that is actually not reallyneeded in order to accomplishany of our goals.Feel free to ask a follow-up questionabout that. I hope that I hope that'senough.Anyplans for syntax sugar for the vtablebased interfaces? Still no. I'm actuallypretty happy with status quo having justdone a lot of work onum on interface design. Oh, I have teahere.Oh, that's nice.Uh, one thing in particular that Inoticed is that let me let me um giveyou an example. So, I'm going to go overtothis branch again.Uh,this one.Now, what you're seeing here is amanually constructed interface. So inother programming languages uh theywould just have like the keywordinterface or it would be a trait orsomething like this and um there'scertain rules what you can or can't do.So for example uh if we look at theequivalent um like rust traits uhbrighterthere it is. Okay. So this is the righttraits. Cool. Cool.um you don't get to create like you knowthis field um in fact you don't get tocreate any fields because um they'vedecided that you can't have fields ontraits and I'm sure there's a reallygood reason for that um but that's adecision that limits what the programmercan do. Now here we don't have thislimitation. So what I've done is I'veactually pulled these buffersfrom beneath the vtable to above thevtable. In other words, they're here.They're not inside. So whereaspreviously we would have to create kindof like a buffered writer as a kind oflike thing in the chain, um it sitsinstead above the interface or in theinterface. It's not in theimplementation.Which means all these functions downhere that are not generic and that arenot virtual all these functions are inthe interface. So for example write bitethis is a you know an important one. Umthe likely condition for this is that itgoes here and all it does is just updatethe buffer, update the counter and thenreturn.And this can get inlined and theoptimizer can fully understand it. Um,static analysis can fully understand itand it only goes into the slow case ifwe run out of buffer.Point is that it doesn't make thisfunction call only it rarely makes thevirtual function call. And that's trueeven if we're sharing this code throughthe entire program for a 100 differentIO streams. We don't have to create a100 different versions of write bite.the same version of write bite can bereused and it's still efficient and it'sbecause we put the bufferin the interface not in theimplementation that's why you'll notfind a buffered writer because thebuffer is in the interface and you cansee it's referenced all over the placeum where was I going with this right mypoint is uh you just you can't do thisin other programming languages becausethey don't let you do it But here wecan. And the only reason that I likejust got to play with this is cuz Ididn't give myself an interface, youknow, that like prevented me from doingthat. SoI actually think it's nice um to makeyour own to build your own interfaces.And furthermore, I think it's theappropriate amount of friction. I thinkthat creating an interface should bekind of annoying and you should have toput a lot of thought into it and youshould just usually simply not do it.And so I I I'm actually quite happy withstatus quo. And I I like doing thischore of setting this thing up was notthe thing that took a long time in thisbranch. No, no, no, no. It was editingall of the usage code to to be um tofollow the different semantics.Um so I'm still pretty keen on notadding any uh object-orientedprogramming basically is what I'msaying.Okay. Okay. Well, I should probably getto this topic then. Um, yeah. Uh,I think let me do one more. We'll do onemore and then we'll wrap up with this.So, let's see if there's a good one toend with here then.Um,okay. Let'swait. I'm trying to parse this one. Uh,how will tightly integrating otheroperating systems with the standardlibrary work? apartfrom okay if I understand this questionumit's kind of asking likeis implementing the IO interface100% of porting to a new OS and if notlike what's not included in it. I thinkthat's kind of what what you're asking.Um yeah that's a great point. think thatporting an IO implementationuh to a new operating system should bealmost all porting work. I think thereshould be very little beyond that. Umbutyour uh your IO implementation is stillgoing todepend on operating system bits. So forexample um let me switch branches oncemore.So here we have uh sorry here we have anIO uring implementation of um of IOandmy point is simply like yeah we need tocall into IO ring in order to do this.So this implementation depends onstandardoss.iouring. Soum you could kind of call this just theIO implementation but my point is likeyeah you have to go implement all thesebits that this code is going to callinto.Umlikewise in the same branch we have umthread pool.Okay. So the thread pool uh it's it'snot only for one operating system. It'sfor multiple operating systems. But inthis case we depend on um like yeahstandard.threadand standard.thread obviously is goingto uh have to do operating systemspecific stuff in order to spawn athread. So we have like a windowsimplementation pix a Linux aasi you getthe idea.Uh,soit's yeah, I mean it's mostly justimplementing IO, but that does involvejust kind of a bunch of different littlebits and bobs and those got to gosomewhere and maybe those go indifferent files. I think you get theidea.Okay. Uh, yeah, I think uh I think I'llstart wrapping up then. And so finally Ishould Yes. How do we supportfinancially the ZSF? Right. So for thosewho don't know um Zigg project ismanaged bythe Zig software foundation. This is a501c3 nonprofit corporation.Uh not to be confused with a 501c6which are allowed to lobby thegovernment. We are not allowed to lobbythe government. We are apolitical. Weare just trying to work on software.Um,we I'm due for making another one ofthese blog posts. So, I need to I needto do the one for last year. Um, buthere's one from last year. So, we youcan look here for our 2024 financialreport. I'll I'll do another one soonfor 2025, but you can see how we spendour money. You can also see how we getour money. And um we do like to try tokeep a good slice of this asindividuals. So GitHub sponsors,individuals, benevityum it's good it's good to beindependent, you know. Uh and sowheneverwhenever we get individuals doingsponsorings of us, uh it makes us veryhappy because it helps us to um keep adiversified income and stay independent.So, we really appreciate all theindividuals who sponsor us. Uh, yeah,and if you want to help out, um, that'shonestly the best way you can help out.Like, we got people chomping at the bitfor ZSF contracts, and if we have moremoney, we can give out more contracts.Uh, how do I do, Loris? Are we good?Okay. Yeah. Yeah. There's alsouhOops.I guess I'll just go navigate to theselinks then. Every.org, Zigg SoftwareFoundation, Inc. Yeah. So, you can alsogo to this platform. We like Every.org.Every.org is pretty nice. It's also anonprofit. Um, and so it's not Yeah,we're a little bit worried if you knowuh Microsoft decides to cancel GitHubsponsors or something, we lose a lot ofincome. So, uh we feel that this one isa little bit more stable. That's ourprimary preferred way to get money. Butum you know every way is fine. You canalso douh yeah you can also do GitHub sponsorswhich is also fine if that's if that'swhat's easier for you. Great. Um yeahreally appreciate that.Uh and if you can convince your companyto kick us you know uh 1k a month orsomething if you if you use I get workthen uh awesome. Really would appreciatethat. But um either way, you know, we'llwe'll figure out the money thing andwe'll uh make sure that uh we stay aliveand keep making Zigg better and betterfor everyone.Okay, I think that's it everyone. Thankyou so much for visiting. Um thanks forfollowing along and um happy hacking.Yeah,take care.


Source