*Update on the Mu computer*
Now that we have a bootstrapped (quasi-) language[1] and (kinda) bootstrapped OS[2], we're finally starting to think about less error-prone notations.
This week two of us built a notation for x86 addressing modes:
direct: %ecx
indirect: *ecx
indirect with displacement: *(ecx+4)
indirect with index, scale and displacement: *(ecx + edx<<3 + 4)
Not yet sure this is a good approach. But it'll be fun to playtest.
[1] https://mastodon.social/@akkartik/102495274992610155
[2] https://mastodon.social/@akkartik/102583218576725159
Here's before and after screenshots for factorial.subx.
cc @rain@niu.moe
(project link: https://github.com/akkartik/mu#readme)
*Update on the Mu computer*
Now that we have a notation for addressing modes, we're designing syntax for function calls.
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: http://akkartik.github.io/mu/html/apps/calls.subx.html
Uses the just-created addressing mode notation! (https://mastodon.social/@akkartik/102681693471237779)
More info: https://github.com/akkartik/mu#readme
@rain@niu.moe @vertigo
*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.
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.
@rain@niu.moe @vertigo