This video demonstrates integrating a Lisp scripting language into a custom terminal and operating system, showing how standardized interfaces (everything as files in Unix, everything as text buffers in Emacs, everything as lists in Lisp) enable powerful interoperability between system components. The developer discusses challenges including infinite loops causing denial of service, build system configuration for cross-platform compilation, and the importance of proper argument evaluation and command execution in scripting environments.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
operating system development - terminal scripting
Added:Okay, we're back.
Good. My computer just [ __ ] froze on me completely and utterly 100% cuz this is a thing that again can happen on Linux.
Uh, cool. [sighs] Cool.
Love that for you. Linux [snorts] de G. What is that?
I am now live. Terminal scripting. Yep, that's what we're doing. Um, by any chance did I just keep this running?
Cuz that's the only thing I can possibly think of. For some reason, this script is just making my uh my system go crazy.
And it probably just like I don't know. That's the only thing I can possibly think of.
Uh anyway, uh most likely [sighs] ridiculous ridiculous behavior, man. Uh if it is that if this script for some reason just caused an infinite loop, why is it allowed to take over my entire system like that?
Linux, is this not a thing? That can be very very problematic.
Isn't this just denial of service like waiting to happen? I don't understand how Linux is not more exploited as a system cuz like genuinely stuff like this doesn't even require malware. It's just Yeah.
Anyway, um packager.
All right. So, I did this thing, this macro here.
You can delete your root folder if you want. We're not going to stop you if you really want. They do stop you now.
Um, they do stop you now. You need to use uh no preserve root if you want to do that. I did do that in a virtual machine in BSD and in uh one of those very simple Linux distros.
I don't remember which one. One of the very uh user friendly ones. So I did do it on some virtual machine.
But no power didn't go out. Um, the working theory is that for some reason the script that I was writing just took over the entire system, froze it completely, and I couldn't even access the little emergency terminal thingy to kill it.
Cuz apparently this is not a thing that Linux has considered.
Denial of service should be so [ __ ] easy on Linux, by the way.
It seems so easy.
But mind you, um, you know, all it takes to do a little denial and service attack in my system HTML tag.
I'm not one to talk, but to be fair, that is uh intentional behavior that I did with uh the crossplatform version will not crash your system. It will just show you this and then halt your program.
Um, the operating system version of it is going to panic your system with this message.
I have no idea what I did to break the system like that. Again, my working theory is that this very innocent script that I was writing somehow ended up in an infinite loop because I'm changing the path. That's probably what's happening.
Anyway, um I have another red lisp, by the way, which is a library. That's not the name of my lisp.
I have a little utility here.
Wait, does it use red lisp?
No, it doesn't.
Okay. So, I'm not I'm not going to use red lisp. Uh I'm just going to put the macro in here.
Um or essentially, we're going to tmp switch directory, right? To temporarily move you inside of another directory, then run some code, then move you back to the old directory.
And we're going to do a tmp switch deer into the path.
In there, we're going to run red build and [sighs and gasps] we should go back. Bye, Gen Noob. Thanks for joining. Thanks for the raid.
All right. Um, that is the plan for this thing.
By the way, if this works, I'm going to put it here. Although, that goes in FS.
So, 100% just move it in here.
Anyway, this is the operating system, which I don't need right now.
So, I'm working on the operating system from outside the operating system. All right. If the stream goes down again, we can confirm my theory.
This time it seems to have worked at the very least kind of somewhat.
Um, it didn't do that whole thing. So, that's good.
But I need you to recompile undefined reference and undefined reference to ripple run.
Okay, so it didn't work because it didn't recompile the compiler. Ironic.
Um, that should have been quick. That should have been a quick little detour that I was taking to do this very quickly and then um go back to what I'm actually doing.
Somehow that didn't work.
Anyway, let me uh very quickly print the uop um get cwd.
So, print the current working directory.
Do that.
Homed beyond home d uno. So, it should be trying to run the command called redu build.
Is that a problem?
It's probably a problem. Yes, because that's not a real command. That's just an alias.
No, it is a command. So, it is a bash script. So, maybe it doesn't run it properly. Anyway, I'm just going to run the command like this.
Still didn't do it.
There's no reason why this can't just be a function. by the way.
Yep.
Okay. The second I saw it hesitate a little bit take a little bit longer, um, I froze it. But it is working. Okay.
I saw it take a little bit too long and I was like, "Oh, oh god, it's going to happen again." But no, we're good. That actually worked. Okay. Why are you streaming at 60 fps? Oh, you need to see me moving smoothly.
And the dog, you need to capture the the movement of the dog. He's like a very active dog actually when he's not at home.
We're filming a nature documentary where you need to like see the the cheetah running in in in slow motion. So that's why I'm I'm doing 60 fps except the cheetah is actually a cow that's asleep on the couch on the bed.
All right. Um so that detour was a little bit more destructive than it was supposed to be. I still don't understand how this could possibly have led to an infinite loop and how Linux possibly allows something like this to take over your entire system. Again, the Nile service should be really, really easy on Linux. But anyway, a fork bump fork bump.
Anyway, I can now recompile my dependencies without needing to uh do it manually because I've been forgetting to do that and then being like, why doesn't it work? Why doesn't it work? Okay, so it didn't recompile.
Um, and yeah, um, issues aside, adding new features to something in Lisp is incredibly simple. I have to say possibly the thing that I like about Lisp is the same thing that I like about Emacs is the same thing that I like about Unix.
Um although I don't like Emacs and Unix, there are two things that I like about them. The fact that everything in Emacs is treated like a text buffer and the fact that everything in Unix is treated like a file. I copied both of these philosophies in my own text editor and my own operating system for a reason.
And I do like lisp, but even then I made my own lisp.
I think it's the fact that the entire thing works off of one single philosophy.
Everything is standardized to work in the exact same way. Everything is a file. That means every resource in the operating system is mappable or mapped to a file.
What does this mean? Using file system operations, two completely incompatible well, two completely separate systems can be made to talk to each other.
Uh, which is a pretty cool thing. Plan 9 handles that masterfully. Unix and Linux and Mac don't take this super super far.
my system should but honestly there's a lot of resources that I haven't mapped to the file system that I should like for example graphics I figured what's the point but yeah there is a point if you want to print to the screen using the file system you should be able to there is a standardized interface to do anything in the file system any resource in the in the operating system um standardized to the file system which allows you to do things like again two incompatible pro uh programs talking to each other.
Uh distributed distributed operating system. How do you do that? Through the file system.
Um even the way that I did like interprocess communication. How do you do that? Through the file system.
Simple as that.
Emacs does the same thing with text buffers. So everything is a text buffer.
So, um I I mentioned this yesterday, how two plugins that you use in Emacs can be made to talk to each other. Like you can use a multi I believe Zozing made a video on it where he used multicursor in the EMAC shell or another program. I don't know if it was the Emacs shell to mass rename files because the shell program allows you to run ls and then rename the files from the list directly and multicursor allows you to edit multiple lines at the same time.
You can mass rename files that way.
Uh again you can make incompatible or completely separate programs or completely separate um plugins of your code editor a text editor talk to each other because they use the standardized interface and likewise in lisp everything is a list. So you have again the standardized interface way of doing things which means that anything that is a sequence of things can be made into any other sequence of things which guess what most things are sequences. Do not say all things are sequences. So that's what I think makes me really like lisp the fact that in lisp just like in Everything is a file file system uh file systems and textbased editors like Emacs. You have the standardized interface through which everything can be made to talk to anything else. Pretty cool. And now I have a lisp, a textbased text editor and an everything is a file operating system. So the interconnectivity between them should be out of this world. I guess we'll see.
All right. Can we actually run this thing now? If I try to run uh ls as a lisp command symbol not found ls tries to get a fallback, but of course the fallback doesn't actually work.
So there we have it. Still using zed.
Still using zed. Yeah.
Um, yeah, it's fine. It works.
Um, I'm still using Z for now because the code editor, uh, right now I'm using it as a terminal. So, I'm not doing a whole lot of work on the text editing part.
But um for the time being, we're going to be using Zed for a little bit. Honestly, until I add multicursor to this thing, I don't see myself using it all that much.
I use multicursor way too much to not have it.
Okay. Uh so the first thing I want to do is I want to change some code up. Well, actually expose explode. Expose expose some code from list interpreter.
This one is the main one that I need right now actually.
So that it's also available both static inline with static inline.
Okay. No, it's not anymore.
I do need it. Well, I can still make it static inline. [ __ ] it. Just put it out here.
Uh, so I can use it outside here.
And car ID for the expression that will give me the command that we're trying to run.
Quick and easy. and convenient.
Um, this returns a string slice. Yeah.
Run command V and then tell us the command that you're trying to run. All right. So, let's see how that works.
ls.
See, there are still bugs in this thing like a lot.
All right, it wants me to run the ls command, but it's not actually running it yet. Okay, we're good.
Uh, have you read the C programming book? If yes, how did it help you learn the C language? I have not. I learned the C language by writing the C language. I believe that's the best way to learn a language.
The only book I ever considered buying for programming was the lift book.
This one um I never did it. [snorts] Mostly because I like the cover. That's the only reason.
Anyway, uh by the way, my idea of moving myself over here is just leaving an empty gap down here now, which is really ridiculous and hiding the dog.
And also, it's uncomfortable as hell.
So, uh probably tomorrow I'm going to be back to my regular setup, which means I need to move my monitors again. Oh my god.
Oh well. All right. So, we know what command we want to run. Uh we have the arguments of that command. Here's the kind of ugly part of this is that the run command um implemented by the shell calls command input on the actual shell shell run command. So my shell actually calls this function and this function can just move your camera. No, it's about moving myself mostly cuz yeah, there there's nothing on this side of the room to show. The only slightly interesting part of the background is that one. Then there's this whole empty space there, which I always found very annoying, but there is the dog on the bottom part of that. But no, most likely I'm going to go back to my normal setup.
Um, [snorts] although I do have to say the monitors like this make more sense.
I'm going to try something during the next ad break, but not right now.
Anyway, uh yeah. So, the thing is that like the shell processes its own arguments and it kind of sucks, but it means that I have to take the already established list of arguments from here and flatten it, turn it into a string and pass it in to be parsed.
So that would be very ridiculous, but it is the best way that I can handle this right now.
I still don't know even where I want the scripting to live. Right now, it lives completely outside of the shell, which itself is pretty ridiculous. I don't want it to live within the shell because then that would mean uh making the uh library that the shell lives in have a dependency which is not allowed to have.
So yeah, I need to figure all this out. So, for now, I'm okay with like I'm going to have to take this, turn it back into a command, parse it into a command, and then handle that. I don't know. If you move your camera to the right side and pointing to the other desk for a better angle, you would be fine.
Uh, camera over here.
And pointing No, I think camera over here and pointing that way is what you mean.
But I'll figure it out. I'll see you later or tomorrow.
Unfortunately, uh I I will be periodically moving aside so you can see the dog.
You move us to the left to looking more to the right side.
So yeah, what I said. Yeah.
Yeah. Uh that that could work. That could work. I'll I'll figure it out tomorrow.
Uh or during the adbreak. I guess I'll figure it out.
Uh, the DRO is Hannah Montana Linux.
All right, this is going to be very ridiculous, but anyway, we're going to run this command and we're going to run it with these arguments. Now, the arguments we're going to have to flatten a little bit. Uh, so before I do that, I'm going to print the arguments, see what they look like. We don't have any arguments right now, so that's very convenient.
But let's say that we do have arguments like ls.
Actually, let me try this. Add one, two.
Oh no, that's not what I was expecting at all.
Oh no, it does not work like it was supposed to.
You were supposed to first evaluate the arguments.
Let me see real quick.
Yeah. This does not evaluate the arguments first.
Uh, so it needs to do that which if I'm not mistaken, Eval does. So I can copy that EIS.
evaluating the list of arguments which are a using the environment m.
What's your problem?
Got to move it up.
All right. So, that should evaluate the arguments. At the very least, it should tell me to run command ls3. That's what I expected to see there. Not add one, two. There should be no lisp in that in that whole thing.
No, still didn't work.
Which is actually surprising. You were supposed to evaluate.
There's no way you couldn't evaluate the symbol.
There is a fallback though in which you evaluate this value.
All right. Is this working?
The evil result is three.
Wait, I don't understand what's happening here.
The value that it's doing is this one.
It should be ls with three.
Run command.
Oh my god, I didn't put in this thing.
I'm checking an argument that isn't actually there. My god, this keeps happening, by the way. Second time it happened today.
Oh, that looks better.
Wait, no. Cuz I'm being so dumb right now.
Obviously, you don't print this code gen type as if it was a slice, a string slice. That makes sense. But I was already printing it here, which is why this was here, which means it was working.
God, I just put them in the wrong order, so I couldn't really understand what was happening.
Oh my god, that was ridiculous.
Add one, two. I'm pissed off of myself right now. [ __ ] sake. All right. Uh, so run command ls with this argument.
Cool.
And then the ripple is printing the result, which is nil right now. It's fine.
ls add one two.
All right. Wrong command ls with this argument. That's it.
All right. We're good. We're good. We're good. Jeez, that was stupid as hell.
Anyway, um yeah. So, we have to take this thing and convert it into a string. Although again, ls is not a command that has uh a numeric argument.
It can have arguments, but it usually you don't use it with arguments cuz you're trying to get it for the current directory. You can of course you can get um how about OS? You can list the contents of another directory by doing this. It's just not a very common thing.
I was doing numeric because um I needed to test evaluation of symbols and also uh these two I need to press shift to press to do them and I'm pretty sure my UI library which is the one that handles the input into the buffer uh does not actually handle modifiers. So I may add that in a minute but I don't have it right now. I don't really need it right now. Uh what I need to do is take this thing and flatten it into a string.
All right. So we can do string return a string of uh sex to string.
Sex of course being sex as expression not sex expression.
I always call it a sex expression. I'm not really I'm not trying to be funny.
I'm not trying to be edgy with that. I literally am just unable to pronounce things properly.
an S expression.
Uh, no, not not that. It's a string slice.
If no cmd data or no cmd.length, return an empty string.
All right. Then um the code gen here is going to be a linked list of Hold on.
Check it real quick.
a linked list of arguments to the function. Right? Let's say that I do ls la which I am allowed to do and then I do home doos.
I do have to stringify them. It would be nice to be able to not do that, but I do have that right now.
Yes. Okay. So, I just need to flatten this list into a string pretty much.
Just join your Oh my god.
[laughter] I am so sorry. I was about to ban you because I read join our Discord. I was like, "No, don't don't be advertising stuff." I'm sorry. You said join you.
Join your Discord. Okay. Welcome. And I'm sorry.
[laughter] I read that way wrong. Welcome to my Discord.
Anyway, um yeah. So, uh the list looks like this. and we're going to need to flatten it.
Um, essentially we should be able to get the first argument with car just car which is another function that is not exposed.
I'm going to do that real quick.
if I could find it.
All right, car CDR cons. All of you, you're moving to the header. You're already static in line, so might as well. Who gives a [ __ ] Is Adam, too?
Apparently, it's needed.
Wait, why is this one not static in line?
You you you these ones I actually do want them to inline when possible. So anyway, uh get the first argument of the args and see if that can be printed.
Yeah, I don't need to do this right now.
I I know it works.
Definitely.
All right. So, take that equal to that thing.
And then, wait, hold on. Let me be smart about this. Let me use a buffer.
All right. So what I'm going to do is I'm going to do buffer write into this buffer the command data with a command length.
All right. So that gets written.
Then I do have to manually write that that sucks to do it like that but okay it works. Settling for lisp. Excuse me.
Settling for lisp. What?
I am choosing lisp. It is my first and only choice. It's not the last choice.
I'm not settling for it.
Okay. So, we're going to get the car and can we make this uh already recursive?
Right, it should be possible.
So, do this while we have an args pointer.
while that exists or actually um while that exists immediately do it like that. Okay. So get an argument if the argument doesn't have a pointer for the car uh or um it is not the correct thing which is a lisp value code. uh s rule lisp value which should be called atom but somehow it's called that then we break out of this whole thing.
All right. Um if the argument is no actually we don't need to check the value of it.
No, we do. We do. We do it.
Take that. Then switch switch on the uh code type and populate the switch for me. Thank you. That is utterly useless. Why?
I don't know why both Zed and Clang are breaking or clang within Zed is breaking or Zed is just breaking but both of them are starting to get worse and worse and worse.
Um, so yeah, that was not C++ code. I can tell you that much.
Um, hello Rudy. There's the dog.
Yeah, that is the main re reason why moving over to this side is not working out. He is the main reason for that.
Uh him not being there anyway. All right. So if it's a nil or true value, then in that case we don't do anything.
We continue. Well, no, we don't continue.
We break out of the switch.
Uh in case it is a numeric value, we are going to print it to the buffer using a buffer right into the buffer where we put in all this stuff using that and a space at the end. And the value we're going to take from val, no, from number.
Right now I only support um integers by the way which is not great but whatever.
Okay that and then break.
So we're going to be taking these and just um formatting them otherwise there is a val.
But when something is a string, we actually need to turn it from a string into a normal argument. Right? If something's like this, then it's just period.
All right? So that is going to be um done with a substring. We're going to check if code val length is less than two.
then break because it's not long enough to do what we need to do. Otherwise, we're just going to create a string slice out of this one + one and code val.
Did you cry length minus two? You're good, Jester.
All right, at least you can see him now over my shoulder.
I just need the devil over here. or an angel. He's depends on what he is.
Are you reading any books at this moment related to programming or in general?
Um, of course, this gets printed as a string slice skipping the uh quotation marks.
And in the case of an identifier, we just straight up print it as is break.
All right. I'm doing nothing with this, by the way. I need to return the buffer. I'm not using a string. I'm using a buffer now.
So just return the buffer. Who cares?
It is being created. So no. Okay. Let's do it like this.
So So return an empty buffer. If there was an error, you don't have a command.
Uh otherwise return the buffer.
And now here the command that we're going to run is actually going to be taken from sex p to string using the expression and the arguments.
Let's see what that looks like.
ls home do my home directory whatever. And then also la. That's probably not the right order, but we're still not executing the command, so who cares?
Uh, that looks like it did nothing. Oh god. Oh god. Oh god.
Oh, why are you trying to terminate? I already did it, didn't I? Why is it still running?
Why is it still running?
Linux, what the [ __ ] I told you to terminate it twice already.
[ __ ] Am I doing something wrong here? Like what what am I supposed to do here?
The process is not running anymore.
The process is actually not running anymore.
Why won't this go away, bro?
It still won't close it.
the process being controlled by the image uh SPCL already quit mind you I understand why it doesn't quit the process kind of but genuinely the process is not open anymore according to top according to PS and according to the fact that I cannot close That what is that?
I also cannot kill it.
I created a zombie. Sure, but I cannot kill it at all. Also, how the [ __ ] did I do that? This is the most I keep doing the most basic things in Linux and breaking everything. That's just a sign that is a bad system. Like, what the [ __ ] is happening? Anyway, at least I figured out the name of it is actually rain though I cannot find it.
Oh, there it is.
Okay. But the process name doesn't actually it doesn't let me kill it because it says that it doesn't exist.
Um, I do understand this is a big limitation of my s of my build system. Actually, this is 100% its fault. Um, I'm just checking that it's not using too much memory, you know.
I no longer see it in the list of processes. Oh, it's gone.
It's gone. It's gone. Holy [ __ ] Okay. Well, whatever the [ __ ] just happened. I don't know. Let's maybe sort out our process [ __ ] a little bit, Linux, cuz I I can't believe that Linux has the same issues that my system has when Linux is older than me.
Not older than my system. It's older than me. How is that possible?
I don't get it.
Anyway, the reason that entire thing happened is that I am never moving the cursor of args to the next one.
Let me reopen the terminal real quick just in case I need it.
Jesus Christ, man. That was ridiculous.
I feel like it was doing it again. No, it didn't. It didn't. It didn't. It just uh didn't return any value.
All right. Um, how about I print them real quick?
All right. So here I want to print the code val.
Here I want to print the code val.
Here I want to print the code number.
No, I want to debug print them otherwise it's going to spam too much.
All right.
I don't really care what I put in here.
LS a a Oh.
Oh, I'm just trying to print the buffer as a string. That won't work. Um, all I have to do is slice from buffer.
But that does mean I need to take the command like this.
Do this.
All right. LS A that crashed.
Um, okay. So, the number didn't work. Oh, wait. [sighs] I forgot to change the format type here.
Literally, my debugging is what bugged it.
It's call me GDB. The way I'm able to just do that.
All right. Uh, that is not correct.
Kind of not correct.
It's kind of correct.
It did a a just what are you trying to evaluate is the question. Where does this evil null pointer come from?
Symbol not found. Aa Oh, right. I Okay, that's where that came from.
Um, so I can't use an identifier if it doesn't actually exist. That makes sense.
ls aa123.
All right, wrong command. LS aa 1 2 3.
Okay, so it works. But I did forget.
I literally said I have to write uh arguments in this very ugly manner, like spaces in this very ugly manner, and then I never actually added a space.
But anyway, we're just going to do it like this. Screw it.
All right.
Okay, cool. That's the command that I'm trying to run. ls aa1234.
Again, I would love to be able to do a little bit of hacking magic for paths without needing to use strings for them and maybe even arguments like these so that you can just type them immediately.
Um, but again, we haven't actually designed the lisp uh dialect that this whole thing will be using. It's an incredibly limited way of working. But we are now able to run this slice and that means string slice strng string slice s. And now, um, I do realize we also need to pass this into it cuz that contains the shell that we're going to be talking to like that.
And this function [sighs and gasps] needs a void context which is not possible for us to get. Oh my god.
Never mind. Let me do it another way.
That sucks to do, but yeah.
Umh.
All right. So essentially we'll just assign this context thing before we do the ripple call so that uh when we get here we'll already have it here and we can run this.
Sucks but we don't have closures.
Uh we also need to check if there's no current buffer we return a nil expression.
And we also return a nil expression in general, but we could return a true or false, right? When we run commands, that would be cool to do.
Um, right. There's already something called current buff shell context. Let's call it that.
Now we can do ls la unknown option la usage ls path.
This is this is my built-in ls function.
I forgot about that. It's built into the shell. Uh, so I'm not using the um the normal ls that actually takes LA as an argument. There's no hidden files. So it doesn't make any sense and it's always listed. That doesn't make any sense. Are you making a kernel sysol paging management or you building on top of a kernel? So making it but tbh been over a year so it's already pretty advanced.
Um, so right now I'm not even working within the operating system for that matter.
Um, for no particular reason. I I probably will before the end of the stream. Why not?
Yeah, I should have time uh [sighs] to to try and run this thing in the operating system itself. But yeah, it's my own kernel just already built.
All right, cool. So I actually figured out how to do command runs uh within the lisp script.
I still again lisp doesn't even live within the shell cannot live within the shell technically cuz all this code is part of a completely different library.
I would need to either move the shell out of the current uh library that it's in or um which is a possibility actually very very likely possibility or move it elsewhere or something I don't know I'll figure out the code organization but the code works which is the important part I can now write scripts with this thing Now, um, how about we test a command that actually works, like pwd.
Uh, that's what we're currently in.
Although, uh, this error still gets printed every time.
That's not really an error anymore. We do allow for uh unresolved symbols cuz now we allow external symbols.
So that imaginal fallback function call where I say asuck error.
I'm only going to print this error if it is actually an error.
So if I don't have a fallback for it.
There we have it.
Random question. If you could, would you live here in Japan? Never been to Japan.
I'm not sure I would live there.
Never been, so I couldn't tell you.
It's not a thing I have considered ever.
I've considered visiting but not living.
And again, can you really consider living in a country you've never visited?
All right. Um, there's an ad break coming up and I'm going to experiment a little bit with my setup without, you know, moving any actual stuff around, but I'm going to see if I can figure figure it out a little bit. So, I'll be back in 3 minutes. uh possibly on this side of the screen. Now Heat. Heat.
[music] Heat. Heat.
Heat. Heat.
[music] Heat.
Heat.
Heat. Heat.
Heat.
Heat.
Heat. Heat.
All right. I brought this guy since I wasn't able to move my setup.
So, at least he's here.
What's up, buddy?
Um, you're very very warm. It's not very good when it's like 50° outside right now.
Yeah, he agrees with me. He just pretty much jumped off.
All right. Um, so what do we have right now? I tried I tried fixing my setup and yeah, this does not work.
My old setup was way better and I need to just revert it back.
came here not even knowing Japanese.
Well, [snorts] I feel like if you want to learn Japanese, that's probably the easiest way to learn it.
Um, it's pretty much been proven actually.
Not going to lie, I've definitely tried that with French.
Not living in France, mind you. Just like forcing myself to speak French whenever I I need to.
Uh, so well anyway, um, I know a surprising amount of French for somebody who never studied it.
So, yeah, I'm not doing too bad, I guess.
How old is he? Uh, he's turning seven next month.
All right. So, the way things stand right now, first off, I turned my compiler into a library, which is a thing that I genuinely like completely glanced over. It doesn't really matter. It's just literally just changing a compilation flag from B from bin to lib. Literally, that's it. Um, but still pretty useful.
Um, I made a ripple for it and whenever the ripple fails to resolve a symbol, it will try to use a fallback for that symbol.
So, we have a scripting language, I believe.
However, we don't necessarily have the easiest way to write that scripting language to do anything useful with it.
Uh maybe that's a thing that I I can do tomorrow most likely because right now what I would like to do is to compile this thing for system operative.
Um although I I do have to say I'm not entirely sure how to do that.
Um because of this build system pretty much the build system is not prepared to recompile dependencies for the correct system yet. So I'm going to have to do that part manually.
Oh well.
Uh let's see if we can first off. All right. Okay. So, you're going to compile for reducted.
Um the rule gen you're going to compile for the native cuz that's just a dependency of the compiler itself. Then the compiler you're going to compile it for redacted.
All right. We're also going to need to do the same thing for the UI library.
My old uh build system did handle this properly.
This one could recompile dependencies for the correct um target technically not super difficult to do, but we're not doing it right now. So reducted like that.
Then compile this for reducted.
Is that enough to get it to run properly? I'm actually not sure. Let's find out.
Okay. Uh could not find lib shared.
Okay, that's true.
because I am not compiling for cross h kind of text editor you making uh it's somewhat inspired by Emacs. Okay, I'm using the wrong uh compiler here. I'm using GCC.
You should be using uh Arch 64 GCC.
So, did I just never set that up?
There's a lot of stuff in this new build system that I haven't needed, so I haven't done it.
The compiler is this one.
Resolve compiler for the current environment.
It looks to me like it should be working.
Um, it looks to me like this should resolve to arch non-self.
if I did everything right. I'm just trying to think of it. Uh, okay. Again, resolve compiler gets called by make command. Make command gets called by that is the compilation.
Hold on. Okay, these two did get recompiled, right? Did you compile them for GCC as well?
So, this uh this is not working.
I do have to say when I wrote this thing, I wasn't super sure what I was doing when it came to lisp.
So, a lot of it doesn't make a whole lot of sense anyway.
Um, and back to this. This is compile commands. No make command.
You should be resolving the compiler.
which should be making it into Wait, what about this current environment?
Oh.
Oh, what the [ __ ] is a current environment, man? This is a variable that I'm only using for this. Obviously, that's not going to change.
It's my dro. Uh, I'm using Red Star OS with KD.
The important part there is KD.
Now I see I see the problem. This current environment thing makes no sense. What the [ __ ] was that? It was supposed to be the target, which I believe is mod target. That's what I'm supposed to be using.
Red mod. Target mod.
Okay. I almost want to say that looks better.
Yeah, it does look better because Well, Uno did not get recompiled into the correct um system that it was supposed to.
How to become a good programmer, mathematician. I don't know about mathematician. I'm going to be honest with you. I'm not good at that [ __ ] Um, but programmer programming pretty much that's how you do it. That's really the only way to do it.
I don't think reading books is kind of I mean it can teach you the theory. It can probably make you a lot more like give you a lot more formal knowledge, but how do you get good at programming?
Programming. That's the only way. Again, advice that doesn't uh apply to surgeons, but it applies to us.
Oh, wait. Hold on.
No, wait, wait, wait.
Okay. Which one of you is complaining?
You're doing beyond. You're doing uno and you're recompiling them for reducted.
So, aren't you? No, you're not.
Wait. No. Why not?
This is doing the exact same thing that the other one is doing.
It's literally the same thing. So, what's happening?
Target is this one.
Name Uno. type den lib I get that but somehow it's still compiling for GCC even though the target is this one and it points to the same build command so once I modified it once it should know what to use right you're using a quick build as Oh, quick build which is calling compile module if it's a library. Oh, okay. The lib compile. Okay. Yeah, libraries are not covered by the thing that I just did.
So my bad.
No, I looked in the wrong place.
All right, lib compile. Here it is.
takes the libraries maps.
This lib command list this command here is not updated which means lib command which is called here need to pass in the module as well. So I can include it here and do resolve compiler um red mod target mod and then here the compiler which is a bit of a silly variable now.
It should always be GCC.
But in this case, it's not going to be the same cuz here it's actually an assem well, not an assembler, a a library assembler thing. I don't know what that's called.
Anyway, when you call this function and when you call this function, you pass the mod. So I'm just propagating this value downwards so that it can be used to resolve the com the correct compiler and correct assembler and then you call them both with the module that didn't work. invalid number of arguments two, right? Because the same thing is happening here.
Pass that in and pass that in.
Okay.
All right. So, now it's using GCC. Okay, that's good.
Ooh.
undefined reference to write SBK. Well, those are not symbols that you should be referencing at all. All right, this is the final compilation command. It's uh GCC with STDC99 uh Uno Beyond Homebrew include homebrew which is supposed to only be used on Mac is somehow making an appearance here for redacted. Hello Marcy.
So that's not super correct.
Oh god. Um, besides that, let me see if there's any other errors. The two libraries, this one that shouldn't be here, the current uh directory, red lib, then compile brain. C3 layout file source shell source against the UNO library, the imaginal library, homebrew, which shouldn't be here, and lib shared producing brain.f.
Okay, so the rest is good. The only part that's not good is that um somehow uh homebrew made its way here.
Um [laughter] so I have default dependencies, right? Uh, which I'm pretty sure should have just been if uh type is equal to no not type um tar is equal to Mac.
I believe that's what I called it. Mac.
Yeah, cuz homebrew is only used by Mac. But somehow this condition was if true equal true. I must have been testing something and I just never moved it.
But it still has references to stuff that I shouldn't have. Uh, nonelfgcc stdc9.
Oh, wait. Um, [ __ ] There is another compilation flag that's missing and I should tell it freestanding and no std lib something like that. F freestanding.
I need these two compilation flags that are missing.
uh which are only added if something is compiled for reducted OS [snorts] because it uses its own library.
Um so essentially if mod uh no red mod target of the module is equal to reducted then you also need to include this and this compilation flex.
And now they fail.
Oh, well, this is not a condition. This is an if.
I need to explicitly tell it to compare them.
Still not right. Still not right.
Defund make command. Targeted.
Oh, supposed to go here.
All right.
I understand what's happening. I'm just trying to figure out who's printing this word expected. Expecting.
Is that a print of mine? That's not mine. Who's printing that? What does that mean?
Now the thing that is happening here I believe is that the elf file got compiled and I'm trying to run it in the incorrect manner instead of copying over to the system and running it like that. I am trying to run it um directly.
So that isn't correct but I would love to know what it means. Syntax error word unexpected expecting closing parenthesis.
Like what do you think this is? This is what happens when you run.
No, it isn't.
Uh actually, what does it mean?
This is even worse cuz I thought, okay, it's somehow executing the program even though it shouldn't because it's a different format entirely. So it's not capable of executing this program and somehow producing this error. But no, it is producing this error. I have no idea who's producing this error.
I understand exactly what's happening. I what I don't understand is where this error is coming from cuz that's not the correct error.
This is the error that I was expecting.
Exc error. But what do you mean syntax error word unexpect? Who? Who's who's saying that? [clears throat] Whose print is this?
That's an error reported by the almqu quest shell or its derivatives like dash happens to be the default implementation of bin sh used by Ubuntu. probably also Debbian when a word is found while parsing the syntax of a script where a parenthesis is expected instead.
I how did this happen?
The weird thing about this is that the it should have never attempted to run this uh program, not run it and encountered a weird error. It should have just said exact format error like it did here, but somehow it did this instead. And that's really, really weird.
Also, it downloaded a picture of the JavaScript creator there. Oh, and there's Terry Davis.
Um, anyway, this part I'm going to do manual. I can't I I don't understand what that was, but this part I'm going to do manually, right? Cuz to be honest, I never Well, I did finish the packager for my uh for my system. I just am not using it right now. So, we're going to do it manually.
We're going to go in here and delete this and uh paste.
Then, we're going to go into the operating system.
This better run cuz it's it's taking a long time to to set it up.
It did not run. Beautiful. Beautiful.
Beautiful. Beautiful. Uh, it crashed at mouseinput.h25.
Null pointer accessed.
Um, all right. So, the code editor is not running on um it is not running on the system right now.
I do wonder why.
Now it did give me an error about not being able to find a symbol start. That is actually okay because I don't use start in my system. I go directly to main. So I don't think there should be a silent function that the programmer doesn't know about. That doesn't make any sense.
Um so all the setup that start does the loader does and I go directly to main.
So the main fun the main entry point of your program is actually main not start.
Uh so that not that is not the error but yeah uh this does not run. Um let's not waste any more time on this.
Yeah, actually do that and that.
I'll figure this out properly. I'll add the missing parts to the build system so I don't have to manually do all of this every single time. That's really annoying.
But anyway, um we do have what is definitely a terminal and not a text editor and scripting for it.
Now, do I maybe want to try running an actual script like this one, for example? Uh, I don't want to have to type this whole thing out manually, and I don't have copy and paste in the editor yet.
So, how about I just manually put it in here?
Uh, command buffer. Buffer. Okay.
buffer right into the command buffer buff this thing. Going to need to escape it a little bit most likely.
There we go.
So, that is already pre-loaded into the command buffer. And how do I even know if it worked?
Oh, it eventually worked. But it says no atomic expression in sub expression.
Uh, so that's not good.
[snorts] First off, does this even compile anymore?
like does it still uh work properly?
Yeah. Final result five. So here it runs. There it doesn't.
Um even though it's the exact same code, unless it is somehow also including the escapes that I put in.
Let me just not use those.
That's the only thing I can think of for this happening. But it's a bit ridiculous. But all right, let's compile it into a library.
No, it's not.
You need to compile as a library buddy.
Oh, that is not the correct. Okay, that is compiling as a library.
And now, no, somehow when I run it from here, it fails. And also it um sometimes when I press enter doesn't actually enter doesn't actually like try to evaluate the expression. Uh no atomic expression in sub expression.
It's evaluating something wrong. I just don't understand what it is.
because this is the code.
All right, let me try try and do something manually then not do this stuff and instead try to do let's see a simple add one two start with that maybe recompiling cuz that does not ignore what I told it to do.
This is a really annoying bug. Uh, I don't know how many times I have to press enter before it actually enters.
Bro, run the command.
That is a really annoying bug. I'm going to have to fix it for tomorrow.
It makes this whole thing actually unusable.
Bro, it doesn't feel like working.
You know what really sucks is a bug that happens occasionally and then starts happening very often cuz you've been ignoring it and now you can't ignore it anymore.
It straight up ignores me though.
It's very annoying.
All right. What happens if I don't do this? Cuz like we were fine before I started doing this kind of No, it's that's the second time this has happened. Two days in a row.
Everything's working fine. I don't change a specific part of the code. It refuses to work anymore.
And yesterday, like I fixed it, but I still don't understand what the actual problem was. So today, um, it's not looking good.
All right, one last time.
No, seriously. What the [ __ ] Now it works.
Okay, it's a different issue.
Expected string found closing.
Oh, I'm doing something wrong here.
I am doing something way wrong.
because now it works. The second time it doesn't work.
All right. Let's say that that's debugging that I can do tomorrow and um just move away from this. All right. are using I. What is I?
Um, all right. So, we should be good kind of. I mean, I did what I wanted to do. I have scripting in the ter in the well, yeah, in the terminal is uh in the shell inside the text editor, which is acting like a terminal.
Um, but it works.
So, I'm going to call it successful.
Um, I need to fix first off. I I need to uh keep working on my build system to uh be able to package applications. That that one's on me and be able to rebuild dependencies with the correct uh architecture.
Um, and then I need to figure out once I have that and I can rebuild the system the rebuild the terminal easily and put it in the operating system. Figure out why it crashes there. I'll only do that once I actually like have an easy way to put it there. Cuz if I have to manually copy it and paste it, that's not going to be good.
Um, it's just a little bit of boiler plate I need to write. It's not going to be something particularly complicated.
Um, and then it's going to be working. We have a terminal. We're able to run commands scripting, which by the way, the language is uh right now it's lisp 1.5.
[ __ ] dusty ass ass language.
uh with written in with support of the US Army, Navy, Air Force.
That's how old it is that computing was pretty much a military and sometimes university type of thing. Well, no, at this point it was very much university type of thing. uh sometimes uh US government, but that's how old this version of Lisp is. Um so hoping I have those bugs fixed by tomorrow and I can actually have it in the uh OS, but it's not necessary.
Most importantly, I'm able to like write stuff properly because again, very annoying that this is not being evaluated.
But this is also not being evaluated anymore. Okay, [ __ ] off.
Um, then tomorrow I should be able to uh start designing a dialect of lisp based off of this thing. And then like I said, I should also optimize the interpreter for it because symbol lookup with a linked list. It's a very lispy way of doing things, but it's not very optimized. So, it's going to make it very slow.
A lot of other things that I'm doing in the list way I could do in other ways with a lot of optimization, skipping a lot of recursion, skipping a lot of that type of stuff.
Um, but that's not really something super exciting. That's just uh optimization and refactoring. That's uh frankly not a top priority right now in the terms of things that I am refactoring and optimizing.
We have the operating system.
We have the text editor and then we have the interpreter. But it works. I can script with it. I can script in lisp.
And so tomorrow I want to work on the text editing part of this thing and on the lisp language design. So it's still the same thing. Still working on the scripting for the system but actually designing the language a little bit more.
Designing is a relative term because it's still lisp.
But yeah, by the way, when I was showing like the genius of lisp and how amazing it is, one thing I completely neglected to mention is how easy it is to parse.
Lisp is incredibly easy to parse. These are all the rules that I have for parsing lisp. And most of them are just because of the way that my parser is designed. You need to like chain expressions like these. But essentially you just have an s expression which is parenthesis followed by something something something any level of somethings any amount of somethings or an atom which by the way I called list file this part I will change its name to just atom which can be an identifier a string or a number also my tokenizer needs a lot of work uh maybe I'll start looking into that tomorrow as which technically means I need to do a um text processing language.
But yeah, all of that is part of the unifying again the standardized interfaces like I said that my operating system has. Everything is a file that my code editor has.
Everything is text I guess we can call it and that list path of everything is a linked list.
Those three standardized interfaces require very little glue to make them work together uh to make them interact with each other and that means that should make the scripting pretty powerful for the system.
All right. So tomorrow I'm going to be designing that stuff uh today and tomorrow whenever I have time I'm going to try to make this thing a little bit more stable and maybe even get it running in the operating system.
All right. Uh that's going to be it for today. Tomorrow I'm stream Am I streaming at the same time tomorrow?
Depends on weather. Although I think I am.
Damn. Uh, tomorrow's maximum is last week's minimum. So, yes, I am streaming at 3 p.m. tomorrow. Damn, that's amazing. All right, so I'll be back tomorrow with more lisp stream uh lisp.
Um, we have Emacs at home and we have plan 9 at home development.
I'll see you then.
>> [music]
Related Videos

