Oct 15, 2019
Update on the Mu computer

I just wrote up a summary of the state of Mu, in two parts.

Part 1 summarizes the past year as a sequence of major design decisions:

http://akkartik.name/post/mu-2019-1

Part 2 is a sketch of what I plan to build next, again structured as a sequence of design decisions:

http://akkartik.name/post/mu-2019-2

(The flow from design constraints to decisions is inspired by Christopher Alexander.)

Any and all feedback appreciated. I'd like it to be clear to any programmer.

permalink

* *
Oct 2, 2019
I'm thinking about https://zge.us.to/dirconf.html

What if cating a directory rendered its contents as a structured file?

First reaction: get rid of directories altogether. But it seems useful to firewall off different kinds of content from each other.

Still, the file system could support treating files as dirs.

It seems useful to have consistent lexical conventions spanning paths and code: '#' for comments; '.' for lookup; '/' for metadata. E.g. to look up gitconfig:

cat ~.conf.git.core.pager

Metadata is a new idea here; I use it extensively in my Mu project. In this context, one possible use for it is extensions. Rewriting the above example:

cat ~.conf.git/yaml.core.pager

Swapping the usual meanings of '/' and '.' in Unix seems maximally confusing. I'm choosing here to preserve the meaning of '.' in source code. But that may be the wrong choice.

Anyways, back to metadata. It permits multiple extensions. Say for a MS Word doc:

thesis/doc/docx/doc-v2007

permalink

* *
Sep 30, 2019
I'm poking at https://github.com/ozkl/soso trying to figure out where it first switches from Ring 0 to Ring 3. I want to rip out all of that protection stuff and just run everything in Ring 0. Just as an exercise for starters, but also eventually because I have.. notions.

After various attempts to grep, the current plan: I'm going to just try to write to some protected address at various points in the kernel, and binary-search my way to the solution. Let's see how this goes.

https://github.com/akkartik/mu#readme

On the language side I've been thrashing a fair bit:

  • Between the OS side vs the language side.
  • Between building an interpreted, dynamically-typed language in machine code vs a compiled, statically-typed memory-safe language that I can build the interpreted language out of.
  • Between building a Lisp interpreter vs a better shell (in the spirit of Oil shell).
  • Between making local vars in the compiled language function-scoped vs block-scoped.

permalink

* *
Sep 20, 2019
Update on the Mu computer

We now have structured control flow (with goto statements 😂 )

Compare this screenshot with the ones in the previous message of this thread.

Structured programming using curly braces and break/loop statements.

At this point I think I've climbed as far up the ladder of abstractions as I can with just syntax sugar. The next step up will be a new language. It'll still look the same: registers, curly braces, one operation to a line. But operations won't be x86 opcodes anymore. Registers and operands will have types.

permalink

* *
Sep 14, 2019
Update on the Mu computer

A few days ago I found out about a hobbyist OS called Soso.

Today I've gotten Mu running on it well enough to make it a first-class supported platform alongside Linux.

https://github.com/akkartik/mu#readme

LoC of C I depend on thus goes down from 12M to 33k.

It's not a complete replacement, though. I still plan to work with Linux, particularly for its networking support. But it's so cool to have a minimal stack supporting graphics!

permalink

* *
Sep 6, 2019
Update on the Mu computer

Syntax sugar for function calls is done. Here's factorial with no sugar, addressing modes and function calls, respectively.

Version 0 without any syntax sugar takes up 50 lines and 180 columns for factorial and one unit test.

Version 1 with syntax sugar for addressing modes takes up 50 lines and 40 columns.

Version 2 with syntax sugar for addressing modes _and_ function calls takes up just 28 lines and 40 columns.

Time now to start building a proper language, to occupy C's niche on this new stack. Type-safe, memory-safe, manual (but safe) memory management, manual (but safe) register allocation.

Though I might build a toy Lisp first. I figure I've earned some fun. Seeing a computer boot into a REPL would qualify.

https://github.com/akkartik/mu#readme

permalink

* *
Sep 3, 2019
How SubX code has evolved over the past year

2018/Jul/30

2019/Sep/03

The first thing that pops out is that lines have gotten narrower.

Or have they? Scroll down and some long lines start to show up. Even if you ignore trailing comments. Check out the screenshot. Lines wider than 80 characters translate to 2-byte jump instructions. I wonder if I've lost my sense of proportion somewhere along the way.

Screenshot of a terminal pipeline generating the longest lines of code in https://github.com/akkartik/mu/blob/904a053e9c3b55079ea842eb0c4447e0b8cb1022/apps/calls.subx

permalink

* *
Sep 2, 2019
Update on the Mu computer

Now that we have a notation for addressing modes, we're designing syntax for function calls.

Expansion for a single Subx function call in s-expression format.

It's easiest to parse if we start with a paren and avoid commas. However, the similarity to s-expressions is only skin deep. There can only be 2 levels of parens, and args can't do arbitrary arithmetic.

Pseudocode
Uses the just-created addressing mode notation!

More info: https://github.com/akkartik/mu#readme

permalink

* *
Aug 31, 2019
More deletions later, LoC in my fork of the Linux kernel are down from 27.1M to 12.3M. Goal is to only support lowest-common-denominator devices.

https://github.com/akkartik/mu#readme

(My line-counting was way off earlier.)

permalink

* *
Aug 30, 2019
Reason #83 to fork the Linux Kernel

I get to see my name and picture on a git log alongside Linus Torvalds's.

https://github.com/akkartik/kernel#readme

permalink

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