This video demonstrates a significant redesign of Ziggy's meta-programming system for data serialization, introducing a new typed options system that replaces the previous approach requiring multiple magic decals. The new system uses a single generic decal of a specific type, enabling immediate discoverability of serialization capabilities, LSP support, and compiler error reporting. The redesign addresses previous limitations where the compiler would crash on certain meta-programming patterns, and the speaker discusses the broader implications for software engineering, including the importance of understanding system internals versus relying on AI assistance, and the challenges of building mastery in rapidly evolving AI systems.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
[Zig Livecoding] Ziggin
Added:Hello, Daru. Hello. Hello. Uh, let me put a countdown.
Okay, I'm going to get something to drink and I'll be right back.
Okay.
So, I hope everybody's having a good weekend.
I'm not doing bad.
I uh yesterday I did some work on my personal website. I hadn't touched it in well way too long. It was kind of obsolete in some ways. Now it's I don't know. Added some fonts. Uh cleaned some stuff up. Also had some horrible artifacts that I accumulated over time.
Like things that would not look particularly good um related to code snippets. You know what? I think they need more padding. I gave them 15 points of padding, but I think they need more than this. Not not at all more. Just a little bit more. Maybe 25. Something like this. Anyway, um, so this is all better. And there's also another thing that I added. So when you get to the bottom of the page, there's this thing.
I This is not my project. I saw it on lobsters and I wanted to try it out.
It's essentially instead of having a comment section, which personally I find comment sections on on personal blogs to be uh complete cringe. Um, instead uh you can uh you can go here and just chat. It's like real time chat.
Every person that you see is um is somebody actually reading having the page uh the page open right now with JavaScript on and uh you can move around and chat with people.
But it's um it's ephemeral.
So the bar seems nice.
Yeah. It looks a little bit like an KCD comment, doesn't it? Yeah.
So this is the idea.
And I don't know. We'll see how it goes.
Uh I'm going to keep it. It's an experiment. So the rest will are um permanent changes. This one is an experiment. We'll see. Oh, there we go. There's somebody moving around.
Hello field.
I guess the ZZ is when you tab out. So tabbing out makes you go to sleep, I guess.
Okay, so this is somebody coming from uh Have a nice stream. Thank you. So this is coming from you must fix your asserts. Uh the the thing is it also tells you what page people are coming from. um which u I don't know maybe not the context is not that interesting but I find it particularly fitting for a personal blog because you see oh you can also full screen it you you can also see um um uh what did I mean to say yeah you can you can see what they're reading so you maybe they make a comment and the comment relates to the blog blog post and so that you can contextualize it. So, um, so far so good. I like this.
I'm looking forward to see what happens in the next time that a blog post of mine uh gets on the front page of a news because I think that is the the where that system will, you know, either shine or crumble.
Okay.
So, uh what are we doing here? Um aside from uh appreciating uh blog post uh stuff. Uh well, so let me exit uh all my personal website development stuff. Uh also I as part of these change, one last comment on the blog. Um as part of these changes that I made, I also restructured a little bit um some stuff. Previously my blog posts were not in a dedicated section. Uh and when I mean section, when I say section, I mean uh the concept of section as it is in Zen. So the idea that the pages are grouped together and you can access them as a group. So like hierarchical organization of of pages uh which in Zen is done through directories but but not entirely. It's not it's not uh like a section is not a onetoone with a directory.
So, um, what is the point or what I'm saying that I had some pages that previously were not a section, then I made them a section and the refactoring process was delightful. The whole refactoring process were entirely delightful. I got error messages that mattered and then guided me through the process towards success. Uh, no jankiness, no crashes, no weird stuff. Just um, pure good stuff.
So, um, what can I say?
Good times. Good times.
Okay, in the meantime, uh, here I was testing some stuff.
But most importantly, let me let me restart the editor because I also made some changes. So, most importantly, I'm redesigning how um Ziggy metro programming detection works. Previously, you had to have a bunch of magic decals.
Now, you need to have only one magic decal, and that thing has is has to be generic and has to be of a specific type.
And uh that allows us to essentially define these things correctly for you.
So they the the key difference is by me placing everything into a strct discoverability of what it is that you can do or cannot do with this meta programming stuff is immediate because well not only you can go to the strct definition but you can also get LSP support. You get compiler errors. you get defaults like you get to observe default behavior by observing the default value that these things have.
Um, and so so far so good. The only reason why I originally didn't go this route is because I I needed you to specify two functions serialization and deserialization.
And um and I didn't know that you could do it this way. The point is that these functions need to be they cannot be like function pointers. They have to be or rather I guess they could be now that we do we're doing everything generically.
But in any case um I was using a more naive approach this approach now the lifeful. So um that means that I'm in the process of designing these um I'm in the process of designing these uh new type and uh well we go we have to update everything that depends on this stuff so that we can move to the new system. Also we have to pray that there are no uh com time issues with uh this approach because uh the basics are super simple. I'm mildly worried when it comes to um like types that are recursive that kind of stuff it should work out like it is sound. What I'm doing is semantically sound because it's not even that different from what I was doing before.
The difference might be just mechanical like implementation wise we might be hitting we might be stressing some other part of the z compiler that we were not stressing before and we'll see how that goes. I will say though that in in the past it was not uncommon to for this stuff to um find crashes in the compiler. As of late, since MATLAB has been involved with uh the compiler, this stuff has improved significantly. I cannot even remember the last time that I uh triggered some kind of of com time uh bug of this kind since he arrived before him. O, that was easy.
When is 1.0 or coming uh we don't have um set uh time for that.
So in terms of uh like what what what is 1.0 depending on 1.0 depends on us being satisfied that the language has been the things that we wanted to explore have all been fully explored.
uh as a vague estimate I would say again estimate so this is not a promise um well so 1.0 know specifically I don't know because that also depends on the standard library being stabilized but I will tell you that the language the language I believe will be probably be done or you know almost entirely done in less than 5 years um and then and I don't know at that point where we will be with the stand library so uh there will be a moment of big breakage breakages in the stand library as you know stuff gets reworked and cleaned up and right now we don't even have like a precise policy for what should or should not be in the standard library. So we need we need to do all this you know design work. Um so I would say yeah less than 5 years for the language to to be very stable uh and um and a little bit more than that for the standard library maybe to be stabiliz stabilized something along those lines. Production ready it depends on your production needs. There are companies today that are using Zig in production. Uh Tiger Beetle for example is one of them. Um and uh for them Ziggas essentially is already production ready today. Um so it really depends on your needs. But if we assume that you know for you stability is a major aspect of and when I say stability I don't mean like that you have weird crashes. Obviously not. I'm talking about like source stability. you not having to touch your code either at all or almost at all when upgrading Zigg um for that. Yeah, it's I think it's about five years.
Okay.
Hey there, Toy.
Okay, we need the proper we need the correct signature uh signatures for this stuff.
um which I think are hidden in serialize and deserialize.
This guy knows and I think it has an error message somewhere where it tells you if you got it wrong.
At least I hope so.
Yeah. Look at this stupid [ __ ] compile errors that we're going to be able to get rid of. Oh man, this is going to be so delightful.
Okay, you know what? Uh that that's going to be easy. We go to dynamic and we copy in uh we we copy everything from there directly. [ __ ] it. So this is the signature.
Hey there, you would be interested. Um yeah, I think I may be able to to do that.
So serialize it's a function that accepts the pointer to serializer value which is of type B.
Let's give it also names so that um so that people have a better understanding of what is what.
Now here's a question. What is the difference between indent level and depth? I don't remember. Holy [ __ ] Uh also what can it return?
Um what is the arrow set?
Right failed, right? No, I think it can return more than right failed. Or I might be wrong. Maybe it's just right failed and that's it.
And actually we can even say this better than this. We can say, "Oh, wait a second. Where's the [ __ ] writer?"
Calizer owns the writer.
Of course, that makes sense.
Okay, so this is serialized and you know what I don't remember what that does.
I'm guessing we should see here.
depth indent level. Hello. Hello.
We mostly pass it around.
Where do we consult this value? Okay, we pass it around. Increased.
Oh, there we go. Omit curies. Oh, that's what's left.
Why is this a separate thing compared to indent level? Because in level does not increase when you're printing horizontally. I guess uh in horizontal orientation.
Okay, I think these are decent docks.
Let's do this.
No. What the [ __ ] am I doing? Uh, for this serialize, we still go to dynamic.
Oh, now this guy has the serializer error. Yeah, so the serializer has um his own custom its own custom error set, which makes sense.
override the serialization behavior.
What's in a serializer?
I think um I think they should change to uh make sure to put it here.
token dializer token.
I wonder if this depth should not be also a top level thing at this point.
Maybe I don't know. I don't remember how this stuff is implemented enough to really be able to comment much on these details.
Okay. I think that this interface is not the best possible. It would be nice to maybe make this a little bit less hard to use in the future. Um but it is fine. Whatever whatever happens. So uh okay this looks good to me. We have the proper signatures. We have a bunch of docs. This is all well and good. The next step is um giving this bad boy to some types and see if we can make this whole thing work. By the way, this all started because I need to also give uh RO information to types that override uh the roles. Also I should say that this um used uh by buildtime Z type Z schema compatibility for types that customize the serialization.
I would say that if this is different than none then you must have either serialized or des serialized. At least one of the two you must have.
Okay. Uh this is good.
Uh so um next thing that we do is I think we want more than anything else like we can leave this here and only and wire it bit by bit. So let's start by wiring this for our snapshot test and the schema the zig type schema checking stuff. Let's uh avoid upgrading the rest of the codebase until this stuff has proven to work well at least in that context.
So um that means going into type checker and we don't do this also schema schema right. Uh so where do we put it? uh serialize des serialize.
I think a schema should go above roles or below or above everything actually. Maybe under skip fields.
Yeah, under skip fields for sure.
So what is the default value? Empty string or null? You make it optional.
I think we want to make it optional. We don't want somebody by mistake to pass us an empty file and then we think that it's not there.
Okay, so this is the schema. We might need to add more schema related stuff in the future, but again, starting point.
This seems cool. Actually, more than cool. This seems [ __ ] delightful. So, the type checker wants Ziggy options.
And then what it wants is it wants type of ziggy options to be ziggy.
T.
So if uh step of zigg options is different than z options of t error.re report error record.ziggy Ziggy Ziggy options must be an instance of C options.
Then we add another one and we say if we kind of want the or else version.
Now we pass our own schema directly which I think it's not a little necessary but it doesn't hurt to read a people. So this is all well and good.
schema.
Just I'm going to rename it to my source.
Actually, Okay, so this is code that I was working on. I'm in the middle of changing a bunch of stuff. So, unfortunately, I'm not ready yet to test this code right away. Oh, actually, you know what? Never mind. I I [ __ ] am. Just Just comment this stuff out.
And we should be happy.
Actually, it it's probably that easy.
Okay, let's see what what we messed up in the meantime. So, I would uh right now if I don't have programming errors, uh they should complain that there are some types that don't work out. Uh but never mind.
Schema tokenizer Mfield idx schema tokenizer 402.
Oh. Uh these are tests.
Okay.
Okay, so now we complain that missing or private Ziggy options, right? Because the I forgot that the actual thing was Ziggy options. It wasn't just Ziggy. So, uh let's go to our examples uh which are type checker stuff.
this one.
So this is Ziggy options.
So this now works very differently.
So first of all it it depends on Ziggy.
Second ziggy options is of type zig.options and it has schema.
Well, it's essentially this Okay. Now I think the problem is we don't have this import which we need to add. Uh that is fine. That is in our build system build.zig Zigg in our build system. Uh root source file then types.
I think we can just do this and it should work.
Okay, here we go. I [ __ ] this up.
Look at his mark.
This is source tokenizer token. Oh [ __ ] Um token.
Hey Okay. Get selection.
Guess I can do this here.
the physics selection. What happened here?
Oh, what happened is that now it succeeded instead of complaining.
Instead of complaining in one step, the process succeeded. instead of complaining.
Um, I guess it's because the other snapshot tests are running and succeeding.
What does a marine line do? Oh, this.
Okay.
Okay. Um, so, uh, we're doing fine.
Actually we are doing fine like so far so good.
We could probably make um a getter function for this stuff.
Oh, also this error report is wrong.
Wait a second.
Okay. Because this one, yeah, it's like, oh, you're missing a thing. But well, this one is has different. Okay. That is uh [ __ ] awesome. Also, I believe, and I want to test this out. Uh I believe that if you make this a var then it's going to be a problem.
This is going to be a compiler error right? Yes. Must be console comp time.
Delightful. That is what that is what I want. Okay. Yeah. Compiler helping out so far. Awesome experience. Strict improvement over status quo.
Unfortunately I'm don't have autocomplete because zs doesn't work with latest zinc. uh wealth.
Um but um yeah, so far so good. So uh what do we want to do next?
So there's simple and schema errors.
Simple Simple should complain.
Why is Simple not picking up the fact that I don't have a Ziggy options?
Do we like commit wrong snapshot?
I wonder maybe I just never get that far.
Oh, you know what? It might be that I never get that far because Ka errors doesn't kick in.
And frankly here, we don't need to have three of those.
I'm confused. Wait a second.
Schema errors. I thought I thought the schema errors Yeah. contain wrong syntax.
So we essentially just need one and this is not okay.
Wait, this is a bit suspicious. This is really a little bit suspicious.
Um, but I guess it's the type checker one. Am I I suspect that it's um Sorry, this doesn't mean anything. It's the one that is testing for type errors. And I think that is the one that is succeeding by mistake.
Uh oh. So, so you know what? Maybe because of this error, we don't get to see the deep mismatch until this guy, you know, correctly fails. So, for example, if you go into types and we add a wrong field, now this is not going to error out and we're going to see the diff. Okay, there we go. We're going to see that there are some diff some things that don't match.
They mostly do match.
The the type stuff is different. Okay.
So, uh nothing is broken. We're good.
Now, we need in the type checker to implement the type checking as I was implementing it yesterday night. Um this guy because I made some progress. I made an implementation that was delightful except totally wrong. So, now I started doing it again. the right way which got me into the rabbit hole of oh wait how am I going to implement correctly stuff like dynamic so what I was doing was special casing the fact that ziggydnamic is is special because essentially maps everything but then I decided to open this possibility to also other people meaning that you can make your own implementation of dynamic if you want which will be recognized the same way as dynamic uh but you know maybe you have your own implementation details that you want to change and so you will be able to do that if you really want to uh etc etc. So um give me a second I'm going to get something to drink and um and uh yeah I will in uncomment this function and uh yeah the meta programming continues essentially. Uh, this whole thing seems delightful though. Like this seems such a strict improvement over what I was doing before. Holy [ __ ] Be right back.
Okay.
Okay. Let's get this. Let's make this happen.
To be honest, I don't even really need to pass this around.
I think we can do this.
Yeah.
Okay, so we were here yesterday and we were trying to decide how to uh make this stuff happen. So the idea is we have a type that we want to scroll forward, but it seems that our ability to make that scroll forward.
Some of it is going to work out. Some of it requires um might require recursion.
Then we have a token Well, tokenizer that produces tokens and we want those also to scroll forward.
So I think here we want something like this. Basically let's see if we can do this with a while true.
And the idea is that we move forward types and stuff.
F type moves forward. Exper moves forward. These are the two quantities that we move forward. So every time we enter, we check is this type is the type that we're looking at um does it have a role of any? If so, we continue.
So if yeah maybe we can even do it here const.
No we cannot do it there because we need to do it here. Um if f type oh right also this type might uh or might not have ziggy options.
Chances are that it doesn't.
Wait, we need to do this also at the at the outer level. Wait a second. So I Yeah, this stands for validate zig.
So validate zig make a schema.
Start a reunion.
Are there zig buying lings for half buzz?
Um, I don't know firsthand, but I would encourage you to take a look at the Ghosty code base because I believe that Ghosty uses Harps and um well, if anybody has bindings uh to that, I believe it would be them.
That is my that would be my general guess.
Uh this stuff is cursed.
This stuff is really cursed that I'm not approaching it the right way.
This stuff is truly cursed and I'm definitely not approaching it the right way.
Yeah, because we essentially want to do validate zig on that stuff.
Yeah, this is tough.
Okay, let's just try to do something so that we can make some progress. Then I will probably need to relook uh this on my own.
Uh but here's what we can do I guess. Uh once we get in here we can say if uh f type So if it has the options, you complain then. Uh here we can look at what uh here we can look at um at rolls.
So we look at rolls and if it's any We return and if it's not any to do.
Yeah, I guess we can do that. or rather wait. Um, well, if it's none, then we pull through essentially because this is a normal strct.
Okay.
So then with this we have um we have tested the type then we look at the type.
So here the idea is it doesn't have any special role because if it if it has any a special role then we would be doing something else but this does not have any special role. So we just uh working we're going through it the normal way.
So there's no no dynamic no dictionary.
We're just doing normal shape bies matching. So how does this work?
The question is does this type match the expression that we're looking at?
But we have to start by switching on the type. It would be very handy to start by switching on the expression but we can't. We have to start by switching on the type. So uh for example if the type is and like there are still some things that we can special case like we can do the string stuff that I was doing uh elsewhere. That one we can do. We say okay it's one of these guys.
If it's one of these guys then let's switch the expression tag.
And if the expression tag is bytes the tag is by bites we're done. Return.
If the tag is slice we need to do stuff else it's an error.
And we report a T field name F name.
I think a type mismatch should be kind of like a standard thing.
This should be something like report uh report report schema report type Does it need f type? Hey, the bunny.
Thank you. Thank you very much.
Uh, do we need to pass in the field type? Why can we not just uh why can we not just grab it ourselves from the name when we need it? Ah, whatever.
Okay.
Okay. So, it's like if it's a string, awesome.
Uh let's uh do some other simple stuff.
If it's a boolean expression tag, if it's bool keyword, then return else this.
This is kind of showing us that it's the fall through that causes these error report stuff to happen.
So, so we can Okay, this is something that I was doing before. I guess I can keep doing it. So, that means that essentially we make this we make the fall through the error case. So, when when stuff goes wrong, you fall through.
So, slice is missing some logic. Uh but it needs to continue. So you either return or continue or continue outer and then we only fall through.
Full through means means match.
Okay.
something like this. I don't know. This this is just to get rid of compile errors. Um, do you use LMS or not at all? I've used L&Ms. I can occasionally open the tab and ask the thing a question and get a reply back. And um but like for coding as in like heavily assistance um I don't need it given what I'm doing right now. It would be entirely detrimental uh getting assistance from one of those things. I need to figure out the algorithm myself first.
And of course I could have the thing figure out the algorithm in my place. Then since I don't know what the optimal solution looks like then I get a solution from the thing which maybe let's say it's a good solution like it's a working solution. Do I know if it's the optimal solution?
Um no I don't and um I I wouldn't be able to recognize it right away because I would still need to go through this process of of exploring the the solution space.
So like the the the typing time I would be able to cut the typing time but I wouldn't be able to cut the the understanding time and in any case the understanding time is lower than the typing time. So yeah, given what I'm doing, by the way, just to be clear, I'm doing stuff. I'm doing I'm writing a new JSON replacement language and I'm doing some funky stuff with schema checking that is pretty novel work because I mean JSON schema exists so that is not new. But um I'm having this stuff be deeply integrated with uh zigcom time reflection and uh this is new stuff again people have done schema checking uh with zigcom time or something along those lines in the past that is not entirely new but the specific semantics that I'm going for those are new so Um, yeah.
Okay. Z options. Um, is this enough to to get something off uh the ground? No, I think we need more.
I I want to be able to run our own tests. So, we have strings. We need boolean. I think we need U32.
Uh although I think I'm going to do an else branch here.
And in the else branch I'm going to do um I'm going to switch on on the type info.
For example, if it's an integer, I think it's just int.
So, we switch on the type info and if it is a int. So, for example, bool, we say it's unreachable. We handle it above int um or int.
Although, you know what? Maybe maybe we could move this down here at this point.
Wouldn't make much of a difference. Oh well.
Uh var with ins. Um yeah, that is a good question. So you um so it's kind of complicated because on the on you know on the zig side sure you should be able to say you know I20 and have that work for you at least in some context. So it's sure um do I want to have that in the ziggy schema language?
Uh up until now I have purposely avoided that. Uh right now Ziggy has just a integer int I think keyword and uh that's it. Um so you don't specify the size because for a textual format specifying the size is not that important because the text encoding is just you know even though there are no quotes around the number the number can be arbitrarily big. So the schema like the how can I say the document itself doesn't doesn't necessarily have to worry about that stuff.
Maybe maybe maybe you could make an argument in favor of that. Certainly it is certainly true that once you start thinking about a binary serialization format which is something that I am considering in scope then integer size does matter and at that point um it might be good to have to add that information. So, uh, I would say currently we don't. I think we probably will.
Is there any estimate for when, uh, Ziggy Biggy?
So, you know what?
You know what? I had no idea what to call the binary format, but that is genius.
I think I think I'm taking this. You know what? that that is a genius suggestion because again it's like uh JSON bison uh the B stands for binary but it is also true that it those are probably going to be biggy files because big files uh because Ziggy is limited to up to 4 GB you cannot create a Ziggy document that is more than 4 GB uh so if you want something big um yeah you have to switch from Ziggy to Awesome.
I love it. I I really love it.
Yeah, instead of having that be unreachable there, we could just do it through the type info. That's fine, I guess.
Okay. So, I don't know. Um, we are really far from uh we are really far from being complete.
Fold through means mismatch.
Um yeah, we're really very far from it.
FE and expert have never been modified.
That is because we're not really looping.
I think we can already test this though.
As it is, I think this is testable.
Uh maybe what we're missing is optionals. Could we should we do optionals?
So if that info info is optional then we need to switch the expression tag and it needs to be one of the optional ones and then we need to test the child.
Oh, but we change the expression tag.
We lie about it. that that is something that we should be able to do. So the expression tag opt byes keyword optional bool keyword optional int keyword let's add these ones for now. So what happens in those cases?
In those cases also else pull through uh in those cases a missing field is a hard error rather than an optional a missing field. So these are things that should be uh personalizable right at least to some degree. Um, currently I don't have a concept of default values. So the idea is that if there was a concept of default values that I'm still playing around with. So um, how can I say um, this part of the schema language is not finalized yet. But if we add default values, then a missing field of a field that has a default value shouldn't be a big deal, right? Uh it should be fine.
You're essentially implying that it you're using the default value. Um but right now we don't have that. And so yes, missing fields are a problem or rather they're an error. And uh I am considering the idea of having of not having default values except null.
So the idea is you if you make a field optional then omitting it means that it is set to null. That is what I'm thinking. Um we'll see though. I'm not sure because one issue with default fields is that if you have a default field that is you know it's a string then easy but if a field has a default as default value a complicated value then how the [ __ ] do you know when you're trying to serialize it whether that field still has the default value or if you changed it. Like you would need to run the whole uh equality test before you can know if a field when you're serializing an a strct, right? So you have a strct and that strct has a field named fu which is another you know complicated strct. You're serializing it. You want to omit fields that have the default value. How do you do that?
You need to check whether a field has the default value or not. So um the problem with default values is that is that they are kind of lossy as you go from serialization to des serialization.
So it's not the end of the world. Uh but the utility of default values diminishes significantly the moment that you have a pipeline that deserializes and then serializes again because then either you waste a lot of time checking for equality which might not be uh which is which is generally a bad idea. Let's just say that way. It's just generally a bad idea. And um well so yeah that's the thing.
So that is why I was thinking that maybe we'd only do it for null. Essentially if something can be null then you can say that null is its default value if it's um if it's being omitted.
That's kind of I don't know. We'll see.
Oh, I think these guys all each will need its own handling code.
So, we change the tag. We quote unquote unwrap the optionalness from the tag.
So, we lie about it. And then we um change the type to the to the optional child type.
And essentially in these other cases we do the same I think that's how we do it.
H this code is not complete. There are more cases, but uh I'm trying to just fill out the flesh out the basics necessary to have our our um tests work.
Expert is not marked pub.
I [ __ ] knew it. Types are not available at runtime, but it's not runtime, man. It's like um look, it's um yeah. So, confent bar. Oh, wait.
Is this it?
found bull.
Is there a ease container?
There's no east container, huh?
I guess we can do it in here.
Whenever we whenever we switch on type info Oh, wait. That wasn't unnecessary.
Yeah, we just need F type to be.
Um, no, I'm wrong.
Uh here something like this.
So loops are evaluated at runtime outside of time scopes.
Yeah.
Can I have any line switch please? Good sir.
So, we can't even switch loop.
I was saying so many good things about Mlag earlier and now he's dropping all these limitations on me.
So this means that we need to make this thing more recursive.
I suspected as much and um make it a normal loop with switch inside.
I guess we can try.
Well, I mean actually you know what? Uh so far there is no so far there is no difference to be fair. So far there is no difference.
Unhandle enumeration value. Sorry.
Unhandled by this and that. Yeah.
Store of com time variable depends on runtime condition.
Yes. Yeah. Unfortunately there is no escape like uh yeah s complain variable depends on runtime condition. Indeed.
Indeed.
Indeed.
Yeah. We need uh we need necessarily recursive functions. I think No alternative.
Let's uh do this.
Let's ignore the optional case for now.
Do we do anything stupid with optionals?
We do here.
Okay, I removed the optional stuff. So hopefully this should not trigger it anymore. Let's see if we can get to building with a simplified version.
Uh schema token tag has no member byes bytes keyboard.
Yeah, it builds and it gives us actually the right uh stuff.
So, this is working.
Okay, this is still simplistic uh but it works uh for the you know the narrow cases that we are uh that we are testing for in our checker. Uh this stuff is giving me confidence.
This stuff is giving me confidence that we can uh now go and update the rest of the codebase to the new Ziggy options format.
But yeah, we can update that stuff. After we're done updating that stuff, what do we want to do next?
Um, well, we can continue making this fullfledged. Although, we doing it correctly. It's not a stream friendly activity.
Alternatively, we could try to upstream this to Zen or we could try working on the tuning a lot a bit more. I still have a missing piece of functionality when it comes to the to the autocomplete.
Yeah.
Okay. Uh let's update the rest of the codebase. So in root, this guy is delightful. Maybe we we want to have also a getter function for options. Something like um something like get get and like uh has where has just returns a boolean no erroring and um get insert makes it a build error a compile error.
Yeah.
And I think we want to copy this logic here.
We try to put the name itself.
No, I think it's uh think it's going to be on a new line.
Yes.
Oh, you know what? We should also maybe say that the returns null if the type is not a container so we don't error out on the has dehole.
It's also opaque. But can you what happens if you try to serialize an opaque? No, you can't. So that one can be ignored.
Okay, this seems good.
I think that's kind of what you want in general.
So, um uh we want it to be in line. I mean type has to be com time but um can this function fail to run a com time?
I don't think it can. No, it can't for sure because it returns a type. So I don't remember what the rules are for inputs um when all the inputs are comp.
But the output is a type. So it has to run at um the compile time. So no need to make it in line. Uh so this is good.
Now we can go everywhere in our codebase and fix it. So go to dynamic.
Dynamic uh has ziggy options, but we need to change it. Oh boy, this is going to be fun.
Okay.
So, how do we do how do we make serialized work? Because we cannot define them in line anymore. We have to grab them from somewhere.
But this might be actually good cuz I think this should be moved down.
Excuse me. Declations are not allowed.
What the [ __ ] does this what?
Oh, between container fields. Okay, so this is a tank is going wacky issue.
So yeah, so these functions cannot be just placed in here. Well, you can with the strct trick. I guess if you really want you put them in a strct. So there there are ways, okay, there are ways to achieve what you want.
Okay. And then roll.
What's the role of dynamic Annie?
Okay.
Now we do the same to dictionary.
Oh [ __ ] this is a generic function. Uh so that means that we need to define these functions in the strct I guess.
Well there are alternatives but um we could define them up here.
I think the most natural place is in its own structure.
Also, let's move serialize above.
Wait, what the [ __ ] have I done?
It was not supposed to be moved above.
Oh god. This one is called deralized dick. This one is called dialized dictionary.
What the [ __ ] have I done? Oh no. Oh no.
Okay. What the [ __ ] have I done?
Something real bad happened.
D serialize.
D serialize. D serialize. Oh, wait. We always had three functions.
This ticket is called by DD. Oh my god.
So actually uh dict wants us to specify the child type which is going to be T in our case.
There we go.
Okay, this is pretty good.
This see does seem pretty good.
I'm starting to think the schema does not belong in here because you only schema only makes sense for top level uh types.
It really only makes sense for top level types.
Yeah, I should be provided externally.
Okay, we'll figure it out.
Uh, okay. Okay, so with this I've upgraded uh two of my boys. Now there should be a bajillion compile errors everywhere except that type found blah blah blah right oh this is the perfect example where no actually the correct uh approach is to use this well here the correct approach is to use dynamic actually there's self in here isn't is there not yeah let's use self selfch child then everywhere else we use self. Okay.
Yeah. One problem solved. 99 to go.
No name roll. Oh, is it some?
Yeah, it's sum.
Was it a rolls?
I thought I got the inner thing wrong, but it was the outside thing wrong.
Oops.
There we go. Has decalize.
There we go. Except that I found root options.
Yes, delightful. Okay, time to go fix this decalizer as deco.
Okay. So, how do we turn this into good?
Uh, this is turned into good by doing if ziggy.get get options of T.
Uh, I guess root.get options.
This doesn't even have root. Oh man, this order of things is so weird. So the allocator goes up here. IO goes after the allocator tokenizer and token. Okay.
And you see the schema root I am going to put here.
Okay.
If get options T and this is more like if opt serialized There you go.
Oh man, so much better. So fewer. So many fewer strings.
Enough with the stringly typing. Let's do actual proper typing. Okay, what's in here?
Same exact thing.
right?
Yeah.
Oh, there we go. Skip fields.
skip fields. Uh, so here we're trying to grab from T. Why are we grabbing stuff from T in a in a giant loop? Why are we not doing this once on the outside?
I haven't seen humans writing code like this for the last 6 months. Oh my god.
Yeah, things are changing, aren't they?
Things are without a doubt changing.
So seeing someone vibe code live isn't very entertaining. It's not. I actually have not done it. I I mean I can guess uh that that is the case but you know have not having not done it I it's interesting to hear the opinion of somebody who has. Um, yeah. Well, they prompt, then they wait, then they read the code maybe.
Oh, look at the Oh, look at all the janky typeing for skip fields that we can get rid of.
So, what I think we could do here is default to an empty skip fields so that we don't have to do this check every single time.
I wonder at the comp level how bad it is to do this every single time versus doing it once.
But you know what? At least we can do this.
Get options from T N [ __ ] it.
Ah, no. I hate it.
Okay, let's do like this.
Okay. So then we we're still testing these instead of unconditionally looking at the skip fields.
I think we should unconditionally looking at the skip fields.
Yeah, I think it should be like this.
Oh, but here we break BLK. Okay. Oh, that was the that's this should be the same, right?
Wait, what the [ __ ] is this serialized field?
Wait a second. What the [ __ ] is this field? I made it. What?
This field.
Oh, it's a strct where you want to [ __ ] around with the serializing specific fields. Oh no, this goes this wrecks havoc um to this kind of wrecks havoc to our system at this moment. That means that instead of a list of field enums, I guess we would like a a strct where the keys are the same as our fields.
But then for each one, the value is um whether you whether you want to have normal behavior skipping or if you want to dialize it.
yourself wild.
Uh let's see why coding isn't a very active process if you think about it.
Streaming have to feel like you're sharing an activity. That is why streaming gaming is so popular. Um yeah, I would say more than just sharing you have to you know what this is this is an interesting point.
If you had asked me what makes stream com streaming compelling, I think there are two main answers. One is it's a parasocial activity. So if you're somebody who watches streams because uh it it activates the like celebrity receptors of your brain uh which happens a lot. Um that is why you know people know the names of the most popular streamers and in some weird ways they care about what these people do or don't do all the drama like like you know the the aristocracy of Twitch streamers are all busy creating drama and uh social stories all the time. Like I say drama which sounds very uh judgmental which I which I do mean it a little bit. I do mean I do mean to be a little bit judgy about it, but not not everyone not everything that they do is you know manufactured controversy. Some do that sometimes, but there's a lot of just storytelling that is not particularly you know rage bait uh rage farming essentially. So they just um you know they play games and there's this whole sort of them playing a game and there maybe they're playing it well they're not playing it well and whatever the heck happens in the meantime in in the middle of all of that. So there's one thing you care about the people doing the streaming and so you watch them for this reason. The second reason which I'm I left for a second but I personally think it's the actual the one the main good reason to want to watch a streaming is essentially um you watching people being creative and doing things in a way that maybe you yourself would be able to. So when you uh when you watch people playing, you know, you you watch, I don't know, uh Moon play shooters, Moonm Moon is weirdly good at playing shooters. He is way above average. So you can pick up on the creative decision making and uh creative execution that he has the ability to pull off because he's just uh weirdly good at video games. Uh I think you can say the same with a lot of other streamers, right? There's also Shroud.
Shroud is also another person who is really good at games. Boy, is he insufferable when he talks about anything that is not video games? But that's a different story.
So, but he is good. I remember watching Shroud back when he was uh a uh Counter Strike pro and uh yeah, that was that was awesome. So my point is you you watch people being good at their craft.
If vibe coding is not interesting, if we if we base our analysis on what I just said, which by the way, I I I mean it. This is something that I believed to be true since way long before AI became a thing. So in this framework, if looking at people vibe coding is not interesting, it might just be because they are not showing you any kind of of mastery of the craft in any way. By the way, I'm saying this half jokingly.
Obviously, uh you you can you can master anything. So I'm sure that a master prompter could be entertaining to see.
Uh but I don't think that there I don't think there are that many master prompters because I think that to be a master prompter you essentially need to be a manager and it is tough to be to to be somebody who finds interesting looking at somebody else being a good manager and then I guess they would need to have a knowledge of the quirks of the model that is just impossible to build up uh in present time because these models keep uh well new models come out so you have an incentive to move to the new model and then they keep tweaking the model behind uh underneath you all the time. So and then the model has um what's it called? Um is it heat? Um is it called heat? I know there's a I forget the actual terminology but there's also randomness. get that gets injected in the model behavior and u and you can tune it you can turn it up you can turn it down so I believe that these the big models when they are served to you I don't think they keep the the that value all the way down to zero so how do you build mastery of a system that is fuzzy by nature that you cannot inspect temperature okay thank you uh that uh you cannot inspect where the where it is not only fuzzy in general because it's a neural network, but then on top of that, randomization is added on top of it. So, um, how the [ __ ] do you become an expert at vibe coding? I don't even think it's possible. It's kind of like, and to be clear, that does not mean that there are no good, better, and worse people at it.
That is still going to be the case. But the problem is that building mastery is very hard, borderline unfeasible. It's like um uh you know it's like being a YouTuber are there are for sure better and worse YouTubers. There is that is not a discussion. But does any YouTuber have a mastery of the algorithm? I would argue no. You can learn certain things.
You know, you can learn to put uh flabbergasted faces on your thumbnail.
You can learn to put uh red arrows, the pointed thing, and then click baity titles. You can learn this stuff. You can learn that this stuff works. But but none none of them is truly an expert of the algorithm. You could even argue that the algorithm is designed to be impossible to fully understand. Uh because somebody who is a content creator that fully masters the the algorithm would be somebody who would potentially be able to exploit quirks in the in the algorithm in order to get an advantage that is not based on the outcomes that YouTube wants which is you know generally speaking better engagement.
So it's kind of by design. Now you could even argue and here we're entering team fath theory. So but you could even argue that there is an incentive in guaranteed that you not you cannot really master LLMs.
Um because as long as they well, okay, if you're an LLM company, you want people that use your LLM to get good outcomes from it. So you don't want them to be bad, but I don't think that you want them to really understand precisely the shape of what the thing can and cannot do. You want the mysticism. You want to tell people, you want to convince people that that the model is [ __ ] amazing and it's, you know, it's it's so dangerous that you just cannot give it out because otherwise people would be uh would be too powerful with it. Uh you want to convince them of this and you kind of want to keep them uh dependent on you releasing updated new models over time where the improvement is something that is again another thing uh wrapped in mysticism and yeah and then you know what there's a there's one last aspect um as long as something is hard impossible to know uh to to fully learn it kind of behaves from your perspective like a slot machine. So you know how for example rogike games have an addictive nature because every run that you do you might get lucky and you might you might win big. So rog likes have this slot machine angle to them. In reality, if you really were to learn the um the rogike rules start to finish, it would it would almost if not entirely lose the slot machine nature for you. I have a great example of this. Uh for people who have uh who have played um Noita, Noita is presented to you in the beginning as a roglike game. And I mean it kind of is, but once you learn how to play Noita for real, it's not a rog like anymore. You can every single run obtain all the things that you want with essentially you can make mistakes.
You can be unlucky because there's an enemy that I don't know is going to shoot you with some kind of [ __ ] bomb from the shadows. So like um it's not you know you you can die. It's not like you cannot die but the whole aspect of oh my god I was so lucky this run look what I got this run. Holy [ __ ] look at this thing. Look at this wand that you get once in uh in Noita. Uh that is completely gone. That is ab completely absolutely gone. The game changes its nature which by the way this is one thing that makes Noita a delightful experience. Um, yeah, but the YouTube algorithm and LLMs, they just do not work that way and there is just no interest in in giving you the ability to look at them that way. So, I am sure that out there there are better and worse people using LLMs, but I don't think you can really show mastery of using an LLM on stream. And I think that is at least one thing that makes um vibe coding inherently less interesting on you on on Twitch and stuff.
You sound like a story investing.
I don't remember what he was saying in that training.
Like, are you saying that I sound like him? Because I'm I'm making somewhat somehow the same arguments or like similar arguments uh than than his character. I don't even remember who is he in Death Training.
It's like he's something something man.
Oh, same voice. I see.
If you ever set up an image model, you would understand more. Yeah. Okay. So, if you make your own inference engine uh and uh from scratch. Yeah. And you you plop a model in there that you understand pretty well. I'm sure that you can get mastery at this point. Yeah.
You know what? Okay. That is a good point. Yes, that is a path that that leads you to mastery. Sure. I can totally believe it. But that's what no people that's not what people are doing on Twitch, right?
Uh the only person that I know that is doing this stuff, which to be clear, I'm not saying he's the only one on the planet. This is I I mean literally what I say. So uh the only person that I personally know of that is doing this kind of stuff is Antrez. I've seen Antz uh post on on Twitter and other social media about uh um doing this stuff. Uh what's it called?
Uh, Deep Space, Death Star, Dwarf Star, Dark Star. In any case, his thing is called DS4.
Uh, I'll go with Deep Space 4. I It's totally wrong, but I'll do a I'll make a Star Trek reference. So, when he wrote his own reference engine, I'm sure that he has gained uh in the process mastery of his own setup. Yeah, but but that's not what you see when people are VIP coding, right? they just um I don't know, they just pull the lever and they and then they hope that they get something good out.
And then on the other side, you have you have the you have Dario Amod telling him to pull harder and then you have the Nvidia guy telling him that if he doesn't pull the lever at least 250,000 times a year, he's going to go he's going to turn into an ape. Uh like the Invida guy says that he himself is going to turn into an ape when when he sees people not use uh enough LLMs.
Okay, so we have this uh scam day.
Nice.
Uh yeah, make GTA 7. No mistakes. Read the docs.
Or I guess they can get they can go even deeper. I I feel like that there are also some cases where you see people actually give out pretty complex prompts, but the prompt is not really going in depth. The prompt is just um I don't know how to say it, but it's the prompt is just not pointing at the important things. I don't know.
Uh okay. What the [ __ ] do we do with serialized field? God damn it. me and my own stupid goddamn abstractions.
So decentralized field Uh, I think I'm going to comment this out for now.
I'm going to comment this out and then we'll we'll look into it once uh we we see a type that implements this serialized field. By the way, I didn't add this here for fun. I have this strong suspicion that I am using this feature somewhere. So, we'll we'll see when the time comes, I guess.
Okay, let's go get rid of other stringly typed meta programming.
Oh, some more dialized field.
I need to remember that this bad boy is in multiple locations.
Okay, we're into test territory. Okay, so we should have updated all of this. I bet you that it's Zen that depends on that feature.
Unused capture FT type.
Oh, 5C6 720. Well, uh I guess this is the stuff that we just commented out.
5C6 Okay. And now we have the serializer to fix.
Um, okay. Give me a second. I'll take a very quick bathroom break and then and then I'm going to continue. Yeah. Yeah. On the eye stuff. Uh I I have one last rant and and then I I'll I'll do my rant once I come back.
I'll be right back.
Okay, I'm back. Uh, what was my rant? Uh my rant was uh uh I think my rant was just that I think it's important not in all context not not for everybody but for people who really like uh software engineering it is important to learn precisely the systems that you're dealing with so that you can be an expert. Uh and it's kind of what we were talking about before but now I'm not directing this comment at LLMs. I'm saying in software in general like here I'm I'm like looking at all the tiny details of how uh my APIs are going to end up looking like for users and how mechanically this whole uh serialization decentralization stuff works and that does make a difference and using it is easy to atrify this ability uh which takes a long time to learn like it takes a long time to get good at this stuff And second, as you are vibe coding, you lose the grip over this stuff. It's very easy to lose the grip over this stuff. So not only you're hurting yourself in the short term because the software that you're making today with the LLM unless you're very good is you will start losing control over the tiny details and but then in the long term that also will potentially have a bad impact on like um bad consequences on you um if you're not careful. So c can you use and still not not miss out on this stuff? I guess but you have to be careful. You need to be aware uh of this stuff. That's that's the end of it. Okay, let's go fix this ziggy options stuff in serializer.
Let's look at all these stringly stuff.
Well, it didn't take long to find the stringly stuff.
So considering that serializ one is recursive and uh and it is fairly simple. What I would say is um we can grab options out there and then do if options got serialized.
Maybe the copy pasting is not too bad.
also. We were falling through.
We're not returning.
Well, okay.
Does it support Android/ iOS build targets? Not too clear in the docs. I really like how Ghosty has a Zord then uses native GUI leaves for the looks.
Wonder if this can be done for mobile stuff. Uh yes, this can absolutely be done for mobile stuff without a doubt.
Um yes, Zigg does support Android and iOS.
um especially in this context with the idea that you're writing the business logic in Zigg and then OS integration is done in their own native ecosystems.
That part is totally absolutely well supported. Um if you want if you're trying to do everything in pure zig then you will find a bajillion blockers in front of you. So I would say that is technically doable but in practice not a thing. Um so yeah the ghosty approach totally works.
Um yeah that's it like uh for Android essentially especially the point is uh Android/ iOS you don't even care because what you want to do is not interoperate with the operating system if you can avoid it. Actually for iOS you can through Objective C. For Android I don't know how how that stuff works. In any case, you can you can at the very least for sure very easily compile for the ARM architecture that runs on on these uh devices and then have your let's call it native like the swift code, the cotling code, doio and other things at the very least. Uh you can probably push it a little bit further than that further than that. Um but in any case, yeah, it totally works. Uh my recommendation would be to if if you want like like something concrete I have I think a project for this although it's it's old so it's probably it doesn't compile out of the box I suspect uh most likely given given how much time has passed but I have this project called Zig Adventures on iOS. I wrote a I wrote a blog post about this.
Unfortunately, the blog post is not um is not up anymore, but it's essentially a Zift application that contains um it contains the Z code. You know what?
Maybe the wayback machine has it.
Let's see if it finds anything like this.
No, let's just do Z news.
H problem is how do we find my blog post in here?
For example, if I click on this one, will we see it?
Yes.
Can we go to the user page?
If we can go to the user page, then we can go to my page.
Okay, this is my page, I think.
Yes.
There we go.
Oh, I guess I can click on the first one and then Does do this link work? They do. Perfect.
So here you can read a little bit about how this stuff is supposed to work.
Unfortunately, I took down zig news a while ago. So um that's why I had to go through the way back machine.
Uh get options. Uh so Yeah, we're just falling through, man.
Like bozos in this implementation. Okay, you know what? This whole thing sucks.
Look at how you make it better.
Uh, the only way of making it better is by duplicating this. That sucks though because I was I was about to say or else. But with or else, uh, it doesn't work.
Yeah, I kind of wish I could do else.
The problem is that this else binds to the inner if and that the outer if remains without else. So, you don't want that.
This is essentially as good as it gets.
The problem is that this introduces an early return which we are not doing elsewhere by default. So we're kind of changing the rules a little bit. Also, this is doing try instead of returning.
We could change the tries to return.
So this way we make everything a return.
I think this is pretty good.
Now watch this. [ __ ] me over somehow.
Turn.
Okay, now I need to fix these guys down here. Well, actually here.
This is fine.
Okay.
Okay.
Uh, let's fix these guys.
It's literally the same thing multiple times.
depth does not increase.
Is it correct for depth to never increase?
I don't think that is correct. I think some where somehow depth should increase or maybe it's these other serialized functions that increase it as they recurse.
Okay. Uh let's see what happens as we go down the serializ. Okay. Yeah, that makes sense.
Okay. Have we introduced other errors in the meantime?
compiler++ dynamic test map plus union stringify must be of type ziggy options.
Oh um my tests are starting to fail. Okay, that is pretty good.
Here we have skip fields shenanigans has skip fields.
Yeah. Okay. We'll we'll look into this in a second.
Union.
Okay. Okay. And then we have a bunch of tests.
And in these tests and where we have types and some of these types are going to suck, I guess.
Maybe not. Maybe somewhere else.
Okay. Uh, let's do there's an in line for we can with a continue outer Okay.
uh actually um or else falls, I guess.
But we might as well grab the skip fields in here. So skip fields.
serializer test simple strct.
Okay. What is the problem with simple track man plus skip? Simple track plus skip.
dynamic test map.
Really?
Oh, right. It's dot and then the [ __ ] name. Uh, is it Union Stringify? Yeah, it's Union Stringify.
Okay.
Hey, what the [ __ ] happened with that dot?
Okay, there you go.
Okay, so we don't have test failures anymore. We only have the Oh, never mind.
We don't have test build errors anymore.
We have test runtime errors now.
Unexpected token.
Oh no.
in test basics man. Oh serializer d serializer [ __ ] What have I what have I done?
What have I regressed? The answer is everything.
[ __ ] everything.
Unexpected token basics.
Okay, this should not poop itself because the type has no meta programming [ __ ] So um I guess we should look at the parts where we modified the code.
So if get options and has the serialize then you will run the serialize and we return.
I guess the question is were we returning here or were we doing this and then doing something else? Maybe this was not a return.
Um man I wish I could see the the original version easily.
We were indeed returning.
So in theory this should have this should be semantically the same.
Then union case this should be semantically the same strct uh same story.
This also was always T and we are keep doing T. So, it's not like we are grabbing the wrong type by mistake.
And there's skip fields that has changed.
And this field has changed, but we're not using it.
So, Yeah. So, we were always doing this off of T, never on the field type. So, that is that should still be correct.
It should still be correct.
Oh [ __ ] This is definitely not correct.
My house branch. Wait a second. You cannot comment the house branch.
Well, found the mystery. The al branch cannot be commented out. Whoops.
Uh uh. Whoopsie.
Winding out the other branch. Very bad idea.
Okay, so we have a dynamic test basics that has failed.
That's fine. Dynamic test basics.
Oh, don't tell me.
Okay. So, it's not serialized field.
It's not the serialized field. What the [ __ ] Oh, no. But it might be that. It's just a different file.
H.
Okay, we're still in the dializer.
Are you saying that there are other instances of that thing that I have commented out? No. Okay, so there is something else going out of whack here which still has something to do with the changes that we made.
And the thing that we're looking at is here in basics dictionary.
So we are trying to dialize this into a dictionary and that is not working as intended.
But this should be fine.
This should be fine. Okay. Show the other ones more. Yes. It's just an unexpected token. So it means that something went wrong in the dialization process. Uh it means that I messed up um some code path. The question is whether we're doing it whether we messed up the specific dictionary implementation which has some of its own dialization code or whether we messed up um the general decalizer code. it h it's one of the two or both, but it is at least one of the two. That being said, even though this shows all new, I didn't really touch this guy.
I really didn't touch much this guy. I mostly moved things around. So, I have not really modified the implementation unless by mistake I nuked part of it. I don't know.
Um so I would say that it's more likely that this still has something to do here uh with this problem here. So here this here one switches switches on the typing info um union keys array vector it's the strct keys is where it seems that things are going out of whack and yet that is kind of what you do there.
No skip fields.
Is the faults correct?
Which false are we talking about?
defaults pass to this. Um, good question.
Def.
Oh [ __ ] Hey, you understand this code really well. It's almost uh it's almost as if you wrote some of it or most of it.
Yeah, good catch.
Copy paste is a dark and insidious uh something something killer right that's what dungeon um darkest dungeon was saying uh success so our tests uh pass again and we moved over we moved everything over to the new system uh what can I say I am delighted I'm definitely delighted with uh how this looks like.
So yeah, that is really nice.
The next step is um continue implementing the validation stuff.
which is boring. I don't really want to do that.
I think I want to do that in uh off stream. It requires me to I I actually know how to do it. It's just that it's tedious to get right.
So, I don't want really want to do it.
Um, we could make a comet here at this point and um and work on the language server autocomplete stuff.
That could be good. I think I need a pickme up.
Make a comment and see how much Zen is broken. Oh, well, dramatically. So, a lot of things have completely changed from the way they were the way they were before. Also, as I said, here's what I suspect field.
There is no serialized or decalized field mentioned in all of Zen.
Yo yo there is no d serialized field anywhere.
Yo that means that we can nuke that thing completely. We can nuke uh support for it or we could reintroduce it in the future as but but it it will have to have a different shape like it it needs to play nice with the type checking.
Huh.
Yeah. Okay. Let me go get a can of coke and then we can continue. I need the caffeine.
Huh.
Uh, so we're not doing bad. I I am I'm loving these new changes. This whole this whole uh work that I'm doing with Ziggy has really uh given me the opportunity to uh to get it to the next level.
There are some things. Hey, Turbo Fish project is ziggilang.io. Go there, see what it is, see if you like it or not.
That's the idea. So, I'm I'm really happy like this update this upgrade to options makes everything so much less brittle. Centralizes uh this check here and once this check here passes then everything else is done is handled by the compiler. We have a clear schema for the things that you can override and what the role is what they what they mean. Uh this root file also I find it delightful. A and tokenizer at the top for building trees, serializer and d serializer for going back and forth with types. Um a dynamic type, a dictionary type. Uh I think it would it would be nice also to have an array list type. Uh you know what, maybe that's what we can work on now. So the idea is a dictionary is a it's a string array hashmap that can um uh that can uh d serialize uh zigg dictionaries Please and um we could maybe make an array type with with sorry array list type which is a zig array list.
But um it's an array list but it knows how to serialize and decalize itself as a normal ziggy slice. The question though for that type would be what about the allocator?
Which allocator should that thing use?
The answer is the one that you pass into the D serialized function, but that is normally an arena. So that would mean that that array would put its data into the arena and you would have to keep using the arena, the provided arena to keep using it, which comes with pros and cons. Let's just say H.
But you know what? For flexibility, why not?
dynamic array.
There is this discussion that uh but okay so this is like a zig news um about uh a year ago maybe at this point. No, eight, nine months ago, seven, eight, nine months ago, I was having a discussion with Andrew and the rest of the core team, and we were discussing names for array list. Uh, we were all, I think, in agreement that naming that type a vector is a horrible idea.
A truly horrible idea.
Uh but uh but I think we there was also a good amount of agreement over about arist not being a good name for um well arist the reasoning being or at least this is my reasoning others did not share this sentiment but in in my personal case when I when I first heard array list I thought that arist was a segment sement mented list.
So segmented list is a type that works like this. It's an array for a bit and then instead of reallocating everything, it adds another chunk afterwards and then it keeps doing this.
So well that would be seven eight.
So it keeps doing this. This is a segmented list. Uh, do we still have it?
I think we don't anymore, do we?
Oh, I don't even have sd here to test.
Yeah, segmented list is goner. So, I thought that that was a narr. So my personal favorite name was dynamic array. To me what we call array list should be a dynamic array.
So maybe this should be renamed to dynamic value. I don't know.
In any case, for now we call it a radius.
Okay. Is it really singing hashmap?
Yes. Okay.
The rob since it's a list child class, right? for them is a an array list is a specialization of a list type.
I think that is a horrible idea.
I I I like man it feels weird to be so strongly opinionated about a choice that ultimately I don't know. Uh yeah. Yeah, it's an interface. Yeah, whatever. Um, like I I feel weirdly strongly opinionated about a choice that is ultimately not even that fundamental to the language, but I [ __ ] hate conflating arrays with lists. I really [ __ ] hate it. In C is even worse because through link you uh I think they call it link. I will keep calling it link until the day I die.
uh because they don't care about the branded name uh the branded pronunciation but that thing is essentially um map filter reduce on top of anything that has an interface that vaguely resembles a list. So they use uh and not only that it's not filter reduce that supports SQL style syntax.
So you you can write SQL queries like C the language C is speced so that a subset of it is this weirdo [ __ ] up SQL from scoring scores where score greater than 80 select score. Imagine having this stuff in your language so that you can have your own fanfiction of SQL.
It it this is only one syntax. It supports two different types of syntaxes. The other one is like more more normal. You you would do uh you would do score dot um Uh, you know what? I actually don't remember. I think you have to cast it to whatever the type you have. Yeah, you have to cast it to I innumerable. So, it's probably score as I innumerable dot select um where blah blah blah. Um, do they show the other syntax? No, of course. They only show the S syntax.
Okay. So this is the S syntax. Okay.
This is the normal syntax.
So some collection dot select.
Yeah.
But here's the problem.
You you run this [ __ ] uniformly over arrays, lists, SQL tables, MongoDB collections, um, elastic search collections. I'm sure there's some [ __ ] graph database out there, you know, a graph database where the shape of the data has nothing to do with this kind of stuff. And that database does offer a link interface.
And the problem is that you write this [ __ ] but the performance properties of what you're doing like whether you're filtering on an index, whether you're filtering or you know either an SQL index or because the the underlying data uh type is a is a hashmap or whether you're looping over or whether you're doing um you know what's it called? um binary search over a sorted list or whether you are doing a linear scan because there is no sorting.
Uh or there is sorting but then you don't know about it. Uh or whether you are like going over the network as you do this. Uh you just have no way of knowing because you have to look at the implementation of I innumerable of whatever curse thing you're calling it on.
Insane.
Absolutely insane.
Boy, am I happy to never have to look at that [ __ ] ever again in my life.
I'll get into carpentry before I go back to that.
Okay. So, how do we do this with an array list?
So, it needs to have a list. Uh, it needs to be generic.
Then so it needs to be um it needs to be generic. Um it needs to define its own serialization and deserialization uh routines. But I think that we should not be doing much because the in both cases we wanted the normal stuff to happen.
And in the case of uh des serialization once the normal stuff happens which means uh essentially um des serializing a um slice of te's then we just want to assign it to list like we we do init from um banana banana essentially. Okay.
Yeah. Actually, even giving it an empty thing. Uh, no, I think it's useful.
Or maybe um actually you know what maybe we don't even need for this. So if I leave it without default value, it means that you will have to choose it yourself which you can do by essentially giving it all the normal array list stuff. So yeah, that works for you. Like you can uh I'm saying essentially that you are expected to personalize this on your own.
Uh and then pop up Ziggy options.
Really? This does not select uh there.
What the [ __ ] like this. We also want child.
What does a real array list expose?
Not much. Okay.
Okay, maybe we can do that also here.
Okay.
So for serialize we want essentially to immediately do serialize one.
And we want to pass in value.list do items.
That's it.
That's literally it.
for serialization. For dialization of Okay, for this serialization we want cone items equals try D. D serialize one type or child type first is first top level is top level.
No, that is wrong.
It's a slice of child.
There's a const should be mutable.
And then we do this is not void.
Uh, no.
Eat it from slice.
Huh? Like this.
Yeah, array is kind of easy to implement.
results.
Wait, doesn't this serialize licky? Oh, no. The serialize licky. The one that doesn't require anything. Okay, it doesn't wrap anything.
How was this bar?
I don't know.
Dean promic zigg opens is wrong in our array. I bet you.
Yeah.
Forgot expected optional five pound bull. Oh [ __ ] Yeah.
Oh.
Um, there you go.
Hello. Hello.
One compilation error. No field named items in start list. Uh, you're right because it's list items.
Actually, it's just list. What am I saying?
There's no in it from own slice.
Um there's no init from own slice. Okay, let's take a look at the docs and see what am I missing.
Hi, I'm a teacher. I made a game on Steam called Colonies of the Ram. Could you take a look at my game? No, sorry.
I'm programming.
There is init buffer.
Oh, there we go. From own slice without in it in front of it.
And now we have a test failure.
unexpected value when DC serializing the serializ one dialized one.
This returns an expected value.
Out of curiosity, if I made this con, would you feel better?
Yeah. Okay, let's con cast.
I I don't plan to leave it like this.
I'm using this to fish out if I have some metro programming shenanigans going on. No.
we end up with the same situation.
Okay, so this is not it.
I think it's this.
I think the problem might be What if I do this?
80 pass one fail. [ __ ] Where's the test failure?
Oh no. Okay. Okay. Okay. Okay. Wait. So we we we're passing tests. Okay. All the tests are passing and the failure is the the diff command. it. Those are steps that are fading. Um, yeah. So, the problem is that an array of numbers doesn't correctly dialize into a U8. That's a It's a funky That's um there's um funky use case. So, it's fine if we haven't. Yeah. Else unexpected value.
Yeah. And actually there could be some optimization.
This is very unoptimized. The fact that we make an array list, we des serialize into the array list and then we return Yeah, if we were to reimplement all of this logic inside of the array itself, we could maybe save some uh pain. But um uh sorry, we could essentially make it a little bit more efficient, but it's fine.
It's fine.
Okay. Uh so we have implemented array.
Not bad.
Okay, so this is delightful. Hey, shoe boom. Shoe bum. Um, yeah, don't worry.
Uh, we're making good progress. So, I have overhauled how the metro programming works when it comes to types that specify how they want to be serialized and deserialized. I added a new special type that comes bundled with Ziggy so that you know you can use it for more convenient access to uh common operations. So for example, dictionary is a convenience wrapper around um the zig library hashmap.
And now I made the same for array list.
So far so good.
So far truly so good. Uh so this is all delightful.
I need to implement more seriously the type checking routines. I need to make progress on the LSP.
Frankly, once those two things are done, I think we will be in a good position for a release.
Is he like marshalling all the bites into the structure into the types?
Um this part here. Yes.
So there are two ways of approaching this.
One is you use a normal parser and you make an abstract syntax tree from your original document. you make an AS.
Then once you have an A on end, you can do whatever you want with it, including writing code that takes an A and maps it to your types. But even though you can do it, that is not the most efficient way of turning a document into a type intrinsic well into value. Uh for that there is D serializer. This serializer takes tokens without an a and puts these tokens into your types directly. So it immediately goes from bytes to your type without going through an a much more efficient. Uh there are some compromises there though. Well, first of all, this also gives you the opportunity to override the d serialization/ serialization behavior uh which can be cool.
Um, hey lad.
Um, just got the newest Zen set up. At the moment, it's only super HML that has a working LSP support, right? Uh, almost. If you So, uh, Super HTML has good LSP support. Yes. Make sure to name your templates HTML. If you forget the s, super HTML will think that they are normal HTML files and so it will not turn on super HTML logic.
Uh, and so you essentially will complain about stuff that is actually correct to do in a template. Uh, setting that aside, when it comes to other file formats, uh, Ziggy has a language server that you can in theory use.
uh you can lo you you can it can be used with markdown file well super markdown files but the problem is that um if you pull latest from Ziggy it's not going to be compatible at all with what Zen uses because Zen uses an older version of Ziggy where I in the meantime I made some syntax changes nothing too crazy but it's not a one to one so long story short at the moment yes you cannot use the Ziggy LSP with Zen at all uh Soon I will upstream well downstream all the changes that I made to main branch in in the Ziggy main branch. I will port everything to well I'll have Zen essentially depend on a newer version of Ziggy so you'll get all the goodies. At that point the language server should work again.
That being said, the Ziggy language server is well you get auto formatting I guess which is good to have but the what makes the what makes the language server useful is when you have a schema. So I need also to make sure that there is a there is a good system in place so that the schema can be placed in your website project and then that schema is implicitly picked up by the language server and used for your Ziggy files uh sorry for your super markdown files so that you can get also suggestions with doc strings and everything else um in your markdown files.
Um that is totally possible. The last I think issue with this system I believe has to do with um with I believe that there might be some limitations when it comes to VS Code specifically because I run the language server as a VS VS Code blob uh sorry is a web assembly blob in VS Code and I think that causes like there are some restrictions where basically we cannot look at files that we would need to be able to look at but that might be something that we can do something about.
When is fast testing going to be available on Windows?
That is a good question. I don't know precisely because I don't know what exactly is broken on Windows.
I can tell you in any case that fuzz testing uh as in uh the built-in fast testing in Zigg is currently not yet fully functional on other platforms either. So it's still a bit of a work in progress thing. Uh so it's not like Windows is being left behind compared to the rest.
Uh oh, you use Emacs. Okay. So, if you use Emacs, then you should be good. Um, in any case, yeah, so it's coming. Uh, be patient. I think in the future, you will not want to launch the Ziggy language server on Super Markdown files because you will want to have a language server for all of Super Markdown. That is not ready yet. I haven't even started work on that. So, that that will take a while before it comes. But, in the meantime, I So, it's kind of a temporary thing. I made it so that the Ziggy language server can also be used with markdown files. And essentially what the Ziggy thing does is it it only concerns itself with the front matter and then it leaves everything else untouched even when auto formatting.
But yeah, okay. So, because we don't really seem to depend on this feature, I'm nuking it completely.
And uh and I'm going to be happy.
Yeah. Also um I don't know how you're dealing with syntax highlighting on your end. Um I don't know. Sorry. I I hope it I hope it works out. I don't remember how things are with regards to Emacs uh and syntax and lighting of of all these file formats. Um I have three-seater grammarss.
I'm hoping to stream some super diggy stuff for Emacs. Yeah, that would be nice. Thank you. Because if I don't use the the editor, then you know I I don't have the ability to really guide people towards how to get a good setup. And um and I've always been accepting these from contributors essentially. Uh for Ziggy though, if you click on documentation, so be aware that Ziggy has its own website and I think there's a section about about editor configuration which covers also Emacs.
So go take a look see if you uh if you like it or not.
Do I say in in here?
Okay. I I get people on the official website from Zen. Do I tell people that the the website of Ziggy has information about how to do the setup or support?
Oh, here I don't tell you that there might be that there is information in the Ziggy website. Uh oh.
Oh [ __ ] Okay, I have a moment. I I'm having a bit of a um docs split brain because I have some docs that cover Ziggy. Also, what happened here? What is this dot here? Oh no, my table of contents is bored. Ignore that. Uh but I have a little bit of um of dogs here and a little bit of dogs there. Sorry.
Um yeah, in any case, super HTML should be it's the one thing that probably you need the most that you can guess the most utility out of and that one is is good to go. So just make sure that you have that at least uh okay. So I'm thinking that this might be a good time to commit for real and then switch to the language server.
Okay, let's quickly run through everything again.
Yeah, this don't make sense to me. Okay, GC over how meta programming interface introduce All right.
Um, Ziggy options is now typed.
See the comment for for more info.
Um, your snapshot tests fail on Windows.
Um, do you by any chance have the thing that adds uh carage returns when you check out files rather? Is it like like what is it that fails precisely? Um, anonymous track naming. God damn it.
Okay. Uh what are you working on? I am working on that is by the way that is uh curious.
Well, so if it is like this then it it only need means that the place where the test fails needs the type definition to be given a appropriate name. Uh I'm working on a um JSON alternative. Essentially it's a data serialization language called Ziggy. So if you go to zigg-lang.io You can take a look at what it offers wait.
Can you tell me which file this is?
So you're making a language. Yes, it's not a programming language. It's a data serialization language. So it's uh something simpler. Uh but it's it's essentially me trying to fix all the pet peeves that I have with uh with JSON stuff like trailing commas, lack of comments, um inexpressive data types, checker types. Okay.
Okay. So, you said that here.
Well, what?
So, here's the problem. None of these trucks uh None of these tracks should have a linebased name.
I don't know what's going on. I think uh I think this is the Z compiler.
It should not be us.
They all have different names.
Is this the right file? Could it be a different file? Maybe somewhere else I have an inline strct.
Nope. None of them. I don't know.
Is it related to Zig in any way? It is implemented in Zigg. It has syntax that is uh stolen from Zigg. So, a lot of syntax is really stolen from Zigg.
Root error 3 has arct. Oh my god. Am I blind?
So if that is the case, that is good because I am Am I blind? I'm [ __ ] I'm [ __ ] blind. Okay, thank you.
Um, okay.
So, let's rebuild snapshot tests.
Completion error.
What is going on?
Oh, did I not run test earlier? I did.
expected type consu 16 found consu eight.
Oh, you know what? I changed it and then I didn't run it again or something in the serializer.
Uh, no, it's in dynamic.
except the type consu 16 found8.
Oh yeah.
Was that Buzz? Now I'm curious.
Can we do an array list of U8? Will it work against a string?
Will Ziggy be a good fit for designing contracts and passing data around between Cabi and Swift Cotlin stuff?
I.e. instead of manually doing interfaces for every language uh infer them from Ziggy schema or something.
Wow, good question. Uh that is a use case that I did not think about when designing Ziggy.
I suspect that if you're trying to define interfaces, then you might want to have a concept of like, you know, what functions you can call on things.
Um, and then maybe a concept of error types that you kind of, you know, how zig zigg errors don't work in C, but you probably kind of want to keep the same semantics around. So probably I suspect something that is really a good fit for that would maybe have these concepts in it, which and none of that is part of Ziggy schema. Um at the same time, yeah, it's totally true that um 80% of that is in any case data like strct shapes essentially and list of arguments for factions.
I have no idea. I I'll I'll try to think about it because that is to be fair a use case that I that was just completely not on my radar at all. So maybe maybe there is something that could be done there. I would say don't hold your breath for that though. Let's work on the assumption that Ziggy is not for that.
Okay, so we can get push now.
Okay. So, a lot of good work went up.
And uh wait, did we did everything go well?
Wait a second. Are we failing tests?
No, we're not failing tests. Okay, so it means that we succeeded also at dializing the string with an array list of U8. That's fine.
Um, what do we want to do next?
Uh, do we have a new zig? Oh, we have a new egg. Oh, that is delightful.
Finally, man.
Finally.
Can we now start using this dig?
Seems that we can Okay, that's that's the light pool because that means that we can uh fix CI Okay, I've been with Roki for a while now because I was using a version of Zig um that was not um built yet, but now it was built.
After a long list of CI failures, we can finally get back on track.
Right.
Why is this called deploy? Why is this called deploy, man? It's not deploy.
It's CI.
Come on.
Okay, success. So, green CI, man.
Finally. Okay, the good news is that we can do the same also for all our other projects that keep having red CI, I think. So let's go to script.
Can we zig build? I think z build doesn't do anything. Can we see build test?
Yes.
Uh do HML first build.
Uh uh that is actually fine. Wait, this is a diff um something I haven't pushed.
Um uh right.
Um so how do we want to do this? Uh, okay. Is this good for building?
No. Uh, right there is no positional writer. I don't know. Position.
Oh god. What is the the other writer?
Oh, it's just writer. I keep forgetting the positional writer. It's just writer.
I keep I keep forgetting. God damn it.
Uh, except optional type file writer.
Oh, that one is not even an optional.
Okay, awesome. We should be good now.
Never mind. Latest famous words argument found two, right?
And now we build So the bridge is okay now.
Okay, we we're good. We are good. Uh, can we do actual dock test or do genen, whatever it's called.
There's no dogen in here. Okay, interesting. Um, okay. So the zone file.
Okay, perfect.
Why were we building two? Uh just see what?
Okay.
Okay, I was able to update all my webs, all my thingies. That is uh very nice.
That is very very very nice. Okay, so todos for Ziggy language server needs some love with auto completion.
Um, type schema compliance validator needs a ton of extra work.
Um, once these two things are in place, we can try to increase puzzing coverage a little bit. The schema checker cannot really easily be fuzzed unfortunately. That one will have to rely on uh real life usage and that's fine.
But everything else can be fuzzed more.
And most importantly, it can be fuzzed using a um Okay, there's a train honking real hard, but uh most importantly, it can be fast using a um a beef. essentially not just generating tokens completely sorry by completely on random but generating uh good tokens so that we can uh stress parsers more and tokenizers less because we stress our tokenizers already pretty well and uh we can trust them. They're good.
So yeah so yeah well uh I would say this is it for me. I think I'm going to stop here.
It's been a actually it's been a serious stream. 4 hour long. It's a Sunday. Not bad. I'm uh I'm happy with the progress.
The new serializ serialized stuff looks pretty good. Um yeah, two things and then we up stream to Zen. I would say maybe I should make also a build of Zen so that people can try it and uh see if they encounter errors because of the latest changes or not. I've been using it personally. All my websites seem plenty fine, but you know, we'll see. Uh anyway, thank you all for hanging out and I will see you next time. Let me see if there's anybody that I should raid that I No, I'm going to be lazy as usual, so I'm going to raid people only if I know them otherwise. Okay.
Yeah. You know what?
I'm just going to be lazy.
Related Videos
Walmart Manager Arrested After Stealing $670,000 - A Data Analyst 800 Miles Away Caught Him
bodycamsecretsyt
111 views•2026-06-09
This Machine Still Runs on Punch Cards 🤯📄 #youtubeshorts
WaltersShortsChannel
6K views•2026-06-10
GitLab’s Manav Khurana: AI Agents, Orbit, and the Future of Coding
TechVoices-live
374 views•2026-06-10
"What's the Difference Between a Class and an Object?"#class #programming #softwaredevelopment
CS-with-Alireza
349 views•2026-06-08
I Made an Antivirus That Secretly Attacks Scammers
ScammerPayback
153K views•2026-06-13
Leetcode Weekly Contest 506 | Life's boring these days
Pudeesht
2K views•2026-06-14
Why Your Computer FREEZES?
GreshamCollege
1K views•2026-06-09
Programming in English
MattGodbolt
584 views•2026-06-14











