*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
```
*Update on the Mu computer's memory-safe language*
Basic language is done! Here's factorial. (Compare https://mastodon.social/@akkartik/102749590808384215.)
Still todo:
- user-defined types
- type checking and memory-safety
In other words, I'm about a third of the way there 😂 More detailed todo list: https://lobste.rs/s/pv8jpr/what_are_you_doing_this_week#c_5ymbsa
(More details on the Mu project: http://akkartik.name/post/mu-2019-1. Repo: https://github.com/akkartik/mu)
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)