Hopefully it'll make sense to me at least in a month or two.
https://github.com/grokthis/ucisc/blob/master/docs/01_Introduction.md
Still super early days. There's a nascent VM. Needless to say, I'll be contributing.
Still no type-checking or memory-safety, but we have partial support for arrays and product types. Still several sharp edges:
- can't index an array with a literal
- can't index an array with non-power-of-2-sized elements
- can allocate but not use arrays/records on the stack
My todo list is growing. But work per item is shrinking. Hopefully there's an asymptote.
Mu just got its first couple of non-integer types: addresses and arrays. As a result, the factorial app can finally run its tests based on command-line args.
http://akkartik.github.io/mu/html/apps/factorial.mu.html
Addresses are accessed using a '*' operator. Arrays are accessed using an index
instruction that takes an address (addr array T
) and returns an address (addr T
).
Literal indexes aren't supported yet.
Open question: indexing arrays of non-power-of-2 element sizes.
Jul 6, 2014: commit 0, tree-based interpreter for a statement-oriented language
Jul 19, 2017: commit 3930, start of SubX machine code
Sep 20, 2018: started building SubX in SubX
Jul 24, 2019: SubX in SubX done, commit 5461
Oct 2, 2019: started designing the Mu memory-safe language
Oct 29: started http://akkartik.github.io/mu/html/apps/mu.subx.html
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.
Basic language is done! Here's factorial. (Compare with SubX.)
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.
(More details on the Mu project. Repo)
I should probably highlight register names. Here's an updated screenshot.
(Yes, in Mu you manually allocate registers. Mu will eventually check your allocation.)