.. | ||
apps | ||
bootstrap | ||
browse | ||
tile | ||
000init.subx | ||
100.txt | ||
101_write.subx | ||
102test.subx | ||
103kernel-string-equal.subx | ||
104new-segment.subx | ||
105string-equal.subx | ||
106stream.subx | ||
107trace.subx | ||
108write.subx | ||
109stream-equal.subx | ||
110stop.subx | ||
111read.subx | ||
112read-byte.subx | ||
113write-stream.subx | ||
114error.subx | ||
115write-byte.subx | ||
116write-buffered.subx | ||
117write-int-hex.subx | ||
118parse-hex-int.subx | ||
119error-byte.subx | ||
120allocate.subx | ||
121new-stream.subx | ||
122read-line.subx | ||
123slice.subx | ||
124next-token.subx | ||
125write-stream-data.subx | ||
126write-int-decimal.subx | ||
127next-word.subx | ||
128subx-words.subx | ||
129emit-hex.subx | ||
130emit.subx | ||
131table.subx | ||
132slurp.subx | ||
133subx-widths.subx | ||
134emit-hex-array.subx | ||
135next-word-or-string.subx | ||
200.txt | ||
201register-names.subx | ||
202write-int.subx | ||
203stack.subx | ||
300.txt | ||
301array-equal.subx | ||
302stack_allocate.subx | ||
303kernel-string.subx | ||
304screen.subx | ||
305keyboard.subx | ||
306files.subx | ||
307size.subx | ||
308allocate-array.subx | ||
309stream.subx | ||
310copy-bytes.subx | ||
311decimal-int.subx | ||
312copy.subx | ||
313index-bounds-check.subx | ||
314divide.subx | ||
315slice.subx | ||
400.mu | ||
401test.mu | ||
402time.mu | ||
403unicode.mu | ||
404stream.mu | ||
405screen.mu | ||
406int32.mu | ||
407right-justify.mu | ||
408float.mu | ||
409print-float-hex.mu | ||
410file.mu | ||
411string.mu | ||
412print-float-decimal.mu | ||
assort | ||
assort.subx | ||
braces | ||
braces.subx | ||
branches.mu | ||
branches.out | ||
calls | ||
calls.subx | ||
dquotes | ||
dquotes.subx | ||
help | ||
hex | ||
hex.subx | ||
labels_baremetal | ||
labels_baremetal.subx | ||
mu | ||
mu-init-test.subx | ||
mu-init.subx | ||
mu.subx | ||
pack | ||
pack.subx | ||
README.md | ||
sigils | ||
sigils.subx | ||
stack_array.subx | ||
stats.txt | ||
subx_debugging.md | ||
subx-params.subx | ||
survey_baremetal | ||
survey_baremetal.subx | ||
survey_elf | ||
survey_elf.subx | ||
test_apps | ||
test_apps_emulated | ||
tests | ||
tests.subx | ||
translate | ||
translate_debug | ||
translate_emulated | ||
translate_subx | ||
translate_subx_debug | ||
translate_subx_emulated | ||
vocabulary.md | ||
x86_approx.md |
This directory contains Mu programs and infrastructure that require a Linux
kernel. To run programs under this directory, you must first cd
into it.
$ cd linux/
$ ./translate apps/hello.mu # generates a.elf
$ ./a.elf
Hello world!
See the shared vocabulary of data types and functions shared by Mu programs running on Linux. Mu programs can transparently call low-level functions written in SubX.
Some programs to try out:
-
tile
: An experimental live-updating postfix shell environment that updates as you type. Prototype. Look at this to see what is currently possible, not how I recommend building software. -
apps/ex*
: small stand-alone examples that don't need any of the shared code at the top-level. They each have a simple pedagogical goal. Read these first. -
apps/factorial*
: A simple program to compute factorials in 5 versions, showing all the different syntax sugars and what they expand to.
The Mu compiler toolchain is also here in the following phases:
- Bare SubX:
hex
,survey_elf
,pack
,dquotes
,assort
,tests
- Syntax sugar for SubX:
sigils
,calls
,braces
- Mu->SubX compiler:
mu
. Compiles most statements to a single instruction of machine code.
The toolchain includes binaries in the repo. At any commit, the binary should
be identical bit for bit with the result of translating the corresponding
.subx
file. The binary should also be natively runnable on a Linux system
running on Intel x86 processors, either 32- or 64-bit. If either of these
invariants is violated, it's a bug.