mu/linux
Kartik K. Agaram f99cd767a4 periodic run of misc_checks
I should really stop using /disp8 jumps at the top-level given how inconvenient
it is to check for overly large offsets.
2021-06-12 22:34:22 -07:00
..
advent2020 7867 2021-03-07 21:05:45 -08:00
bootstrap periodic run of misc_checks 2021-06-12 22:34:22 -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
100.txt . 2021-03-29 18:47:52 -07:00
101_write.subx
102test.subx
103kernel-string-equal.subx 7847 2021-03-04 00:24:24 -08:00
104new-segment.subx
105string-equal.subx
106stream.subx
107trace.subx
108write.subx
109stream-equal.subx
110stop.subx
110stop.subx.
110stop.subx.0
111read.subx
112read-byte.subx
113write-stream.subx
114error.subx
115write-byte.subx
116write-buffered.subx
117write-int-hex.subx
118parse-hex-int.subx 7867 2021-03-07 21:05:45 -08:00
119error-byte.subx
120allocate.subx
121new-stream.subx
122read-line.subx
123slice.subx
124next-token.subx
125write-stream-data.subx
126write-int-decimal.subx undo previous commit 2021-04-05 21:16:45 -07:00
127next-word.subx
128subx-words.subx 7867 2021-03-07 21:05:45 -08:00
129emit-hex.subx
130emit.subx 7867 2021-03-07 21:05:45 -08:00
131table.subx
132slurp.subx
133subx-widths.subx
134emit-hex-array.subx
135next-word-or-string.subx
200.txt . 2021-03-29 18:47:52 -07:00
201register-names.subx
202write-int.subx
203stack.subx
300.txt
301array-equal.subx
302stack_allocate.subx
303kernel-string.subx
304screen.subx . 2021-05-14 23:15:46 -07:00
305keyboard.subx
306files.subx . 2021-05-14 07:59:32 -07:00
307size.subx
308allocate-array.subx
309stream.subx
310copy-bytes.subx
311decimal-int.subx . 2021-05-14 23:15:46 -07:00
312copy.subx
313index-bounds-check.subx always check for null in 'index' instructions 2021-05-07 21:04:45 -07:00
314divide.subx
315slice.subx
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
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
406int32.mu
407right-justify.mu
408float.mu
409print-float-hex.mu
410file.mu
411string.mu
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 shell: expand set of possible errors 2021-06-08 20:21:39 -07:00
mu-init-test.subx
mu-init.subx
mu.subx shell: expand set of possible errors 2021-06-08 20:21:39 -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
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
translate_debug
translate_emulated
translate_subx
translate_subx_debug
translate_subx_emulated
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.