TOP 15 Data compression Interview Questions and Answers 2019 Part-2 | Data compression | Wisdom jobs
wisdomjobs
281 views•2019-06-28

CTS 158: 802.11w Management Frame Protection
ClearToSend
4K views•2019-02-04

NDSS 2019 Send Hardest Problems My Way: Probabilistic Path Prioritization for Hybrid Fuzzing
NDSSSymposium
496 views•2019-04-02

How realistic is Cities: Skylines?
CityBeautiful
159K views•2019-02-14

GUIs & TUIs: Choosing a User Interface for Your Python Project | Real Python Podcast
realpython
2K views•2025-04-04

The OSI Model - Explained by Example
hnasr
225K views•2019-05-12

Cloud Computing - Introduction
elithecomputerguy
98K views•2019-10-07

From Traveler's Dilemma to Dynamic Routing | Demystifying Networking
IITBombayJuly
5K views•2019-08-04
Trending

WOW! Judge TURNS THE TABLES on Trump in His OWN $10B LAWSUIT!!!
MeidasTouch
197K views•2026-07-23

Playstation NO DISC/NO BUY Fight Is Over...
DavidJaffeGames
4K views•2026-07-23

Steam and Xbox Just Dropped The Hammer On PlayStation
OhNoItsAlexx
9K views•2026-07-23

Americans Confused in Australia for 17 Minutes Straight
IWrocker
17K views•2026-07-23