diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2014-11-01 16:15:15 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2014-11-01 16:15:15 -0700 |
commit | 2c9aa92f56c6f4051216774e9d10f795dd12bf0d (patch) | |
tree | 0bc3101974abe880b2789fbb5d510a498ce787b0 | |
parent | a65fbc8bf91d6cbe7d1d96980c2c0e7c3f6d3713 (diff) | |
download | mu-2c9aa92f56c6f4051216774e9d10f795dd12bf0d.tar.gz |
212 - initial flow
Bring back the example program.
-rw-r--r-- | Readme | 32 | ||||
-rw-r--r-- | x.mu | 5 |
2 files changed, 32 insertions, 5 deletions
diff --git a/Readme b/Readme index 2ae0a6a3..609cb911 100644 --- a/Readme +++ b/Readme @@ -1,8 +1,30 @@ -== Installing +== Taking mu for a spin + Prerequisites: Racket from http://racket-lang.org -$ cd mu -$ git clone http://github.com/arclanguage/anarki + $ cd mu + $ git clone http://github.com/arclanguage/anarki + +Now try a test program. + + $ cat x.mu # simple example to add two numbers + (main + ((x integer) <- copy (1 literal)) + ((y integer) <- copy (3 literal)) + ((z integer) <- add (x integer) (y integer)) + ) + + $ ./anarki/arc mu.arc x.mu + #hash((1 . 1) (2 . 3) (3 . 4)) # state of simulated memory after executing x.mu + +Location z contains the sum of locations x and y. +(You have to imagine that location 3 maps to 'z' for now, sorry..) + +== Now dive in + +Try running the tests: + + $ ./anark/arc mu.arc.t -$ ./anark/arc mu.arc.t # automated tests; start reading here -# mu.arc.t.html might be easier to read in your browser +Now start reading mu.arc.t. The html rendering mu.arc.t.html might be easier +to read in your browser. diff --git a/x.mu b/x.mu new file mode 100644 index 00000000..089db73e --- /dev/null +++ b/x.mu @@ -0,0 +1,5 @@ +(main + ((x integer) <- copy (1 literal)) + ((y integer) <- copy (3 literal)) + ((z integer) <- add (x integer) (y integer)) +) |