With apologies to Robert Pirsig:
Is it a language, or an operating system, or a virtual machine?
Mu.
Read these first: problem statement,
trying out Mu.
(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.
- simple examples showing off support for concurrency: fork.mu,
channel.mu
- simple examples showing off hardware control: display.mu,
console.mu.
- screen.mu: example program showing
print primitives that inject a 'screen' dependency which can be faked
for testing.
- filesystem.mu: example program
showing file primitives that inject a 'filesystem' dependency which can be
faked for testing.
- http-client.mu and http-server.mu,
examples of Mu's testable high-level interfaces to the network.
- static-dispatch.mu: example
program showing Mu's ability to define recipes with headers, and thereby to
allow functions with the same name but arguments of different types to
coexist.
- counters.mu: lexical scope
- chessboard.mu: a little program for
2 people to play chess, with thorough tests of its behavior including both
screen and keyboard handling.
- nqueens.mu: a solution to the N queens problem.
- Example programs using delimited continuations:
1,
2,
3,
generated by cgit-pink 1.4.1-2-gfad0 (git 2.36.2.497.gbbea4dcf42) at 2024-12-03 11:00:44 +0000