This commit is contained in:
parent
fe72699390
commit
6508ab51cc
|
@ -1,8 +1,14 @@
|
||||||
A set of standard libraries for building programs that run with just a Linux
|
This directory contains Mu programs and infrastructure that require a Linux
|
||||||
kernel. Most programs here read from stdin and write to stdout. One of these
|
kernel. To run programs under this directory, you must first `cd` into it.
|
||||||
programs is the Mu compiler ([colorized sources](http://akkartik.github.io/mu/html/apps/mu.subx.html)).
|
|
||||||
|
|
||||||
Other apps beyond the Mu toolchain:
|
```sh
|
||||||
|
$ cd linux/
|
||||||
|
$ ./translate hello.mu # generates a.elf
|
||||||
|
$ ./a.elf
|
||||||
|
Hello world!
|
||||||
|
```
|
||||||
|
|
||||||
|
Some programs to try out:
|
||||||
|
|
||||||
* `tile`: [An experimental live-updating postfix shell environment](https://mastodon.social/@akkartik/105108305362341204)
|
* `tile`: [An experimental live-updating postfix shell environment](https://mastodon.social/@akkartik/105108305362341204)
|
||||||
that updates as you type. Prototype. Look at this to see what is currently
|
that updates as you type. Prototype. Look at this to see what is currently
|
||||||
|
@ -18,10 +24,11 @@ Other apps beyond the Mu toolchain:
|
||||||
* `factorial*`: A simple program to compute factorials in 5 versions, showing
|
* `factorial*`: A simple program to compute factorials in 5 versions, showing
|
||||||
all the different syntax sugars and what they expand to.
|
all the different syntax sugars and what they expand to.
|
||||||
|
|
||||||
The Mu toolchain is also here in the following phases:
|
The Mu compiler toolchain is also here in the following phases:
|
||||||
* Core SubX: `hex`, `survey_elf`, `pack`, `dquotes`, `assort`, `tests`
|
|
||||||
|
* Bare SubX: `hex`, `survey_elf`, `pack`, `dquotes`, `assort`, `tests`
|
||||||
* Syntax sugar for SubX: `sigils`, `calls`, `braces`
|
* Syntax sugar for SubX: `sigils`, `calls`, `braces`
|
||||||
* More ambitious translator for a memory-safe language (in progress): `mu`
|
* Mu->SubX compiler: `mu`
|
||||||
|
|
||||||
The toolchain includes binaries in the repo. At any commit, the binary should
|
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
|
be identical bit for bit with the result of translating the corresponding
|
||||||
|
|
|
@ -27,9 +27,9 @@ Entry:
|
||||||
== data
|
== data
|
||||||
|
|
||||||
Size: # size of string
|
Size: # size of string
|
||||||
0x0e/imm32 # 14
|
0x0d/imm32 # 13
|
||||||
X: # string to print
|
X: # string to print
|
||||||
48 65 6c 6c 6f 2c 20 77 6f 72 6c 64 21 0a 00
|
48 65 6c 6c 6f 20 77 6f 72 6c 64 21 0a 00
|
||||||
# H e l l o , ␣ w o r l d ! newline null
|
# H e l l o ␣ w o r l d ! newline null
|
||||||
|
|
||||||
# . . vim:nowrap:textwidth=0
|
# . . vim:nowrap:textwidth=0
|
||||||
|
|
|
@ -24,8 +24,7 @@ $ ./a.elf type
|
||||||
|
|
||||||
## hacking
|
## hacking
|
||||||
|
|
||||||
Unlike the top-level directory, this is just a prototype so far. There are no
|
This is just a prototype. There are no tests.
|
||||||
tests.
|
|
||||||
|
|
||||||
To add a new primitive you'll need to hard-code it into the `evaluate`
|
To add a new primitive you'll need to hard-code it into the `evaluate`
|
||||||
function (apps/tile/rpn.mu).
|
function (apps/tile/rpn.mu).
|
||||||
|
|
Loading…
Reference in New Issue