*Update on the Mu computer's memory-safe language*
Progress has been slow over the holiday season because I've been working on a paper about Mu for https://2020.programming-conference.org/home/salon-2020
But functions can now return outputs.
```
fn foo a: int -> result/eax: int {
result <- copy a
increment result
}
```
Project page: https://github.com/akkartik/mu#readme
Sources for the memory-safe language, now at 5kLoC: http://akkartik.github.io/mu/html/apps/mu.subx.html
Caveats: no checking yet, only int types supported.
*Update on the Mu computer's memory-safe language*
Still no type-checking or memory-safety, but we can now write any programs with int variables.
There's still no 'var' keyword, so we can't define local variables yet. But that's not insurmountable; just pass in extra arguments for any space you want on the stack 😀
```
result <- factorial n 0 0 0
```
I should probably highlight register names. Here's an updated screenshot.
(Yes, in Mu you manually allocate registers. Mu will eventually check your allocation.)
I just wrote up a cheatsheet of all the instructions supported by Mu (best on a wide screen/window):
https://raw.githubusercontent.com/akkartik/mu/master/mu_instructions
It's not clean. Mu isn't a clean, well-designed language. Because it's designed to map 1:1 with x86, and x86 is not a clean, well-designed instruction set.
But this sort of 1-page summary of a compiler is something I've always wished I had. Something that doesn't tell you what to type out and then pretend you understand compilers (https://compilers.iecc.com/crenshaw/tutor2.txt)