mu/linux
Kartik K. Agaram eede9e222f . 2021-05-14 23:15:46 -07:00
..
advent2020 7867 2021-03-07 21:05:45 -08:00
bootstrap support checking overflow flag everywhere 2021-05-08 21:49:50 -07:00
browse 7846 2021-03-04 00:11:23 -08:00
raytracing 7846 2021-03-04 00:11:23 -08:00
tile . 2021-03-29 18:47:52 -07:00
000init.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
100.txt . 2021-03-29 18:47:52 -07:00
101_write.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
102test.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
103kernel-string-equal.subx 7847 2021-03-04 00:24:24 -08:00
104new-segment.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
105string-equal.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
106stream.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
107trace.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
108write.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
109stream-equal.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
110stop.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
110stop.subx. 7842 - new directory organization 2021-03-03 22:21:03 -08:00
110stop.subx.0 7842 - new directory organization 2021-03-03 22:21:03 -08:00
111read.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
112read-byte.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
113write-stream.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
114error.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
115write-byte.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
116write-buffered.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
117write-int-hex.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
118parse-hex-int.subx 7867 2021-03-07 21:05:45 -08:00
119error-byte.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
120allocate.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
121new-stream.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
122read-line.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
123slice.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
124next-token.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
125write-stream-data.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
126write-int-decimal.subx undo previous commit 2021-04-05 21:16:45 -07:00
127next-word.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
128subx-words.subx 7867 2021-03-07 21:05:45 -08:00
129emit-hex.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
130emit.subx 7867 2021-03-07 21:05:45 -08:00
131table.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
132slurp.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
133subx-widths.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
134emit-hex-array.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
135next-word-or-string.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
200.txt . 2021-03-29 18:47:52 -07:00
201register-names.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
202write-int.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
203stack.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
300.txt 7842 - new directory organization 2021-03-03 22:21:03 -08:00
301array-equal.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
302stack_allocate.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
303kernel-string.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
304screen.subx . 2021-05-14 23:15:46 -07:00
305keyboard.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
306files.subx . 2021-05-14 07:59:32 -07:00
307size.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
308allocate-array.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
309stream.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
310copy-bytes.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
311decimal-int.subx . 2021-05-14 23:15:46 -07:00
312copy.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
313index-bounds-check.subx always check for null in 'index' instructions 2021-05-07 21:04:45 -07:00
314divide.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
315slice.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
400.mu 7867 2021-03-07 21:05:45 -08:00
401test.mu update vocabulary documentation 2021-03-08 23:50:35 -08:00
402time.mu 7842 - new directory organization 2021-03-03 22:21:03 -08:00
403unicode.mu 7846 2021-03-04 00:11:23 -08:00
404stream.mu update vocabulary documentation 2021-03-08 23:50:35 -08:00
405screen.mu 7842 - new directory organization 2021-03-03 22:21:03 -08:00
406int32.mu 7842 - new directory organization 2021-03-03 22:21:03 -08:00
407right-justify.mu 7842 - new directory organization 2021-03-03 22:21:03 -08:00
408float.mu 7842 - new directory organization 2021-03-03 22:21:03 -08:00
409print-float-hex.mu 7842 - new directory organization 2021-03-03 22:21:03 -08:00
410file.mu 7842 - new directory organization 2021-03-03 22:21:03 -08:00
411string.mu 7842 - new directory organization 2021-03-03 22:21:03 -08:00
412print-float-decimal.mu update vocabulary documentation 2021-03-08 23:50:35 -08:00
README.md make the library reference easier to find 2021-03-09 00:41:26 -08:00
arith.mu 7867 2021-03-07 21:05:45 -08:00
assort 7867 2021-03-07 21:05:45 -08:00
assort.subx . 2021-03-29 18:47:52 -07:00
braces . 2021-05-14 23:15:46 -07:00
braces.subx . 2021-05-14 23:15:46 -07:00
branches.mu support checking overflow flag everywhere 2021-05-08 21:49:50 -07:00
branches.out support checking overflow flag everywhere 2021-05-08 21:49:50 -07:00
calls . 2021-05-14 23:15:46 -07:00
calls.subx . 2021-05-14 23:15:46 -07:00
crenshaw2-1.subx . 2021-03-29 18:47:52 -07:00
crenshaw2-1b.subx . 2021-03-29 18:47:52 -07:00
dquotes 7867 2021-03-07 21:05:45 -08:00
dquotes.subx . 2021-03-29 18:47:52 -07:00
ex1.mu 7846 2021-03-04 00:11:23 -08:00
ex1.subx undo previous commit 2021-04-05 21:16:45 -07:00
ex2.mu 7846 2021-03-04 00:11:23 -08:00
ex2.subx . 2021-03-29 18:47:52 -07:00
ex3.2.mu 7846 2021-03-04 00:11:23 -08:00
ex3.mu 7846 2021-03-04 00:11:23 -08:00
ex3.subx . 2021-03-29 18:47:52 -07:00
ex4.subx . 2021-03-29 18:47:52 -07:00
ex5.subx . 2021-03-29 18:47:52 -07:00
ex6.subx . 2021-03-29 18:47:52 -07:00
ex7.subx . 2021-03-29 18:47:52 -07:00
ex8.subx . 2021-03-29 18:47:52 -07:00
ex9.subx . 2021-03-29 18:47:52 -07:00
ex10.subx . 2021-03-29 18:47:52 -07:00
ex11.subx . 2021-03-29 18:47:52 -07:00
ex12.subx . 2021-03-29 18:47:52 -07:00
ex13.subx . 2021-03-29 18:47:52 -07:00
ex14.subx . 2021-03-29 18:47:52 -07:00
factorial.mu . 2021-03-29 18:47:52 -07:00
factorial.subx . 2021-03-29 18:47:52 -07:00
factorial2.subx . 2021-03-29 18:47:52 -07:00
factorial3.subx . 2021-03-29 18:47:52 -07:00
factorial4.subx . 2021-03-29 18:47:52 -07:00
hello.mu 7846 2021-03-04 00:11:23 -08:00
help make online help more obvious 2021-04-04 20:12:43 -07:00
hex 7867 2021-03-07 21:05:45 -08:00
hex.subx . 2021-03-29 18:47:52 -07:00
labels_baremetal . 2021-05-14 23:15:46 -07:00
labels_baremetal.subx . 2021-05-14 23:15:46 -07:00
mu . 2021-05-14 23:15:46 -07:00
mu-init-test.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
mu-init.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
mu.subx . 2021-05-14 23:15:46 -07:00
pack fix a failing test in pack.subx 2021-03-15 21:28:15 -07:00
pack.subx . 2021-03-29 18:47:52 -07:00
parse-int.mu 7846 2021-03-04 00:11:23 -08:00
print-file.mu 7846 2021-03-04 00:11:23 -08:00
random.subx . 2021-03-29 18:47:52 -07:00
rpn.mu 7867 2021-03-07 21:05:45 -08:00
sigils . 2021-05-14 23:15:46 -07:00
sigils.subx . 2021-05-14 23:15:46 -07:00
stack_array.subx . 2021-03-24 09:12:32 -07:00
stats.txt . 2021-03-29 18:47:52 -07:00
subx-params.subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
subx_debugging.md 7847 2021-03-04 00:24:24 -08:00
survey_baremetal insert a compile phase to emit some debug info 2021-05-14 11:54:42 -07:00
survey_baremetal.subx insert a compile phase to emit some debug info 2021-05-14 11:54:42 -07:00
survey_elf . 2021-05-14 23:15:46 -07:00
survey_elf.subx . 2021-05-14 23:15:46 -07:00
test_apps insert a compile phase to emit some debug info 2021-05-14 11:54:42 -07:00
test_apps_emulated insert a compile phase to emit some debug info 2021-05-14 11:54:42 -07:00
tests 7867 2021-03-07 21:05:45 -08:00
tests.subx . 2021-03-29 18:47:52 -07:00
texture.mu 7846 2021-03-04 00:11:23 -08:00
translate 7842 - new directory organization 2021-03-03 22:21:03 -08:00
translate_debug 7842 - new directory organization 2021-03-03 22:21:03 -08:00
translate_emulated 7842 - new directory organization 2021-03-03 22:21:03 -08:00
translate_subx 7842 - new directory organization 2021-03-03 22:21:03 -08:00
translate_subx_debug 7842 - new directory organization 2021-03-03 22:21:03 -08:00
translate_subx_emulated 7842 - new directory organization 2021-03-03 22:21:03 -08:00
tui.mu 7846 2021-03-04 00:11:23 -08:00
vocabulary.md . 2021-03-12 10:41:03 -08:00
x86_approx.md . 2021-03-26 22:22:54 -07:00

README.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 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.

    tile app
  • browse: A text-mode browser for a tiny subset of Markdown.

  • 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.

  • 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.