When implementing pointer dereference in a compiler, the code generation must correctly handle the distinction between loading from a pointer and storing to a pointer. For an assignment like `*putter = 67`, the compiler should generate a load operation to read the current value from the pointer, followed by a store operation to write the new value, rather than generating only a load or only a store. This requires proper handling of the left-hand side of assignments to recognize when it's a pointer dereference and generate the appropriate sequence of memory operations.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
studying compilers every day until i land a compiler role (day 214)Added:
And we're live. Um, hello all, hello world. This is day 214 of studying compilers every day until I land a compiler rule. Um, I actually didn't plan anything yet. So, we're going to we're going to go figure that out right now. Um, yeah. So, if we scroll down, let's just zoom out. Actually, that will make things a little bit easier. Um, yeah. So, this is like the whole pile of stuff that we have left pretty much. And by left I mean like at least currently planned.
Um this in like soft priority order. Not really too too much. Um the big thing is we have this little stack here and that's kind of that's kind of like the upcoming slashcurren pile of things that I want to get done. Um and we're like slowly adding onto it and we're slowly popping off of it. So I think based on that I think what we should do is we should get df generating correctly. um or just like the one missing pointer operation that we've just never implemented for some reason. So let's let's do that. Um you may have noticed the description is like oh I don't know what I'm going to do. Um yeah this is this is what we're going to do today.
We're going to generate debuff. So yeah let's let's start let's start coding.
Um okay get status get branch.
Let's switch to main.
Let's pull. Yeah, because we made all the changes.
Yeah.
Okay.
Um, so let's make a new branch.
What do we call this? Uh, dufff, I guess.
Okay, we'll do that.
So, we have this fresh branch. We're going to we're going to start writing code. It's going to be great. Um, I think this is mostly front end work again, but I think it's it should be fine for the most part.
Um, h how do we how do we want to do how do we want to do this? Um, I think it's encompassed in expert, right? Or at least we we can parse it.
So, let's go back to our tests real quick. I think we should I think the best way to do this is to write a test first and then we can work with that test from here. So let's go to putter.
We have all this stuff.
Uh we want to we want to be able to like write to a pointer I guess is the big thing we're missing. int write to putter putter.
So we want what? Star putter equals.
Let's do that.
Uh yeah, that'll do.
So then if we or even if we just comment everything else out.
Um, okay. So, make build or we could just make I think I think we rebuilt it.
I guess we haven't rebuilt it. Um, it's going to fail the tests for that obviously because we just changed the test. So, that's going to be funny.
Uh, give it a second.
failed pre-process. Oh, does pre-process pre-process. Yeah, pre-process might import this as well. Yeah, so that might be why that's also failing. Um, okay.
So now if we just run panic, what the uh oh source enable.
There we go.
Let's give it putter.
Wait, that works. here. Wait, hold up.
Um, let's look at let's let's look at here.
There's another dash.
So, if we just look at what this vomits out right now, that is exactly good.
So, Empire is interesting, I think. Right.
Yeah. So, we don't we don't properly write to it. So, we need to we need to fix that.
Uh we need to replace the we need to make this a store pretty much.
Actually, just to make this interesting, let's do int double star putter putter.
We can do what? Putter putter equals 67. Sure.
Okay. Let's do that again.
Yeah. So, these are just loads, which is obviously not what we want. Uh, we want to replace the second load with a with just a store, I think, or at least that's how we want to implement it. So, I think it's just in lower because if we look at the a it parsed perfectly fine.
Yeah.
Um, yeah. So, let's let's do that.
Let's go to surfs. This is in 2m est 2.
Uh, it doesn't look like we need to move. So, we can clean that up as well.
Um, Yeah, we need to we need to figure out overloading at some point, but that's fine.
Uh, most of this looks fine.
Yeah. Okay. This is this is all like stuff we did last time. Okay. So we want to handle a specific operator again.
Duff.
Okay. This is this is going to be interesting. Or I guess assignment.
Maybe maybe we want to look at assignment or everything in here, right?
Um, yeah.
So, we need to change left, I think.
Or the way we handle left.
Yeah, we should do that up here then, I think.
Uh, where the hell did I go? Okay, here we are.
Um, yeah. So, we need to change this.
Or we could just generate an extra store. It wouldn't be that hard, I think, cuz we necessarily have to load on the op equals, right? I don't think you can directly increment a memory value at least in x86.
Oh, screen.
Uh, add to memory. Is this thing?
Yeah. Okay. So, okay. So, this this is a thing. Oh, yeah. I guess this is a thing. Okay. Yeah, that that makes complete sense.
Um h yeah. So what do we want to do with it then?
I guess we'd have to generate this as a store, right? Or h we don't have a good representation for this. Let's see what uh let's see what compiler explorer says this would turn into.
Uh I was looking at rust hell.
Um let's see.
Where am I? See, let's look at clang.
There we go.
Okay, that's all like preamble stuff.
Uh, okay.
Wait. So, oh interesting.
That's a very interesting way of generating it. Actually, I never I never thought about that.
Um, let's see.
Let's look at that.
Uh, wait. So, What's happening here? Okay, so this is just like local variable stuff. All the setup. Sure.
So these two lines are what we care about.
We load the putter. Okay. We get the pointer and we just store it in the pointer. Okay. So what happens if we do like that?
Oh, we just compute it and then we store. Okay. I mean, fair enough. Okay.
Um, okay.
So, I guess we could just generate an extra store and it would be fine. Like, yeah, that seems reasonable enough.
Yeah, right. Wait.
So for reference, let's do that again.
So we just we just have a load, I guess, which is not not quite what we want, I think.
It appears it appears we've done something wrong there.
Uh what's up, Lane? Um, good to see you having an episode of low energy. It happens. Don't worry about it. Um, yeah. I mean, like sometimes like you know yourself best, so I'm not going to like prescribe anything, but like sometimes it makes sense to like slow down a little. Sometimes it makes sense to just like push through it. Um, again, you know your situation better, so I will I will leave that to you at least.
Um, okay. So, I guess this just doesn't This is strange.
I guess we should just generate a store, maybe.
Wait.
Oh, zero.
Yeah. Okay, there we go. We have a better picture now.
This is much better.
So, we load.
What am I doing?
Jesus Christ. Okay.
Wow. This is awful.
Um, what am I doing?
So store those.
Okay. So we get that. We get Okay. So that's the Duff.
This store is wrong pretty much. I think this is I think we just need to change that store then, right?
What the [ __ ] am I doing here?
Wait, actually, what am I doing? This doesn't make any sense.
Okay, so this is the pointer.
So then we load from it. We We don't need a load there, I guess. So we need to change Oh man.
Okay, so what is happening here?
Okay, wait. Sorry. I'm going to I'm going to take a second before responding to chat. I got to figure I got to figure out what I'm doing. None of this makes sense.
Um, so load. We do this use preexpert thing for right. Okay.
But wait, what the Okay.
I don't know what what is happening here. Why is this generating like this?
This doesn't this doesn't make sense.
Okay, we're going to have to simplify the test real quick.
Uh let's see. Let's just clean up my harpoon real quick.
Uh let's go to putter. Icy.
Let's Yeah, let's do it that way.
Yeah. So, let's let's just do that for now.
Okay. Um, let's rerun this or with Oz.
Um, yeah. I mean, I I imagine I it sounds like you've got it figured out, so you will I I imagine you'll be fine.
Uh, what's up, Optimistic? What you're working on? I'm making a compiler from C to x8664 um with just a parser generator and C++.
Um, no LLVM because that's boring.
Uh, what's up, Ziku? Uh, yeah, I'm I'm still here. I'm still going somewhat strong as as strong as I can go here at least.
Yeah.
Okay, let's let's see.
So, we have that stuff. Sure.
So, this is all like preamble.
So this is we we get the pointer.
This is a read from the pointer.
Huh. Something seems okay. That's like fine. I guess we could just we could just load that and we can do like dead code elimination and call it a day.
That's like a future problem. We'll we'll worry about that later. Um let's see.
So then what is this store doing?
Oh, this is this is just like the dref.
Sure, that's like fine.
Um, yeah, we we need to we need to figure out a way to delete that.
And then we need to replace this store.
I think we should instead of using putter threeh this should just be into four I think right so the the correct way this little snippet should look this is like return stuff this is like preamble stuff. All of this is fine.
Yeah. So, let's see. So, this is Okay.
So, this we should delete.
This we should delete. And then this should be store i32 42 into putter 4. I think this seems this seems like what we want at least the behavior to be.
Yeah.
Yeah. Okay.
Uh got job and infrastructure networking support recently. Nice. That seems that seems like a very fun time. Um I imagine embedded/ like Linux would be a fun place to end. U it feels it feels very like it feels very at the heart of like systems. So that's that's like really cool. I think um H.
Oh, I see this is generated as like left I believe or this stuff is generated as left, right? Wait, is it What am I doing with Duff?
The [ __ ] Wait, what? No, this doesn't make any sense.
Oh, wait. No, this makes sense because we give it a pointer. So this is like the actual dref and then this is what the [ __ ] are we doing?
Ah, how do I trace this? Okay, we'll just let's see. I don't know.
Can I just do this just to see what happens?
Yeah, that's fine.
Okay. So, okay. Like, let's just delete these lines.
Okay. So, that necessarily just generates that assignment, which is fine. Um, huh. We might just have to like do two things. First, we need to modify assignment and second is we need to like check or we need to get left differently.
uh df slash bracket operator.
Yeah. So I think we should do it that way. And then and then the second thing is oh we also need to do that for opposign I think right um yeah okay that All right, that might be a little bit annoying.
So, let's let's compare these side by side at least.
So, regardless, we do a load.
Okay. But this one, we do actually want to like load from the thing.
Yeah.
Ah, that's really inconvenient. Uh, we still want to generate it differently though. I think left is giraffe.
Let's make a bull for that. So like E get left.
Oh man, what do we even want to dynamic cast it to?
What is it again? Like h uny.
Okay, let's just do like left exper.
I guess this is awful.
Well, we'll do this first. Let's figure out just like how we want to logic this out and then we can figure out what to do further down.
Um all right so left is df.
So that and last unop get op equals uh what's it again unary or what is it called?
God damn it. binary. Wait, what?
Am I in the right place?
Oh, right. Because it's a generic util. I need to rewrite that. Um, dref.
We'll just do that. That's so stupid.
Okay, so we have this now.
So if that then we want to do something.
Let's do that real quick.
Um okay. What do we put here now?
So we want left unop we want to get value.
So we want to accept on that first.
I should do this just for uniformity.
So that makes sense. And then uh so we get a pointer to the thing.
Yeah, I think that should be good actually, right? Is that all we need?
Yeah, that's really annoying cuz if it's a bracket operator, then we also make a mess, right?
I guess that's not really uny anymore.
Yeah, we need to figure that out.
We'll worry about that later. But I think we can kind of use similar logic.
We just got to like do another check.
Um, okay.
So, we get that and then um so that just avoids generating like the stuff above here, right? Yeah. So, we just avoid these types. I think we probably need to generate the I think we need to generate the types anyway.
I guess we kind of already know it's God damn it.
Why am I setting pointer type?
Oh, because it's okay. We're not actually like using the expression at least, right?
Yeah. So, this is fine.
We just don't go to the thing. We just keep the pointer, which is like fine, I think.
All right. Is that how we want to do this? Wait, I'm like getting lost in how I'm doing these temporaries. Okay.
All right. So, what other experts are generated here? Right.
What the?
Oh, this is just a load.
Okay, so that is the is it this? I think it's that. Yeah. And then we have the store. Okay. So, we we have those two that are generated above that we don't generate anymore.
Um, yeah, but the first one is still generated because we're reading from the thing.
Yeah. Okay. So, we just skip doing the dref stuff, which is fine.
Um, we'll just Yeah, we'll we'll leave this as is for now.
Yeah, we can. I don't think we need that to do anymore.
Uh, we can also clean this up as well.
So, we can do that. That's all good. Um, okay.
So, now we can we can do things, I guess.
Uh oh man. Okay. So, OPA sign.
So, we need to generate a load potentially, right?
What are we loading from?
No, this is fine, right? This should be fine.
So, this is that load.
All right. Is this all good?
And then, oh, do I ever Okay, this is all fine. I think that's so annoying.
Okay, we also want to let's just stick a to-do here as well, right? We need that anyway.
Oh man, this is this is terrible. What happens if we just do this? Um, that's not what I wanted to do. Let's do make Let's see how this changes.
We don't need that.
Why doesn't that change? Um, let's try that all again.
That's We don't need to run the tests.
Did I? Okay. Anyway, we're It's still the same. That's very odd.
Yeah, that should install.
That should not be up to date just by definition.
Let's just let's make a new terminal.
Okay, maybe I am just tripping. Maybe that is just the same. Then what? That doesn't make a lot of sense, but sure.
Have we really added anything substantive yet?
Let's try this.
We We We got to print. Oh my god. Are we dead ass?
Oh, duh.
Let's try that again.
Okay, so it's just not firing unless build s driver panic.
Okay, I am just I am just going insane then.
So e get left should be unry up.
Oh, wait.
Wait. What?
Is there some weird precedence thing going wrong there?
That might be what's happening now that I think about it.
Or I guess not even weird. This completely intentional I guess not. Okay. What the This should be firing, right?
See you up. That should be fine.
Yeah, we're just going to print debug cuz I'm lazy.
All right. Do that.
Wait.
Huh?
Do I just need to rebuild it? Like, it's just not firing at all.
What type is this? That's an expert star. So that should potentially cast, right?
Right. What a man.
I should be firing. Why isn't that firing?
Man, I wish my AS were more granular.
Oh, duh. Of course, it's not going to fire cuz I'm I'm a Chad anyway. Um, okay. That's That's really funny.
Wait, so why is Wait, why is that generating that then?
Oh, I see. Okay, that makes I guess that makes some sense.
H That store doesn't make sense in this context.
Oh, do you want to apply your skills to your own company? I thought about it. I don't really know if I could like make anything interesting though, so I think probably less. So, did I write? No, I did not. Wait, I did.
What?
Okay, so I just set false now. What the [ __ ] Wait, what the [ __ ] Okay, let's see.
469 H.
Why is that a sec fault?
We're not I guess maybe we're not passing it a pointer.
What is wrong here?
What's been just submitted for compilers? Hell yeah. Feeling good about it. I need water.
My average is 350. Nice. Uh what's what's the point of comparison again? Or like what are you what's the time to beat?
Oh, I see.
620. Damn.
Stay hydrated.
Yeah. Okay. It It seems like you're in a really good I I think you're in a good spot for that at least.
That That seems like a That seems solid at least.
What the [ __ ] Why is the SE What?
There's like no way this can seg this line.
Yeah, I mean like if they if they pull like ML out like they are doing insane stuff like or if they like rewrite ML from scratch then it's like I don't know that's that that would be a pretty cool thing to lose to I can't lie.
Why isn't this working though?
What if we did that and then we ran it?
Yeah. I I struggle to see a world where they um where anyone I guess beats your compiler. I think like I don't know.
It's It seems like it's been like really really exhaustive. So yeah.
What the [ __ ] Okay.
So we're the binary op.
But this is a line that literally should not be seging.
What's up blueberries?
Wait, but the other Wait, what?
But this one. Okay, that one definitely also said faults.
Why? This should not fault. This physically should not be psyching. I don't understand what's happening here.
Oh, lots of skills.
What the [ __ ] Prev expert is a like we just grab a pointer unless like the expert itself is unless the visitor itself is dead, which should not be happening.
What the [ __ ] Okay, let's I don't know. Let's get rid of that for now. See if it still works.
Right. Yeah, this should work. But incorrectly now.
Wait. Okay. What the [ __ ] Okay, we cannot be sealing right now.
What is this? Makes as zero sense.
Oh, dot. Okay, this No, that that does make sense actually now that I think about it.
Um, so we do that and then or if we just delete that at least that should work. Enjoying my lack of coursework. Hell yeah.
So the [ __ ] How? What?
I'm I'm baffled there. There's no way this is sack faulting.
Why? 469.
That's That's a comment.
This line is literally a comment.
Okay, something is wrong with my install or my install process.
I think I have an idea why.
Build install test. But wait, no. just okay wait no install is running let's uninstall or make disc clean.
Let's install.
I think there's something stupid with CMake that's going on or something with a dependence graph, but I'm too lazy to figure it out right now.
Okay, so now it stops segtting, which makes sense.
So you might just have to do this every time, which is very annoying.
That's fine.
Okay, so that's our pulse again. Okay, so we've gotten back to this.
So something is going wrong after this point, which makes little sense.
Um, yeah, that should be self-contained by like this stuff.
So, we necessarily just do this.
Oh, wait. Do we need to do use private expert?
Is that what's going on?
Well, no. This that's still a that's necessarily the address. So, this should be what we do with it.
All right. Yeah, we just we just store that for now. So, it should be fine.
Yeah, we just skip the dref. So that should be perfectly reasonable.
What the [ __ ] What the [ __ ] Okay, wait. Okay, let's 475.
All right, this here. Okay, that that makes a lot more sense.
That makes so much more sense. Okay, so we got to figure we got to fix this thing now. Um.
H.
Okay.
So, I guess we do kind of need some of this boiler plate, I guess, right?
H.
We could just make this a pointer type and call it a day alternatively.
Let's I think we just need to map it somewhere here.
This should be okay. So we are firing both of those so we can nuke these at least.
Okay. So, no, this should be okay.
Let's get rid of that.
Um, okay. So, we want left unop or left is expert.
Then we want let's put this in here. Actually, this will be really funny.
So if that's a DEF, then E or left unop get value otherwise it's that this is so dumb.
taking programming and DSA in Java. C programming and DSA. That makes a lot more sense.
That seems that seems very solid.
Okay, we have to make like that.
That's like faults.
Okay, we should probably update install real quick to clean properly. So, let's do that real quick.
So, we want rm RF installed or wait is that dangerous?
That might be dangerous.
Yeah, it should be fine if it's a protected directory.
H.
No, that doesn't make sense.
I think as long as we I don't know it should be safe surely or at least it's safe for this project.
Um or actually there's a there's a better way to do this. Let me find it real quick from a different project.
I just realized there's a little there's a list that install makes.
So, we can we can yank that instead to be to be safe. And that also gets rid of this little awkward thing as well.
So we want So we want Okay. So let's do cat XR or we want build slash install manifest txt, right? I think that's where it is. So it's in Well, we we cleaned it already. Damn it.
So well, that should exist at least.
Yeah. So we can force remove these in disc clean and that's like the safe way to do it.
Let's install.
Okay.
And that should be up here somewhere.
Okay, that's fine.
So now, yeah, so that leaves like a random floating installer, but if we go to install, it's uh yeah, it's like empty.
So that's fine. Um the reason we do that is because if we are installing to like user bin we don't want to like or if we're installing to like user we don't want to delete user right when we uninstall.
So this is like the safe way to do it.
So let's do that.
And then if we do that again.
Yeah. So that should just like reinstall all that every time pretty much, which is like good, I think.
Excited to finally wrap my head around DSA. Yeah, I think I think that unlocks a lot of doors at least. So it will it will be great.
Um, okay. So now we can look at this stuff. Oh my god, we're back to this.
Okay, what broke now?
Let's go to install.
Okay, so that exists.
That exists.
Okay.
Wait, what?
Maybe I just none of this makes sense. No, none of this [ __ ] makes sense anymore.
Let's just delete that. make install.
Let's just start again.
What the [ __ ] So now if we install what? Okay, so that's in lib 64 now, which doesn't make sense. It doesn't make any sense.
Why is it there?
What the [ __ ] Okay. Um, let's check our cm make list again. I feel like now we use the system. So, what the where the [ __ ] is our cm make list doing something insane? Our install is here.
I think all of these should just use the default directories. So why is it?
Why are we back in Cake? What is going on? Why do we keep ending up here? This should not This should not keep happening. Like why are we Oh, good. Um what's up, Mizerith? I think I think you can tell how things are going right now.
We should not we should not be in this hell right now.
CM make set install directories.
Yeah, we're we're back in Cake. God damn it.
Um, what makes DSA the most useful class?
Um, first it like it unlocks a bunch of like other classes just like prerec wise, but also like it's kind of foundational for like leak code leak code style interviews. I also think like it's really hard to like know what to do in like any sums of like honestly any higher level class without understanding like basic data structures, right? So, I also think it helps with like personal project design as well. Like you literally can just do everything afterwards.
I vibe code my CMake files. Yeah, that's that's reasonable.
I I've been doing that as well, but I got to I got to figure out what I'm doing.
Um, yeah. So, there's the built-in default.
So, why did it change? Why did it literally change overnight? What is What is wrong with this [ __ ] Ah, literally, what changed? Like, actually, what changed? I don't know what's happening.
TSPMO.
So if we make a new terminal make or make install Yeah, this goes to lib 64 for some reason.
And then our enable script. I guess we should we should just add lib 64 as well, right?
I guess that might be the easiest way to fix this stupid problem.
I think we should just do that. Like I I've had it with this this slop.
Yeah.
So, let's just do this.
64 64.
Yeah, it appears I've been cursed by the sem make the c make enjoyers.
Let's try this again.
I can't believe this is okay. So that's correct now.
So now panic should work. Okay.
Anyways, frustration aside, um, okay, been playing Forza 6 every day in coding or not coding. That's that's fair. I'm playing a lot of Battle Nations cuz it is like a double XP weekend. So, I gota I got to grind.
Um, it's also like a really good week for GTA if anyone plays that. So, yeah.
Um, okay. Let's get add make file.
Uh what did we change here? We fix or make cleaning installed dur safe and then add enable liv lib 64 pain.
Yeah, GTA6 is like it's supposedly around the corner, but like we all know what that really means. Not around the corner. Um, but GTA Online will also be around for like another couple of years until like they figure out what to do with it. So, I think if you wanted to like it's not a bad time to pick it up either.
Um, yeah, it's like a really good week to get started on it actually.
Okay, now we can get back to now we can get back to our daily scheduled panic panic.
Let's give it mit mir- z.
So now we can uh we can val grind that. We can look at the stack trace line 508.
Okay, we need to do this thing again.
This stupid thing again.
Um, okay.
Let's just keep this at the top here.
Um, so we want left type equals or I guess I don't know what do we even call this?
Yeah.
Yeah, we could just yank this actually.
Uh, or we take a ref there.
Left type. There we go.
And then we can use that here as well.
Uh, I've run out of time to put off my SQL quiz assignment. That's unlucky. You You got to do it.
Uh, Linux, Windows, or Mac? I'm on Windows, but Linux is my homie. My laptop is running Arch.
This is not my laptop.
Okay, there we go.
So now, um, okay, that's different.
That's not different. That's really irritating.
Why isn't it different? Oh, wait. No, this No, this is different.
Yeah. Okay. So, we get the pointer.
Oh, we're missing something here. We're missing a use of some sort.
So we want left is DF.
Um, okay. So we want I guess Wait, no, we do generate a use.
We necessarily do do that.
I guess we haven't Wait, have we done enough here?
I think we need to right. Wait, they're storing it into putter one.
That's wrong. That is just wrong.
So, we need to load.
Wait, but we generate the Wait, what?
Oh, we need to use Okay, I see. I see what we're missing.
Um, left is DF.
Then um so we want left or prev I think about that and then I think we want to do that or something like that. Is this insane?
This seems correct actually.
I think this is correct. I'm fairly sure.
Um, okay.
Yeah, that looks more correct. So, we we grab the pointer, restore. Yeah. So, we just Yeah, this is correct. This looks more correct now. Um, okay.
Switching to Casio. Oo, that seems fun.
I'm I've been going I've been thinking about switching to like Fedora, but like I don't care enough to switch. Um Arch has been like Arch has been surprisingly stable for me. Nothing is like completely broken, so I'm I'm pretty happy with it. Gen two is deranged for better or for worse. You are you're like you are a massochist if you enjoy Gen 2.
Oh, what's up?
uns skippable stream. I I appreciate it.
Um, okay. Let's add this back here and then let's regenerate that. Did I save? I think I did save just in case.
Okay, so we do all that. That's all preamble stuff. Okay, so that makes sense. This all looks about correct.
Yeah. Okay.
Yeah. Okay. I'm I'm pretty happy with this actually. I think this generates the code we want.
Um yeah. Okay. So now we need to do the OP assignment.
Star putter plus equals 42.
We can comment out the rest of this for now.
Yeah. So, you do that. It stores in Wait, hold up. Did it do this correctly?
No, we're missing a load. Okay. What theme is this? It's um it's slightly modified Tokyo Night.
Yeah. Okay. This looks more correct, I think. And then we should be good.
Yeah.
Right.
Wait.
Nah. This is this is not Capuin. I used to use Capuin Mocha and then I matured as a programmer and I decided that I did not like it anymore.
Okay.
So, we load from it and then we store back into five. Okay.
Right.
Is that correct?
Yeah, that is correct. That is correct.
This looks correct to me now.
Um, yeah. Okay, that seems this seems fine to me.
Um, yeah. Vin built-in color scheme.
Yeah, actually that's not even that terrible.
Yeah, it feels like I'm looking at a neon store. Neon sign store, but you know, it's like fine.
You know what? We'll we'll use this for a little bit. Actually, I think it's pretty funny.
Um, okay. Let's let's see what else I need to clean up here. The git gutter is really broken on this, which is really funny, as we see on the left here.
Okay.
Yeah, we'll we'll use this for like another 20 seconds while I try to sort through this.
Um, I think this is fine. I think this is fine.
Yeah, this is all good.
This is kind of just inevitable.
Um, yeah, I think this is probably just like the the least awful way to go about this.
Yeah, we kind we kind of have to do this.
Um yeah, but we need to like maintain this stuff because or in the event that we have like uh what's it called?
Oh, actually we always set it right. Wait, do we always set it to left expert first? No, we don't. Okay, well that's fine then, I guess.
Um, I was thinking we could pull this line out and do a little bit of a little bit of code hoisting. I think I forgot what it is called.
Code motion broadly.
Um, oh yeah, my my themes are on my pass. I think there's a command for it.
If if this exists, then it'll be great.
If not, then I just look like an idiot, and that's fine. Um, VS Code on Linux is a choice.
Okay. Yeah, that does work.
But yeah, um I think the rest of this is fine.
Yeah, this seems correct.
Yeah. Okay.
Um, figure type inference out. That's fine. I guess we could delete this.
Um, we can just rename left type as well. This name doesn't really make sense. Oh god.
Uh raw type or source type. I don't know.
We'll do that. I don't know. That makes enough sense to me. We can get rid of IO stream. Okay. This this theme is getting old. Uh let's see. Oh god.
Um, let's see. What were what were we all talking about? Luna perch and tor.
Oh, that's actually not bad. It still feels like I'm in a neon sign store.
Um, I used like night fox for a while or was it night fox? Terra Fox.
Carbon Fox. This one. Yeah, this one was nice. I liked this one.
Yeah, I think I I imagine it's Yeah, the the default Vim themes historically, at least as far as I remember, they're very bright. So, um, it's I I don't think it I don't think it comes from my terminal either.
So, I think they are just that bright by default.
Yeah, I like this theme. I think it's I think it's cute.
Um, okay. So, we do generate these tests correctly now, I think.
So, rmutter.star.
Okay. So now we can make uh install.
Let's do test regression generate regression tests. Let's see if this breaks anything. Oh, god damn it. I forgot.
Um yeah, let's get rid of that. We have to uncomment all this stuff now.
There we go. That's not format either.
Okay.
Oh, yeah. That still fails the test because we need to regenerate the damn tests. Okay.
Switch to zed. Interesting. I've actually never like I I never looked that much into Zet. I've heard of it though. It seems It seems fine. I don't really I don't know. Maybe I just don't have an opinion on it, but like you know like it seems sufficiently fine.
Okay.
So that now make test just so it actually passes those tests and then we can check the test diff and it'll be really cool.
Maybe I should have done like pre-commit tests now. That might have been smart actually, huh?
I can still do them actually. I can do some like get stash shenanigans now that I think about it. Um, if it runs all of these then like I'll be happy though.
Okay, cool. So, get status.
Um, okay. Here's what we're going to do. Get stash source.
Uh, can we just h get add test regression?
Yeah, let's do that.
Add df test or we'll do that or we'll we'll commit over this. Now we can stash make install and then we can regenerate.
Uh what desktop environment? Um I'm using hyperland.
Uh you don't use lazy git. Um I've never really understood the re like the utility of like tuy or like guey git apps. I've always found command line is generally sufficient. I also haven't done any like insane like merge conflicts though. So like maybe there's like some utility in that or if I need to like rewrite history by hand. But like yeah.
Okay. So let's add this.
Let's rename this pre-commit test.
Okay. So now get stash pop and then get add or let's check the diff.
Wait, seriously? Is that it?
Oh, that's really annoying.
Okay. So then let's look at So if this is Okay. So this is fine.
So now we can uh make install.
I haven't bothered switching to telling manage window manager. That's that's really funny actually. I've I've never heard like I use my terminal so much that it just doesn't matter.
That's like that's very Chad though.
That's That's like hella respect actually.
Okay, let's regenerate and then we should be big chilling.
And then we can also update the other test as well which will be cool. Um the what's it called? The runtime library test.
using gnome with no tailing manager.
Wow.
I guess like if it works it works.
Um I there's one big thing for tiling manager. Um oh right like if you need to like split screen I guess like alt tab is fine but like I like having split screen sometimes. It's it's pretty useful. Also like desktops are useful and like if you're going to go through the work to set up binds for that, you may as well just install a tiling manager.
So here we um handle L value df properly.
Yeah, we need to What is this branch called again? Dref. Okay, there we go.
All right, let's let's keep it let's keep it going.
Uh, let me respond to someone real quick.
Uh, Sorry, >> this is taking a second.
All right. Anyways, sorry about that.
Um, let me scroll back up. Had to type up a storm. Uh, can I ask a question? Go for it.
Yeah, I like having two monitors cuz like I don't know. There's like some things that like would be really bad to like I guess like if streaming like two monitors is kind of necessary cuz like it's nice just to have like one big working monitor but also like a separate monitor for like OBS up.
Uh how do you spot bad AI generated code? Um, I think I'm trying to think of a good example, I guess.
Um, like if you think about like good versus bad writing, right? Like they will both they will both like do or both match the intent, right? Like if you tell a person to like write a story about like something and an AI to like write a story about something like it'll well write a story about the thing. Um but the difference is like in the detail, right? So a human might like might think more consciously about like the plot whereas like the AI might be like sort of shallow with it, right? So in that sense like in terms of code if you ask someone to like write some some code versus like an AI they will both write the thing. It's just the way the person would do it would look very very different. Um generally bad AI code has like uh is very heavily duplic is like very very duplicative or it has like uh like poor coding style I guess broadly speaking both in terms of like both in terms of like naming conventions or like uh like like lots of like band-aid fixes. Um, not that like human generated code doesn't do that, but like it's it's more intrinsically a property of AI generated code rather than like human generated code. Um, generally speaking, just like I'm not sure how much programming experience you have, but if you have programming experience, I think like if you read the code and you you're like, what is this doing? Or like why didn't it just do X and you're like very confident that like X would have been better, then that like that is how you spot it. Um, if you don't have a lot of programming experience, I don't really know how else to like I don't really know how else to like describe it, I guess, unfortunately.
Hopefully that like kind of answers the question. I hope like if not like feel free to ask follow-ups and I will do my best to resolve them.
Um, okay. Let's let's check the poll request because I'm curious.
Let's go here.
Pull request.
Um, yeah. So, we can do that. Let's make a draft PR.
So, if we look at this commit, I think it's this one.
Yeah, this one. So, this will change a lot of tests as well. And we can see the difference. That's not very helpful. Um, split. There we go. Much better.
Uh, not really much better, actually.
That's really annoying. Oh well.
Uh, let's see. Where do we look? Um, how do I consume enough code to know good from bad? Um, oh man.
Yeah, this is it's really difficult to like find a good concrete place or method to do this because like there's just so much AI generated code now. Um I think there's a lot of like this is definitely like very h okay I guess the number one thing you should do is just write more code. I think by writing bad code you'll be like this code sucks and then like you will turn it into better code and over time you'll like learn those sorts of patterns. Um if you've heard of the term like code smell um like this is like exactly what that is, right? Like if like you'll write enough bad code to the point where it would be like h like this type of code like kind of stinks. Like if you have like 30 different temporary variables then like maybe we're doing something wrong. or like if we have a variable named like an entire sentence, then you'll be like maybe this is not like a normal human thing to do. Um, yeah, I think that's probably like the best way to do it. Um, if you really really want to like spend a lot of energy on this, which I don't necessarily recommend, but if you want to, um, I think there are like plenty of resources in terms of like videos or in terms of books about like code style or like clean code. Um, I guess we could I guess we could go on a clean code tangent. Uh, clean code.
Yeah. Uh, this book, Uncle Bob, our beloved. Um, he has a lot of thoughts on what makes code clean. Some of them I agree with, like we should use meaningful names or like we should write self-documenting code and use few comments. Some of some things I don't really agree with, like this whole functions thing. I think sometimes it's like necessary to keep them to have large functions, but like um this book is like a fun read. Everyone like kind of likes it for some reason or at least everyone like people either love the book or they hate the book, but they love having an opinion about the book.
So, it's like it's like a fun read. I think it's I think it's at least like worth a read. Um, yeah, as everyone else is echoing the sentiment of, I guess, having more experience, I think that will necessarily be the best. Uh, but yeah, this is a good resource. I think there's plenty of fun YouTube videos as well.
Uh, three laws of readable code.
Yeah, this one is fun. I like this one as well. Um, it's by Canten Coding. I'm not going to play this on stream so I don't get nuked. But yeah, this is a fun video.
Um, yeah, you can just look it up. Yeah, I think that should be like sufficient for at least immediate stuff. Uh, what's up, Glover? Good to see you. It's been a second.
Um, is your normal theme Tokyo Night Storm or Light? I don't actually remember. Let's see. Um, it lives in my NeoVim config somewhere.
Theme. Yeah. Okay. It's based off night.
Um, these are the changes I've made to it cuz it's it was annoying me.
So, keywords aren't italicized. We changed the get colors.
Um, and then I changed the parenthesis highlight color because that was annoying me.
I want to be proud of writing my code independently without AI. Yeah, I think Oh my god, what the hell? Okay. Um, yeah, I think I think that's a pretty fun goal to strive towards. Um, at the end of the day, like AI is still a tool. I don't think writing code was ever the hard part. It's more like designing systems that has always been difficult. So, as long as you learn that, who cares if you use AI or not? Um but at the same time organic organically written code is always like really fun.
Like this project is very very largely organic. We might have used a little bit of GMO but yeah um a function should do one thing and nothing else. Um not necessarily. Um, the way Uncle Bob explained it is the functions are like there is like a ceiling on how large they should be.
Like I think the ceiling is like what 50 lines or something like that. Even less I think it it was like really really small. But like um the way that it's I guess I like kind of take inspiration with from it in some places. So like if we go to middle or if we go to back end for instance um a good example would be like regal lock this function here like this would be an example of a function that like you would call very readable cuz all these helper functions they exist um in their own little place even if like we only use them once um they're necessarily very self-documenting so you can like kind of read through the code and it's like like you know exactly what each line does. Um but if we look inside these like individual functions. So like if we look inside the livveness function um this is a little bit larger and uncle Bob would not be happy with this size.
Um I think he would want like maybe like this to be one function and then like this to be one function or maybe even like two functions and then all of that gets wrapped by this one big function. Um, he likes really really small functions that you can like traverse easily, I guess. Um, I disagree with that.
Okay. Um, I got really sidetracked um by my own valition. Um, was I going to do I was going to update the test, right? Um the which test runtime library I look for starfu equals or wait.
Yeah. So starfu equals 67.
Cringe starfu.
Yeah, we can do that.
Um, so if we do panic test regression input, let's give it runtime library and then we run a.out.
What the [ __ ] Huh?
What have we done?
So, it prints, but it doesn't free.
That's strange.
Uh, yeah, that's not supposed to happen. Um, okay. So, if we undo all of this, does it work still?
Okay, so that works fine.
Okay, so that still works fine.
Okay, so something goes wrong when we print. That's That's very strange.
That's That's very strange.
Um, the gem I discovered upon stumbling upon your live. I appreciate it. I appreciate it a lot.
Yeah, system design and architecture and design patterns I think kind of encompass a lot else of just like the practical side of computer science. I think I think that's a pretty good span.
Why does why does this print break it now? I got to figure that out. That doesn't make any sense.
Is there some like random calling convention thing that is causing issues?
That doesn't make a lot of sense.
Okay, let's do that. And then we can debug this either now or next time. The brightness of the room has been slowly dimming. Yeah. Um, it was bright out before. It is no longer bright out.
Sorry, we're playing with someone again.
Um, okay.
Yeah. W dim.
Okay.
So, what changed in the assembly?
Most of this should still be about the same, right?
01 changed a little bit.
Oh, wait. The stack. Wait, the stack frame is strange.
Something has gone very wrong, right? Wait, what the [ __ ] Why is that?
Okay, that makes no sense.
A lot of this doesn't make sense at least.
So, what happens if I move the print in between here instead without doing anything there?
Okay, so that's fine.
Riding tofu was fine, huh?
Maybe it is actually the way I'm generating dref. Maybe that's wrong.
Maybe that's causing the issues actually now that I think about it.
We'll just do this first.
We'll just leave it as that. And then let's go to front end.
I guess the middle end for this is wrong, right? at least.
So if we go to expected runtime library, let's go to MI there was some like really strange stuff happening or at least h or at least when we were generating pointer let's add more test to putter. I think I think that's the best way to do this.
Uh let's just do staru or we could just do like Yeah, we should look at those more closely. I think I think there's something wrong with that. Let's go to putter o00 mir.
So duff we have a pointer.
We store it in one.
So you load from that. Load from that.
We store that result into a buffer.
Yeah. So that should be fine.
Yeah, that should all be fine.
It looked really strange at least as a standalone.
Okay, I understand why I did it that way now. This makes sense.
So then the middle one for that should be fine. For the runtime library should be fine, right?
Or maybe it's just like something to do with mixing code.
Okay, let's let's just regenerate real quick.
Uh while we're waiting for this, um if you haven't already, you should join the Discord. It's linked in the description.
Um, one of our regulars, um, his name is Scottish. It is his birthday today. So, you should join and you should go say happy birthday to him real quick. He's he's a very enjoyable person to have around the community. So, we want I want to I want to make sure he has a good birthday.
Okay. Um, let's see. Let's look at this now.
All right. So, we call.
Yeah, I guess that's fine.
Second harpoon. Okay, there we go.
All right. No, we're in here. There we go. So, that line lines up with these lines.
So this is what am I doing here?
Sure. This sure.
Yeah. His his name is literally just Scottish.
Okay. So that makes sense. Here we do this.
Store that in three.
Wait, what the [ __ ] Well, I think we I think we found a problem. That seems wrong.
All right. No, that's correct. No, that's not No, that's correct. Yeah, cuz three itself is that. Okay. Okay.
See, load from that. We give it 11.
Store the result in four. Yeah, sure. That's fine.
Um, okay. And then let's see what else.
So then we load Yeah, that makes sense. Okay.
Right.
No. What am I giving this? Wait, what?
H is SSA like messing something up here?
Yeah, something has gone wrong here with this assignment.
Um, oh wait, no, this lives in one. So, we load from one and then we deal that.
That should be fine.
And then we store that in five for whatever reason.
Yeah. Okay, that's like fine, I guess.
Um, yeah, I want to do some dead code elimination at some point. No, I think that would be interesting.
Um, maybe it's working on 0 but breaking on 01.
Interesting. Wait, that might that might be it. Okay.
Yeah. Okay. So, we got to figure out what's going wrong in 01, though.
Uh, something seems wrong here.
Something seems very wrong here.
This should be fine, though. Wait.
Okay. Wait. So, we So, we have that. We store that into there.
Then we load from the pointer. We print that and then we delock that. That should be fine.
This should be this should be perfectly fine.
So something is breaking further on it later on I think.
Yeah. Huh.
This looks so funny.
What the hell?
Why is there like stack frame stuff happening here? Wait.
Oh, we're save. Okay, I see. We're We're saving stuff. Okay, sure.
Yeah. Okay, that sure. Yeah. Okay, cool.
Um, something goes wrong here, I think, at least.
Jesus Christ, this is awful. This code sucks. This code really sucks. Um, okay.
Let's do that.
Wait, this should be fine. This looks like it should be perfectly fine. I don't know why it's breaking.
What the [ __ ] Okay. Anyway, um H.
Yeah, this looks like it should be correct.
Yeah. So, we have R11. R11's the pointer. So we store six seven in it.
We load that into R10D and we put in EDI and we call print.
That's fine. That's perfectly fine.
What? This should be working. This literally should be working.
Okay. And then we just like burn R10D, which is fine.
Okay. So, we then we grab R11 and we call Dalllock.
That should be fine. Why is this Why is this breaking anyway? Ah, god damn it.
And then we do more shuffling and then Okay, this should be fine. This literally should run fine. I don't know why this is breaking.
This makes zero sense.
Maybe I need to like save registers, but it's main go B.
This uses this uses register so we don't have to save [ __ ] Okay. Well, I think this is fine.
Um, I'll do that.
And then just for good measure, let's just check tests. Um, if this all is good, then I think we will just call it a stream.
It looks good so far. So, I think I think we will pretty much call it a stream. Um, thank you all so much for showing up today. Um, if you haven't already, like the stream, sub to the channel. Um, if you're new, you should especially sub. Uh, while you're down there, check out the description. My LinkedIn, Discord, GitHub, and GitHub sponsors in some order are all down there. Um, join the Discord to stay connected. Add me on the other platforms if you want to see what I'm doing. Um, and if you want to give me money, do so on GitHub sponsors. Um, yeah, I completely jumbled that outro, but hopefully I'll hopefully I'll get it.
Um, I'm going to go eat a second dinner now because I'm big and greedy. Um, take care. Take it easy, and I will see you all tomorrow.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Introduction to Problem Solving Part - 1 | Lecture 1 | Intermediate DSA
ascensionix
107 views•2026-05-29
So What's Odin Lang Even Good For
TechOverTea
131 views•2026-06-01











