Two's Complement - Lightning Round
Episode Date: October 11, 2026Ben gives his house to an AI named after GLaDOS, and Matt makes the compiler build a Z80. A dying USB dock threatens to end it all....
Transcript
Discussion (0)
I'm Matt Godbolt.
And I'm Ben Radie.
And this is Toos Compliment, a programming podcast.
Hey, Ben.
Hey, Matt.
We are in some kind of catastrophic situation where my computer keeps crashing,
or rather my Caldigit docking station keeps dying with USB.
So this may never go out.
So I'm talking to you.
And then maybe this is the only time this will ever be heard.
So what are we going to talk about today?
I think we could do some discussions of some personal projects that we've been kind of kicking around with Claude.
I have two.
It's almost like I almost want to feel like we're doing these in like lightning talk format.
Okay, let's do that.
Because I may disappear at any time.
Right.
So we're like reducing the scope of each iteration so that like if one fails, then we can just, we've at least committed.
This is a redundant array of inexpensive.
podcasts. Podcasts.
That has a terrible acronym.
Let's not say that one outlined.
Don't think about it.
Okay.
Oh, tell me about one.
I've got several on the desk next to me.
So you go first.
Yeah, yeah.
Yeah.
So a few years ago, me and my oldest child were exploring our basement, let's just say.
And we are like, oh, here's the control panel for the Brink security system that was
installed in our house when it was built, you know, 20 years ago, whatever, which is now obviously
totally useless because we don't pay for Brink security. However, looking at this control panel,
this does not seem as complicated as one might think. I think these things are just switches.
And maybe it's a little more complicated with motion sensors because they require power, but surely
we can figure this out. And this was switches as in like network switches, switches here, or
or switches as in literally up and down the buttons.
Like when the door is closed, the circuit is closed,
and when the door is open, the circuit is open.
Oh.
Right?
And the default state is closed so that you know the system's working, right?
Oh, I see.
Yeah, yeah, yeah.
Okay.
Yeah.
Right.
So an actual switch except, you know, yeah, right, as you described.
Okay.
Yes.
And, you know, this was like, obviously there was AI and other tools back then,
but it wasn't quite as prevalent.
So we did a little digging and we're like, okay, yeah.
No, we figured this out.
It's not that hard.
The doors and the windows are just,
a circuit. It's just a switch. And when it's closed, that means that the device is closed. And when it's
open, that means it's open. And it fails open. So you know, the alarm goes off. Something is wrong.
And then the motion sensors are the same thing, but also require 12 volt power. Okay. So if you give them
12 volt power, you let them kind of warm up for a second. They will then close indicating that there's no
motion. And then if they see motion, they will open back up again. The circuit will open. Right.
Okay. And that is the extent of the part that is wired into the house.
These motion sensors are like the little things you see up in the corner of rooms that are essentially infrared light.
I think it's an infrared light and then a kind of clever clever reflector, yeah, a photo receiver that notices when things move in some way or something.
I don't know.
Yeah.
I've watched a YouTube video that was very impressive and then it's immediately forgotten.
But yeah, okay.
So, but it looks like a switch is what you're saying.
Right, right.
If you give a 12-0 power, it acts like a switch.
Like it just goes on and off.
I have questions about that because if you.
give it 12 volts, it needs to have a zero volts for it to flow through. So where does,
are they like two? Well, there's additional leads. Yeah, it's not, with those things, it's not
just two wires. Actually, also, interestingly, all of these things use cat five cable. It's just
that only two of the cables matter for most of them. But the other ones, there's two additional ones that
carry the 12-volt power for the things. And I have a feeling there might be other things too.
Is that the same as POE or is that different again?
I don't think it is POE.
No, okay, right.
But obviously it also uses Cat 5.
Right.
Like I think the electricians just wired it with Cat 5 because they're like,
we're running these cables when I was well use Cat 5.
Anyway, right.
All low power, so who cares.
So this is what we did two years ago.
And so Kit was very much like, we need to name this thing Glados from Portal.
So we built this whole.
We built an Arduino circuit that interacts with all of these switches and replaces the Brinks
circuit board that was there.
We wired it into a Mac Mini that we have that's sitting in the same utility closet.
We wrote a little Python app using Async I.O that talks to the Arduino over serial connection
and serves up a web interface that controls the, you know, that has like the layout of the house
and shows all the zones.
And we went in with like SVG and like mapped out all the zones and where all the,
the windows and doors and all the, you know, motion sensors cover and all of that.
And there's like an event log and like all this stuff.
And it was super cool.
Wow.
And we did this as a project.
Yeah, it was like two years ago.
And then like it was, I don't know, three or four weeks ago, maybe a couple months ago,
stopped working.
And I went and investigated.
And I'm like, well, obviously, I'm not going to do this myself.
So step number one in this investigation is get Claude running as like a system D service
that will automatically restart in case I screw something up.
So now I've got Claude running on this machine.
Not Claude running as a system D service, but Claude setting up a system D service to keep the thing running.
Is that what you were saying?
Well, no, actually it was both.
So I basically wanted to make sure that I could always remote into this thing.
and even if it rebooted or restarted or anything else went wrong.
So I'm like, and of course I'm telling Claude to do this,
but it's like, yeah, I made a system D service that runs T-Mux,
that runs Claude, and then that has remote control enabled,
so I can go and connect to it.
And obviously, I can SSH into this machine too.
It's not like I can only access to the remote control.
But now you can be out walking the dog.
Exactly.
And I can talk in my phone and be like, hey, Claude, can you make Glados do this thing?
And it's like, yeah, sure, fine.
It's kind of scarcely, you know, how commoditized that has become so easy.
I'm used to it.
And yet, yeah, so many questions, so many flaws.
But anyway, carry on with your.
And the fact that you called it Gladys doesn't really help the whole argument.
And that was getting to the punchline of this whole lightning talk is, I don't know if it's a good idea to have an LLM in charge of a system that was like, you know, designed to be malevolent and evil and just, you know, torture humanity.
with experiments. But that's what I'm doing. So, okay, fine. But the, the, the, my, I did this.
I'm like, all right, well, what's going wrong? And of course, it just diagnoses the issue and
says, oh, the Arduino's gone bad. You need to replace it. And I'm like, okay, fine, I'll flash it.
And then it handles like, updating the firmware. And I'm like, all right, cool. That was like super easy.
Let's connect it to the sum pump. So I took a picture of the sum pump label. And it's like,
oh, yeah, there's an RJ-11 connector that you get. I'm going to give you the Amazon
link. You can order all these parts. It's actually going to be real.
simple. The listener can't see that I've just got my mouth wide open. It's just ordering parts.
You're just, what do they call it meat pipe for Claude now? Yes. Yep. I mean, uh, meat proxy.
Meat proxy. And I'm like, yeah, that sounds great. And, uh, you know, again, the sun pump actually
just like, acts like another on off switch. It's almost like this was intended to be wired into
security systems in the same way. It's like, yeah, that makes total sense. So I get the simple
RJ-11 cable, plug it in, snip a couple wires and wire it into the Arduino. And now I have,
the sun pump support. I was like, okay, cool, that was great. I've got a UPS, universal power
supply that's also connected to all these things. It keeps my internet running when the power goes out.
Uninterruptible? Uninterruptible power supply. Did I say you? He interrupted you. No, you said
universal. And I couldn't miss the opportunity to interrupt you to tell you that you'd say it
wrong. You know, it's almost like I could have done that on purpose. On purpose.
If only the other people have made no effort to organize this ahead of time because you would you would think anyway yeah so yes so I have this the UPS that is the battery backup for the Mac mini that for you know router and the cable modem and everything else and it's got a a USB port on it and I'm not assuming that was for control and I'm like so I take a picture of the power supply and it figures out the model number and it downloads the specs and everything else it's like oh yeah no you can just plug it
USB, you know, USB cable into the back of this thing and then plug that into the MacMany.
And then I've got it from there. And then it's like, yeah, cool, great. And now I'm like monitoring
my household power through the UPS through NUT, which is the Linux package that you use to
monitor these types of devices. And I've got a new page on...
What is the, what is, is the whole house on the UPS or is it just like critical liquid?
Yeah, I was going to say, because I had one downstairs until it ran out of power,
the battery died, the lead acid battery
and I only had a computer plugged into it.
And even then, it would only power the computer for like
30 seconds while it shut down.
Right, right.
But it did monitor it. It would tell me, oh, by the way,
there had been a power event, which, you know,
is useful to know.
Yes, yes.
And now I've got it sending alerts to me.
I mean, I had the alerts before.
Like the whole burglar alarm system,
we wired into pushover,
which is a super cool.
Oh, yeah.
Not an ad, but I like pushover a lot for these kinds of notifications.
Yeah, yeah, I forgot about that.
Yeah.
So push over notifications for like if the power goes out, it's like, yeah, and it can monitor the battery levels and be like, you know, you've got 30 minutes left. You've got 15 minutes left. Whatever. Do you want, you know, and then I can like tell it to remotely shut down the computer to save power so that we can preserve the internet access if we need to, you know, keep the Wi-Fi running, but we don't want to necessarily have the computer running. And so, and all of this is basically just me like randomly sending messages to, you know, close.
in the middle of the day being like, yeah, do this,
and then order this thing and do whatever.
It's actually pretty impossible.
Now, I can't think how this could go wrong.
You know, you've wired a malevolent AI,
given it a license by calling it that,
and then you've given it access to your power, internet,
and remote door controls.
Right, right.
And so, like, all it's going to take is for this instance of Claude
to accidentally scrape some portal lore about
what Glados is and how it should behave for it to like in.
It knows already.
It's already in the training set, dude.
I mean, oh, you're in trouble.
You know, this is, this is what we're.
And then the next thing I'm going to do is connect to my garage.
Automatic repeating rifle behind you that you've got
and some kind of tripod thing with an orange light in the middle.
Is that, you know, sentry turret, you know,
just wire that directly into the burglar alarm.
You know, it's just air soft.
it's fine, you know.
It's not going to kill anybody yet.
Oh, man.
The laser turrets.
Where are you going?
What's next with this?
Yeah, so the next step is I'm going to hook it up to my garage because I want to be
able to tell if my garage door is open or closed.
And then the next thing after that is that I want to do that is like this.
Right.
The listener did not see, but I craned my head out of the window.
Look out the window.
We have this nasty habit of leaving our garage door open and then going somewhere.
And then we've done this enough to be paranoid about it.
And so there's this thing of like, did I remember to close the garage door?
And then it's like, so step number one is I got a security camera that is rated for cold temperatures because, you know, where I'm in Chicago and even it's, though it's a garage, it's not an attached garage.
I think it's cold.
So I got a security camera that is like local network only.
Yeah.
Rated for cold temperatures.
And I'm going to put that in the garage.
and then I'm going to teach Glados how to do image recognition to tell whether or not the garage door is open or closed.
Because I also want the pictures.
But, you know, and I could just, and I might still just hook up like a sensor to the garage door to tell whether it's open and closed.
I mean, that would seem simpler.
It is.
This is not about simpler.
This is about like how much complexity can I throw into this thing by just typing words into a robot and just see what happens.
And so that's, that's going to.
is pretty much everything.
Yeah.
Turns out you can just throw whatever you want in there.
So that's my,
that's my quick lightning talk on how I'm empowering a malevolent AI to destroy my family.
Yeah.
I can't top that, Ben.
We should have finished with that one.
That was,
that's kind of it now.
I think we're 12 minutes into the recording or,
yeah.
Yeah,
no,
I mean,
you know what I've been up to recently.
Well,
I've been doing a whole bunch of things.
I've forever got Compiler Explorer on the back burner,
and I'm trying to find ways to lighten my burden in terms of like the boring,
automatable or semi-automatable work, you know,
reviewing some poor requests which are almost wrote or, you know,
servicing requests like can you add compiler X?
It's just like GCC only slightly different.
And there's a lot of things that, again, AI can automate most of that stuff.
But the thing that I'm having the most difficulty with on that is,
as I think all of us are who are trying to use this in a in a principled way,
is trying to find the right amount to use because it's really,
it's really convenient to walk the dog and say,
okay,
Claude,
agent,
whatever,
yeah,
just review these 10 PRs from random people if they look good to you,
merge them in.
But then those 10 people are like,
did,
did somebody look at this properly?
Am I,
as a human,
am I valued,
is my contribution valued.
And I want to make them feel like I looked at them and not,
I got my robot little lap dog to go and do it for me.
Even though that's kind of, you know, maybe.
So yeah, trying to find the balance there is really difficult for me.
I definitely do want people to feel valued.
But on the other hand, I have very, very finite time.
And the pull request list just grows and the number of issues grow.
And ultimately, most people on the site just want to have the compilers there and have it work and all that.
And so I'm going to try and find that thing.
That's a difficult multi-dimensional optimization for me to do personally.
Certainly, making it amenable to other people also using AIs to do some of the work.
So I can say to them, look, if you have Claude or Codex or whatever, then just point them at this dock and do it.
And it's human reader also, so you could use this as well.
But realistically speaking, you don't have to babysit four different PRs.
I can do that.
So that's one part.
The other part is one of my emulators, which I've been like going great guns on.
I've been doing a whole bunch of work behind the scenes, tarting up and doing all the to-dos and going through the massive issue backlog of like, hey, wouldn't it be cool ifs for my BBC microemulator, which has been a ton of fun.
And, yeah, most recently I've been updating the way that it processes input.
So it's running in a web browser and you're playing like 1980s absolutely unfair Twitch games that are like, dead.
Oh, you didn't jump on the right frame.
Okay, fine.
And I want to be able to replicate those.
But, you know, there's kind of a lot of things going on between the keyboard.
You know, there's classic Google question, like what happens when you press a key,
is only exacerbated by, you know, when you're running an emulator in a web browser,
right?
How far is it between you pressing the button on the keyboard and it actually take an effect
and you then seeing it?
So there's like two different latences there.
There's key press to logic of.
the game latency. And then there is latency from logic of the game and it presenting to you.
And there are two parts to that. There's the physical like screen based view. And there are obviously
you know, there's graphics and there's double buffering. And there's also post processing to try
and make it up like a telly and all that kind of stuff as well as like, you know, just the actual
like emulation part, which is actually the easiest part of all of this. Then there's also the audio.
And a lot of stuff goes off audio cues. And then you've got this really fine line between.
between if I have a massive two-second buffer, then I will never, ever drop and you won't
hear a horrible click in the middle of like playback.
But it's two seconds behind.
So now you're like, oh, it feels like I'm disconnected.
There are some things that you can take advantage of here.
I haven't implemented all of these yet, but there's some cool tricks.
So one thing you can do is, you know, multi-threading of a sort.
The audio workers can live in a separate thread.
And then what I used to do is like send messages to the audio worker saying,
here's another thousand and 224 samples, play these out and, you know,
keep a small ring buffer ahead of you and try and keep this minimal.
You know, try and try and not get so far ahead that it's backed up and not so far behind
that it drains ever in the sort of time slices that we've got.
But it then occurred to me that that's not how I'm gesturing wildly to the desk,
which you can't, it's just out of shot for Ben and definitely out of shot for you, the listener.
The BBC Micro on my desk here, that's not how.
this works, what you do is you send across the bus values to registers that are on a chip.
And that chip just keeps making that noise until you tell it not to. And so what I can do
is I can now send not the sort of synthesized buffers, but I actually send the commands
along with timestamps about when in the virtual stream of events that these happen.
And now I synthesize the entire audio stream as if it was like a separate component,
as indeed it is, it's just a bunch of counters and flip flops, right?
It's all the stupid sound chip is and a noise chip.
And so that means that if you do alt-tab away from the BBC,
it no longer goes pop, clack, crack, and like break up with the sound audio.
It just keeps making the same noise, just as if you, like, left it plugged in.
Now, that's not perfect.
You know, if you're doing one of these, like, sampled speech things,
where, you know, the CPU is running at full blast,
just changing the volume up and down as fast as it can
to sort of try and make it like a sample,
and then you walk to have away.
Obviously, you actually hear the weird noise
that it would make if it wasn't doing that all the time.
But for the rest of the time,
it means you've got this really buttery smooth audio frame
that is like really tight to current time.
And then if it does drop,
instead of having a really hideous noise,
you just carry on with the same noise.
And most of the time you can't tell the difference
because, you know, the CPU wasn't, in fact,
changing the audio at that point in time.
Now, I can't quite do that with the video.
But what you can do is you can play a bit of fun and games by running ahead or allowing the video, the presented frame.
And then if you know that you're like two frames ahead, if somebody hits a key or any other external stimulus, you can backdate those.
Oh, okay.
So you just go back two frames to the state that you kept.
Is this like branch prediction but for?
Yeah.
Yeah.
You predict that nothing, I mean, in this instance, you predict that everything continues the same.
But if you discover that it doesn't, then you can go back to frames and go, oh, actually, the ZD key was down.
Yeah, yeah.
Now run forward two frames or three frames now by the time you've caught up.
And then it's not perfect because you will see those two frames that were like wrong.
And, you know, like Twitch game people will go, oh, whatever.
But if you've just missed a jump, you'd probably prefer to see one or two frames of the character having fallen off in it, followed by the character that jumping.
It looks a bit too good to be true.
I haven't fully implemented that.
I have got the rewind capability,
so I can't just rewind time and just play back.
So that's what I usually do when I miss a jump.
I feel like you get that in like fighting games and brawling games too,
where it's like with the animations at least.
It's like, oh no, actually the user pressed this key
and this was blocked.
So you get the first couple of animations of the hit landing,
but then it backs up.
And definitely in network games where there's a bit of prediction
as to what's going on.
And before it finds out,
oh, no, actually that it just snaps to a new.
position. So there's some cool things
there. So do you have another, that's my
five minute segment over. I've got one more after this, but
we can certainly... I got a quick, I got a quick question, actually. I'm kind of
embarrassed that I've never asked you this before, given your affinity for
for emulated games and stuff.
But I remember from my youth
playing games on, you know, the Sega Genesis
and the Nintendo of Commodore 64
and all these other games. And
there would be this phenomena where when the, you know, usually it was like the end fight was getting super intense.
And the game clearly never expected to have this many sprites on the screen at the same time.
The game would slow down.
And, you know, eight-year-old me thought this was just the game giving me a break because it's hard to navigate all the little whirly bits on the screen.
And it just got a little slower.
But, you know, obviously now I realize that it's like, no, they just, that loop just took too long.
And now the game is slowing down.
Is there anything special that you need to do to accommodate that fact in an emulator, or does it just naturally happen?
It 100% falls out naturally. Yeah.
What's typically happening behind the scenes is the game is processing as much as it can, and then it will wait for the next V-blank before it flips the page.
And it's not like modern games where you're always measuring the time because you may be on 100 hertz monitor or 120-hertz monitor or your CPU's faster or your CPU's faster or slower.
whatever, you've got all this variability. So you kind of, there is no how many frames per second
is, it is just running, free running as fast as it can and dealing with the fact that time is,
is variable each time. On these machines, it's like, well, no, it's the main power supply comes
in 50 hertz. The TV runs at 50 hertz. Therefore, the obvious thing to do is to lock everything to
how many frames at 50 hertz. And that's your timing, looks like constant. And so if you just like,
take slightly more than 50 hertz, then now you take two frames, and now you're running at 25 frames a
second or 12 and a half or whatever it is.
And now suddenly it's a bit chuggy.
So I don't have to do anything special for that.
Now, there's some arguments that say that maybe if you can, as an emulator writer,
if you can detect where the idle at the end, you know, waiting for the next frame is going
to be, assuming the game does nothing other than sit there waiting for an interrupt to come
in or something like that, you could actually run the game turbo, turbo speed up to the point
and then sync.
Yeah.
And now you suddenly don't slow down anymore at the end of those in those games.
It runs at the same speed because, you know, your computer is effectively infinitely fast now.
Right.
It's just like I get a frames worth of game in every frame.
But then there's so many other things that go wrong when you start doing stuff like that.
As you know, all the clever timing for changing colors halfway down the screen,
that the ruster is coming out and starts to go wrong.
But, you know, yeah.
So, no, it comes for free if you're emulating authentically at the speed of the computer.
But, you know, that's also, that's its own.
There are levels of accuracy there where you can just say, well, roughly, it's a two megahertz.
So, you know, we just do this many instructions on average.
Or you go, no, no, each cycle of every instruction is actually measured at the correct time.
So the bus right happens at the third cycle of the instruction, all that kind of stuff, which is lots of fun.
Okay, cool.
All right.
Well, there's my tangent.
What do you got next?
Oh, I got me.
All right.
I thought you had another one.
I got another one.
I mean, it's actually related to this in a way.
In fact, segues in naturally.
So I'm off to CPPCon next week.
Yes, in fact, Sunday.
Oh, gosh.
So I'll listen and now we're knows when we're recording these things
and we're about to put another one out.
So, yeah, confusing.
I've got a couple of presentations there,
but then all focuses on October
where I have a presentation at C++ under the C
where I have to present and it's announced now
a new version of my spectrum amniation.
And in fact, I'm wearing my spectrum.
It's a shame we don't record the videos for these.
I know it's just too much of a pain.
We'd have to actually make an effort of our appearance.
But Ben is wearing a Chicago Bears cap for everyone there.
And I am wearing a ZDX Spectrum t-shirt.
So that's kind of tells you everything you to know about the pair of us, really.
Anyway, I have to update my Spectrum emulator, my C++ Spectrum emulator,
because that's what I said I'm going to talk about.
And the way that I want to update this is to use some of the latest C++-26 tricks.
So we've talked to, I think, about reflection.
Did we talk about reflection before?
I'm having a moment of like, you know, deja vu here.
Reflecting on it, I believe we did.
Yes.
Ha-ha.
Touch, sir.
Excellent.
But reflection is all about, you know, statically understanding what the shape of objects look like.
And C++ gives us some tools to do that now in C++ is 26, which is fantastic.
And at compile time, we can do some magic.
But one of the things that we can do with that is that we can take something we found using reflection, say like the field of a class or the enum of an element of an enum.
Yeah, an element in an enumeration, something like that.
And we've got like some kind of like thing object.
It's called a meta info.
We get at this thing.
And then we can kind of turn it into a human readable string, which means hallelujah, we can finally enumerate all of the enums in an enum and go, you know, build for, in.
in C++, a automatic turn the case into a string of that, each number value into the string
of it, which, you know, it's like the one only use for reflection. That's not true. Obviously,
serialisation, deserialisation, it's useful to go over all of the elements of a structure,
a vector, and print out debug information, all that good stuff. But it occurred to me that you
can use this for evil as well. And so my talk is about how to take an abstract description
of a CPU in its own language, what I invented,
which is essentially a bunch of bitmasks that say,
op codes matching this bit mask need to do things that look like this.
And so the op code list itself is like, you know,
zero one X, X, Y, Y, and where the X's and Y's are are standings for any bit,
the value there, but I want to be able to do something with the X's and Y's.
I can declare what X's stand for and what Y's stand for,
So I get to up to 26 different things I can describe using this format.
You can't get uppercase and lowercase with that.
I could probably do that as well.
Yeah.
But that allows me.
And then I can write what the disassembly looks like of that.
And I can map that, you know, X's look at index into this list of things.
And this is all like in my own language, my own DSL.
Mm-hmm.
And, you know, normally that would be the input to something like a Python program that would then churn out a massive, you know, switch statement in C++.
It would print it out to stand it out.
You'd write it to a file.
You'd compile it and then you'd offer it to erase it.
And that's kind of how you built these things.
But I realized that I can use the two new things.
The hash embed, which allows me to like hash include a file as like a blob into the code base.
So I can do char, you know, char my CPU description equals open quotes.
Or no, no, it's actually open squiggles.
And then next line.
hash embed the file, close squiggly quotes.
And it's like as if it just like put the sequence of like 65 comma 67, you know,
for like A and C, whatever, blah.
And then what reflection gives me is ability to run things at compile time in a
constival block that are just like, just do this now.
Like literally as the compiler is reading through the source code, it hits a constable
block and it's like, oh, I have to run this code now.
And I can do things like, hey, open part.
that string, that is, break it into the instructions,
and now I can build a table of instructions that look like that.
And there's some other tricks as well that go with it
in terms of like I can do name look up and stuff like that.
But effectively, I can build the engine for a Z80
from an abstract description of a Z80
all in the compiler as it's compiling the code the first time.
It takes ages.
I'm not going to say.
The cool thing about this is it's a very, very, very systematic way
of describing a CPU.
and like things like how long each cycle takes.
And, yeah, of course, I still have to have to have code that says this is how numbers get added together.
This is the ALU.
But like most ALUs have like, well, here's this eight operations of an ALU.
And of course, they are indexed by one of those XX, Y, Y or P, or Q, whatever.
You say, like, no, I just want to look up the function, which is here's a table of the names of ALU zero is add ALTU2, is subtract, whatever.
And so it falls out pretty naturally.
And in a couple of hundred lines of this C, sorry, a couple of hundred lines of this Z80 description, the entire Z80 with all of its undefined op codes, all of its multi-byte op codes, all of its weird edge cases just naturally fall out.
And it's beautiful.
I love it.
And it takes ages to compile.
But it is the most efficient Z80 emulated that I have written yet.
This is the fourth iteration in the same code base of this.
And so I'm excited to present it to people and hopefully blow people's minds about like, but I'm still on the fence about whether this is a good idea.
You know, all great ideas like this.
Start out with like, is this genius or terrible?
And I'm like, I'm so preoccupied whether or not you could that you shouldn't, you didn't think about whether you should, right?
That's, yeah.
And that's kind of part of the idea of it.
You know, everyone that I've spoken to is excited about reflection because of the actual reflecty bits.
And I'm excited because it gives me a new power.
and a new thing that I can do that I couldn't do before,
which is unrelated to looking at structures.
So that's another side project.
And yeah, that one has, I'll be honest,
I have used AI to help me here.
It's like, it's my idea.
I've been through the code myself a number of times.
I'm going to have to go through it one more time.
But a lot of it was me fleshing out stuff and then saying,
like, can you just finish this off, please?
And here's like all of the difficult op codes, but I don't want to have to write all of the
intermediate ones.
Can you just fill this in for me?
And getting some feedback and refactoring and whatever.
So I've felt like morally, you know, I think we talked about this before about the things
are fun.
I've had a ton of fun discovering this.
And I'm still a little bit like it is mine.
It's my idea.
I can explain it to you.
I know how it's working.
But it feels a little bit like, but I got my friendly robot intern to do it.
So it doesn't feel quite as mine as that.
But I'm hoping over the next month as I'm.
I research it more of and present it to people.
It feels more like it's code that I wrote.
But that's going to be an interesting part.
And I'm wondering whether or not I should add the section in the talk about this.
As it's, I think, going to be forefront of everyone's mind.
He's, you know, like programming is, as we've discussed, you know, something we love doing.
And, you know, most of the time, though, we're doing it for a job.
And certainly in a conference, I'm presenting it in the context of, hey, most of us here are being paid to do this.
So, you know, it's what our employer employers want us to do.
but there is a bit of like, but I like it.
And so I think that's going to be an interesting,
hopefully a bit of human interest for it too.
What else you got?
What else you got?
Or questions or one more that I could probably talk about
is a follow up to the Gladys thing where it's like,
you know, once I was like,
all right,
I'm going to take a picture of the sun pump
and then Claude's going to figure out what it is.
I can take a picture of the interruptible power supply.
and then figure out what it is, is I'm like, oh, well, I could just do this with everything.
So I'm just going to do this with everything.
So I started going around my house, taking pictures of all my appliances and the labels
on the side of the appliances.
And I was like, get all the user manuals for all these things, figure out what maintenance they
need and then tell me when I need to maintain these things.
Like, oh, there's like anode rod that's in your water heater that no one ever remembers
to replace.
And it's like, you need to replace that every two years.
And I'll set a reminder and tell you when you,
and you replace it. It's like, oh, great. And I'm like solely building open claw essentially by doing
this. No, but I think that, yeah. Yeah. Yeah. And I'm just like wandering around my house being like,
oh, microwave, dishwasher, refrigerator, washing machine. Like, yeah, I don't, I've never given a second
thought to any of these things. And now I suddenly care by proxy. Yeah. I think that's it, right?
You know, some of this, you know, people were saying, uh, is, uh, is AI a benefit? And I'm like,
Well, it got me excited about a whole bunch of stuff that I'd left lingering for a long time.
So maybe for that alone, it seems like maybe an expensive thing to justify that.
But, you know, I kind of, I definitely did.
Yeah, similarly, my open claw equivalent thing is messaging me every day, wishing my wife
for happy birthday on my behalf for me and reminding, you know, I'm like, no, no, just tell me what's
going on in my diary.
You don't have to like editorialize that much.
But it's convenient and useful and it kind of nags me, hey, you said you check in on this
friend.
And I'm like, oh, yeah, I did.
So, you know, it hopefully, you know, helps.
Of course, I could do this with calendar apps.
You could do this with, and ultimately, and I was raging about this on not Twitter,
whatever, Mastodon thing, Blue Sky the other day.
Like, I came home and I said, the magic was the wake my listening device,
which is by a big web search company.
And the reason I'm saying these is so that it doesn't do it now in the background.
Right. And I say, wake up words, play some music.
And it's been working forever.
I just come home and say that.
And it came back and it said playing.
And then I can't quite, I tweeted what it was.
But like, it played something that wasn't what I said even slightly.
And I'm like, what?
And I said, no, play some music.
And it says, playing the playlist, some music.
I don't know.
It says something else in between, which is even more crazy.
And the last one was a playlist called Some Music, which someone has clearly put in just for me.
Yeah.
The third song of which, incidentally, was Rick Aslis, never going to give you up.
So I felt like completely owned that.
I listened to me.
It was like, this is all right, actually.
But I'm like, Google, for the love of God, I give you, I'm an unapologetic.
Well, no, I'm apologetic.
I'm apologetic Google fanboy.
I used to work though.
I like the company or I liked the company.
I've stuck with them through thick and thin.
And it doesn't make any sense that I do still.
But they have all the information about me.
They have every photograph I've ever taken.
They know every person that's in them that is related to me so I can kind of send people.
But lovely things like this.
Synergy is between these departments.
And they have somewhat decent AI.
Some of my best friends work for their AI company.
And yet, here I am in a room filled with their sodding devices.
And it can't answer a simple question about anything.
Yeah.
Ah!
I mean, like, I want that to work.
Why does it not just work?
Why is it so hard?
Why is it so hard?
Yeah.
Yeah, I used to have a competing device, you know, created by an online bookseller.
Oh, right, yeah.
And I, in a fit of rage one day because I started like asking me all kinds of irrelevant questions
and giving me a notification that I couldn't figure out how to him.
It's like, no, all you guys are going in the trash today.
And I just walked around the house, picked them all up and threw them in the trash.
And yeah, that was fun while it was new and kind of interesting and sort of worked.
And now I'm just like, get the hell out of my house.
And I'm warming to your thought, I mean, okay, with the massive, massive asterisk of Claude is very much online and outside at the moment.
Yeah.
You're building a lot of the infrastructure inside your house.
And people have talked about home assistant.
They were applied to my tweet and said, you know, have you considered our lord and say.
I've gone down the rabbit hole of home assistant a couple of times now, actually.
Right.
So I could see that being a cool set of projects.
But, yeah, the thing about it is I just want it to work.
and I don't want to have to tinker with it all of the time.
And for the most part, the little devices were that.
They just did what I needed them to do, which is very, very little.
Mainly, you know, activate music and to stop playing music.
And it integrates well with YouTube music, which I got forced onto after Google music, whatever,
more things to not like about the coming.
Yeah, but maybe I should go down that route.
I mean, one of the things, and I'm doing this with all the appliances,
and stuff is I'm keeping it real dumb.
You know, we've talked in this podcast before about the power of files,
and I'm just like everything I'm having Claude do,
it's just storing as marked down files on a server that is, you know,
the Mac Mini that is connected to, you know, the super powerful malevolent AI, whatever.
I'm sure it'll be fine.
But it's all just files.
And so, like, in a future world where it's not Claude,
it's some open weight model that I'm running on my own hardware.
It works essentially the same, right?
It's how a reasonably sensible personal assistant would have created
a directory structure and file structure and mostly well written.
Yeah.
No, exactly.
That is a really weird thing that's of the democratization of data that might markdown
files represent compared to like some vendor lock-in database file.
Open now.
But like, you know, it's like there was a period of time where it's like, you know,
it's like you couldn't get anything out of there.
It was pain in the butt.
Yeah.
Yeah, no, for real.
Yeah.
Yeah.
All right.
I've got one last thing because we're actually remarkably,
despite us having no idea what we're going to talk about,
knock on wood, my, my,
my little Caldigit has...
Don't knock on the Cal Digit.
I'm not, yeah.
But yeah, next to me, just out a shot is my BBC Master in pieces
and my latest proud purchase, which is an oscilloscope.
I've long coveted everyone else having like an oscilloscope in their background and whatever,
and now I have one on my desk.
It's so much fun to play with and such, you know, silly things.
And I've been looking at stuff like the noise, the capacitors on this,
because it's very old, and a lot of them are dried out.
They don't work anymore, but it works well enough.
The power is ripply.
The TV output, for example, is actually rubbish.
If I plug in the RF cable on my, I just get a picture that rolls almost.
And it's because I think either the capacitors have gone or the modulator is dead.
And I've got a spare modulator, but I want to prove to myself which one it is first before I,
yeah, yeah, yeah, yeah, by probing it.
And, you know, but, you know, and I've, we've talked before I went, when I was away,
I went off on how TV signals work
and so I can get to the composite port
which is not RF modulator
so it's not up in the hundreds of megahertz
it's just a like it's just a DC signal
with wiggles in it and I can probe that
and now I've taught myself to kind of read the output
by just like moving around on the thing
and kind of there's the beginning of a line
this one's got a bright color in the middle of it
and then it's dark after that
you know that kind of stuff
it kind of feels cool I feel like I'm in the matrix
but another thing that I did recently
to rubbishify appropriately the emulator
so we're kind of back to the emulator
is I took some very close
recordings. I took this microphone, this boom
microphone, and put it right up next to the speaker
and I played a sequence of tones.
I write a little program to go through all different
sweep up and down through tones, different timings and whatever,
and I built essentially a model of how
that sounds for real coming out of like a crap,
two-inch little speaker,
such as you would have had in like a case on an old
Yeah.
And it is remarkably accurately awful when I now boot up the emulator by the fore.
And it goes, and it sounds like, it sounds like lunchtime at school at the computer club
when they were like a room full of these things that we were all playing with.
It's, it's fantastic.
I've got options.
I also then tapped it at like a just the other side of all the audio filters, but before the speaker itself.
So I could get like a more authentic, maybe my speaker is knackered, you know, but this is what happens with,
literally the audio circuitry,
and that's when I discovered
that there were some capacitors
that are probably past their best.
So you can kind of go for the,
this is what it sounds like
outside the computer.
This is what it sounds like
if you were to have bodged in
some headphones at this point.
And then this is what it actually sounds like
if you assume massless friction,
the spherical cow,
the waves that are square,
which is what's actually coming out of the chip.
Although, I plug the oscilloscope
into the actual chip and they're not very square
at all.
They were very ripply,
and that's what made me think
maybe something else is going on.
So there's a whole,
Oh, man. But that's been a lot of fun. Yeah, lots of fun here. Again, helps by our robot because I'm not necessarily the best of these kinds of things, but more of a, I'm an idiot. Why is this not working? And it says, oh, are you A on AC or DC coupling? And I'm like, oh, I didn't know that was an option. Oh, click. And of course, I could have found out myself. I'm sure if I'd Googled it, it would have been the same. But nowadays, if you Google it, you're going to get the AI answer first anyway. So I don't know. I don't know. Where are we? What is going on? I tell you where we are. We are 40 minutes into a podcast.
that was looking like it was going to not either happen.
You were going to do two lightning talks when it was going to crash, right?
That's right.
So I guess we should probably pause here and continue.
We've got more things.
I'm just trying to think to myself now.
I do have a day job as well.
And I run a reasonably successful open source projects.
Everyone's now thinking, do you ever see your family?
I don't know.
Well, when they walk past in the podcast.
That's true.
I don't know that we did this time.
And now I'm wondering how many ears are listening here.
Oh no, I think probably school kicking out time, isn't it?
Yeah.
Well, friend, I've enjoyed this.
Thank you for letting me talk at 100 miles an hour at you.
And to hear about your Gladys thing.
It's good.
And I guess we will catch up next time.
You've been listening to Toos Complement,
a programming podcast by Ben Rady and Matt Godbol.
Find the show transcript and notes at www.2.2's complement.org.
Contact us on Mastodon.
We are at twoscomplement at hackyderm.io.
Our theme music is by Inverse Phase.
Find out more at inversephase.com.
