Dec 5, 2020
Feeling low today.

Damn hands are acting up again. RSI. Perhaps I should give up on Advent.

Mu's compromises:

  • Just one instruction set. New processors need reworking. And I have RSI.
  • Text mode. Hopefully a graphics stack can slot in underneath without needing rework.
  • No pointer device. Apps are starting to make this assumption. Adding a mouse will require rework. And I have RSI.

:/ Constraints I consider "temporary" are perhaps not.

Want less. — The Buddha

permalink

* *
Dec 5, 2020
#adventofcode in Mu

I seem to be settling into a pattern of solving these on alternate days. Late for one round, early for the next.

Day 4 solutions (spoiler alert):

http://akkartik.github.io/mu/html/apps/advent2020/4a.mu.html

http://akkartik.github.io/mu/html/apps/advent2020/4b.mu.html (utterly ghastly)

2.5 hours. 2 machine-code bugs found, 1 new (terribly named) library primitive added: https://github.com/akkartik/mu/commit/18d5bab2b66

Day 5 solutions:

http://akkartik.github.io/mu/html/apps/advent2020/5a.mu.html

http://akkartik.github.io/mu/html/apps/advent2020/5b.mu.html

30 minutes. No new Mu bugs found.

Project page: https://github.com/akkartik/mu

permalink

* *
Dec 2, 2020
Advent of code in Mu

Day 2 solutions (spoiler alert): 2a 2b.

40 minutes. No new Mu bugs found, no machine-code hacking was needed.

Day 3 solution

60 minutes. Lost 11 minutes debugging a silly mistake (see commit log)

No new Mu bugs found, no machine-code hacking was needed.

Project page: https://github.com/akkartik/mu

permalink

* *
Dec 1, 2020
Advent of code in Mu

http://akkartik.github.io/mu/html/linux/apps/advent2020/1a.mu.html Day 1 part 1 solution (don't click if you don't want to be spoiled):

Took me about 40 minutes. In the process, I had to:

  • Fix a bug in reading lines from stdin into streams
  • Start trailing newlines when parsing ints from streams
  • Implement `find` in an array

We'll see how long I can keep this up. Linear scans will soon not cut it.

Day 1 part 2 (same deal, same spoiler alert, just more brute force): http://akkartik.github.io/mu/html/apps/advent2020/1b.mu.html

Part 1 took 40 minutes and part 2 took 18. Therefore I'm getting better at this.

Project page: https://github.com/akkartik/mu

permalink

* *
Nov 24, 2020
I'm trying to come up with a notation for the rotate (circular shift) operation:

https://stackoverflow.com/questions/32785998/symbol-for-bitwise-circular-shifts

Kinda surprising that there isn't a standard answer yet, given how common it is in cryptography, and how much of a workhorse it is in the ARM instruction set.

permalink

* *
Nov 14, 2020
The Mu shell, compiling down to a subset of 32-bit x86 machine code, then to a Linux ELF binary, packaged up with just a Linux kernel and nothing else, running on a Linux console emulated on Qemu, on a Thinkpad T420s running 64-bit Linux.

Just another 27 million lines of C to take out (Linux kernel), and I'll have a decent computing stack.

A window showing Qemu running a copy of the Mu shell, in front of a window showing the Mu shell being compiled, the Linux kernel being compiled, and an ISO image being created.


I'm also thinking today about what it would take to fork Mu for the Raspberry Pi. It uses ARM processors, a 64-bit instruction since the Pi 3 which was released in 2015. The 64-bit ISA looks quite nice, but it's incompatible with the Pi 1 and Pi 2. Contrast x86, where 64-bit is quite compatible with 32-bit, but grotesque as a result, with bits for a register scattered across multiple bytes. So I might make the opposite choice to x86 and support just the 64-bit ISA. Thoughts?

https://developer.arm.com/documentation/den0024/a

permalink

* *
Nov 12, 2020
Screenception

A text-mode postfix program which draws a square on screen, visualized in a comic-like manner using pictures of a tiny fake screen.

Visualizing programs with side-effects in a postfix shell with a live-updating text-mode environment. Built all the way up from machine code without any dependencies (except an x86 processor and Linux kernel).

https://archive.org/details/akkartik-2min-2020-11-12

Project page: https://github.com/akkartik/mu

More context

permalink

* *
Nov 6, 2020
In the last 3 days I've written 68 tests for error messages in the Mu compiler, adding up to about 4.5k lines of machine code. Utterly tedious, mind-numbing work with lots of copy-pasta. Just what the doctor ordered.

(https://github.com/akkartik/mu)

permalink

* *
Oct 31, 2020
For a couple of years I've been building up a computing stack without metacircularity, where complex languages are consistently implemented in simpler languages.

For several months now I've been wrestling with a thorny problem in one corner of the core compiler which converts a safe language into unsafe machine code. Today I finally decided to stop agonizing over it, and write up the idea maze to the extent I've explored it.

https://github.com/akkartik/mu/issues/45

Comments and suggestions most appreciated! This is a fairly simple compiler as these things go, and I'd be happy to engage with anyone who wants to learn about these beasts in a realistic setting.

permalink

* *
Oct 27, 2020
My little prototype is starting to look like a shell

https://archive.org/details/akkartik-2min-2020-10-27

Promising in some ways, but I'm not sure how to support concurrency. Currently each operation completes before the next. I could allow "pipe stages" to continue to share data after they drop file handles on the stack, but there are problems: how often we refresh, how we kill processes from past refreshes, how we visualize file handle contents.

(More details: https://github.com/akkartik/mu)

permalink

* *
archive
projects
writings
videos
subscribe
Mastodon
RSS (?)
twtxt (?)
Station (?)