Toast OS
Toast OS is the terminal-like widget that I have as the homepage of this site. I started building that janky thing back in 2018, when I stuck on the BART mid-commute, and I started thinking about JS's new async/await feature. I was intrigued by its ability to split up synchronous chunks of Javascript code in pretty complex ways - since await is an expression, you can place it in some pretty strange places, and JS will magically halt execution precisely there, and then resume once the async stuff was complete. At the time, I had another side-project where I was trying to translate some FORTRAN code to Javascript (long story) but that one detail - splitting a sync bit of code up to wait on async stuff - ended up being complex enough to be a sticking point for that whole project.
I then started thinking about how the way Javascript handles events with zero preemption, instead fully relying on the synchronous bits of CPU work to fit nicely between the chunks of IO is actually kinda similar to the fully cooperative multi-threaded mainframes of yesteryear. And now with async/await, it's now really easy to introduce those asynchronous breaks into larger blocks of code. If JS were an operating system, one could simply force all syscalls to be async, and that could actually provide a reasonable number of spots that'd yield control back to other tasks...
Anyways, one thing led to another, and before I knew it, I was writing a virtual filesystem, and a fake kernel. I made a whole bunch of progress, but the project took a several year pause, since Webpack + Flow were awkward enough to work with, and I was getting a bit burned out on it. But recently, I decided to catch the whole project back up with modern JS technology, (this time esbuild + Typescript) fix a number of lingering bugs, and also create a whole bunch of brand new ones! Hooray!
So anyways, what's in this strange thing? And how does it work?
