With apologies to Robert Pirsig:
Is it a language, or an operating system, or a virtual machine?
Mu.
Read these first: problem statement,
readme and installation
instructions (mu requires minimal dependencies).
Mu's code looks quite alien, requiring editors to be specially configured to
colorize it in a sane manner. So this page provides links to the source files
showing how it currently looks in my custom setup.
Whetting your appetite: some example programs.
- x.mu: a simple program to add two numbers
together. Shows that at bottom mu is a simple VM bytecode designed to convert
directly to machine code.
- factorial.mu: everyone's favorite
example, showing how mu supports conditionals and loops without any special
syntax, using the special labels '{' and '}'.
- tangle.mu: another (contrived) version
of factorial showing mu's ability to 'tangle' code from multiple places into a
single function or 'recipe'.
- counters.mu: lexical scope
- callcc.mu: first-class continuations. Mu
also supports first-class functions and delimited continuations.
- simple examples showing off support for concurrency: fork.mu,
channel.mu
- simple examples showing off hardware control: display.mu,
keyboard.mu.
- screen.mu: example program showing
print primitives that inject a screen dependency which can be faked
for testing.
- chessboard.mu: putting it all
together, the big kahuna: a complete console program along with thorough tests
of its behavior including both screen and keyboard handling.
Part I: basic infrastructure
000organization.cc: the basic
skeleton program. Compiles and runs but doesn't do much. Later layers
hook into this skeleton to add functionality. Mu's guarantee: you can load
features up until any layer, and it will compile and pass all tests until
that point. More details →
001help.cc: just a simple test layer
to show how to hook into the skeleton. Also summarizes how to invoke mu,
behaviors that later layers will be providing.
002test.cc: mu's minimalist test
harness, relying on a couple of one-liners in the makefile to autogenerate
lists of tests to run.
003trace.cc: support for logging
facts about our program, and for checking the facts logged in tests.
(tests for the test harness)
Part II: the mu virtual machine, designed to compile easily to
machine language.
010vm.cc: core data structures: recipes
(functions), instructions and reagents (operands).
011load.cc: the textual representation
of recipes and how it's turned into the data structures.
012transform.cc: after mu
programs are loaded but before they are run they can be transformed in an
extensible manner akin to lisp macros. Think of this as the core of mu's
‘compiler’ for providing high-level features atop the core.
013literal_string.cc: extend
the loader to support literal strings in various instructions.
014literal_noninteger.cc:
extend the loader to support non-integer numbers.
020run.cc: executing mu recipes by
executing the list of instructions they contain.
Various primitive operations: on numbers,
booleans, for control flow,
and comparing values.
Primitive operations to help with testing: tracing/logging,
assert and
debug by print.
030container.cc: compound types
akin to records, structs or classes.
031address.cc: adding and removing
layers of indirection to mu data.
032array.cc: all mu # Release Guide
Usually release candidates are tagged 0.6.0.rc1, 0.6.0.rc2 and tested for a week or so.
* Release libstrophe and libmesode if required
* Run Unit tests: `make check-unit`
* Run Functional tests - Currently disabled
* Run