*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 2020.programming-conference.or

But functions can now return outputs.

fn foo a: int -> result/eax: int {
result <- copy a
increment result

Project page: github.com/akkartik/mu#readme

Sources for the memory-safe language, now at 5kLoC: akkartik.github.io/mu/html/app

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 mastodon.social/@akkartik/1027.)

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: lobste.rs/s/pv8jpr/what_are_yo

(More details on the Mu project: akkartik.name/post/mu-2019-1. Repo: github.com/akkartik/mu)

I should probably highlight register names. Here's an updated screenshot.

(Yes, in Mu you manually allocate registers. Mu will eventually check your allocation.)

· · Web · 1 · 0 · 0

I just wrote up a cheatsheet of all the instructions supported by Mu (best on a wide screen/window):


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 (compilers.iecc.com/crenshaw/tu)

Sign in to participate in the conversation

The original server operated by the Mastodon gGmbH non-profit