Constraint: I only have 256 colors.
Constraint: I only have 256 colors.
A 3-minute video showing what it's currently like to prototype programs on the Mu computer. There are lots of limitations. It's slow, and it can only handle short runs.
While these limitations will be relaxed over time, the goal is partly to nudge people to throw the prototype away once they know what they want, and rewrite it one level down. Therefore: encourage people to write lots of tests.
https://archive.org/details/akkartik-mu-2021-04-22
Main project page: https://github.com/akkartik/mu
I tried and failed to implement Bresenham's line algo. Horizontal and vertical lines work.
No macros => lots of lambdas.
The computer keeps crashing because I type too fast (still can't brain interrupt handlers). It frequently saves to disk, but as an s-expression. Reboots lose indentation.
Ok, edit on host -> create disk image.
I have lots of little buffers. When they overflow the computer crashes. Without a call stack.
Thanks Max Bernstein for pairing!
Still lots of catastrophic bugs that require editing the disk image. The disk is clobbered on reboot because I added support for reading multiple sectors from disk but still only write one sector.
https://archive.org/details/akkartik-2min-2021-04-10 (2-minute video)
Main project page: https://github.com/akkartik/mu
Things to notice:
https://github.com/akkartik/mu/blob/main/shell/README.md
Main project page: https://github.com/akkartik/mu
Typed languages have a fixed signature for function `main`. A list of strings, a window context, or an IO monad.
Here's the signature on the Mu computer:
fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk)
A rudimentary, hokey capability system. No mouse yet. 'screen' is only used for text; pixel graphics currently go around it. 'data-disk' can't access code, and will eventually include finer-grained restrictions.
Still extremely klunky. IDE disk drives only, and the mouse driver uses polling because configuring IRQ 12 is still beyond me.
Example programs (as usual memory safe and translating 1:1 to x86 machine code)
Disk: http://akkartik.github.io/mu/html/ex9.mu.html
Mouse: http://akkartik.github.io/mu/html/ex10.mu.html
Here's video of the mouse example. There's no pointer so you have to imagine me moving the mouse around.
Like I said. Klunky.
Main project page: https://github.com/akkartik/mu
https://github.com/akkartik/mu/tree/main/shell#readme
It wouldn't have been possible without the lovely folks over on #osdev. And the inspiration of ColorForth (https://merveilles.town/@akkartik/105906716550232992), though I still don't understand how that driver works.
https://colorforth.github.io/ide.html
It seems to be using https://wiki.osdev.org/ATA_PIO_Mode which transfers data to disk one byte at a time. Super inefficient. And yet, so small! ❤️
Primitives available in the Mu computer when running without an OS: https://github.com/akkartik/mu/blob/main/vocabulary.md
Primitives available when running on Linux: https://github.com/akkartik/mu/blob/main/linux/vocabulary.md
For starters I focused just on making things more discoverable. These files are optimized for opening in your text editor, jumping to definitions to see type signatures, etc. See https://github.com/akkartik/mu/blob/main/editor/exuberant_ctags_rc for a ctags configuration for Mu and SubX programs.
Main project page: https://github.com/akkartik/mu