CosmicOS version cosmic.0.4

(latest version always available at CosmicOS homepage)


This version of CosmicOS gets as far as a simple type system and the
beginning of an object model.  Still at the "plumbing" level, not
quite ready to run simulations!  The generated message currently
consists of a sequence of 5 symbols.

  number   symbol   meaning
    0         .     binary digit zero
    1         :     binary digit one
    2         (     marks beginning of an expression
    3         )     marks end of an expression
    4         ;     marks end of sentence

There are constraints in the possible transitions between these
symbols that would allow a simple and shorter encoding if desired.
(more version notes at bottom of this page)

reasonably readable form of message
generator of message
final form of message
tarball of all files

Estimate of message entropy in final form: 6.9 kB.

Index of lessons

(all lessons)

0 (MATH) introduce numbers (in unary notation)
1 (MATH) now show equality
2 (MATH) now show other relational operators
3 (MATH) introduce the NOT logical operator
4 (MATH) introduce the AND logical operator
5 (MATH) introduce the OR logical operator
6 (MATH) use equality for truth values
7 (MATH) introduce addition
8 (MATH) introduce subtraction
9 (MATH) introduce multiplication
10 (MATH) introduce a simple form of binary notation
11 (MATH) demonstrate idea of leaving gaps in an expression
12 (MATH) show some simple function calls
13 (MATH) show mechanisms for branching
14 (MATH) some pure lambda calculus definitions - optional
15 (MATH) show an example of recursive evaluation
16 (MATH) introduce universal quantifier
17 (MATH) introduce existential quantifier
18 (MATH) introduce logical implication
19 (MATH) illustrate lists and some list operators
20 (MATH) introduce sets and set membership
21 (MATH) build up functions of several variables
22 (MATH) show map function for applying a function across the elements of a list
23 (MATH) introduce mutable objects, and side-effects
24 (MATH) show how to execute a sequence of instructions
25 (MATH) introduce sugar for let
26 (MATH) introduce environment/hashmap structure
27 (MATH) show a pattern matching mechanism
28 (MATH) introduce a basic type system
29 (MATH) introduce graph structures
30 (OBJECT) introduce simple mutable structures
31 (OBJECT) introduce method handler wrappers
32 (MUD) under development

Further notes

Numbers are encoded as binary digits between parentheses, e.g.  (:::.)
is 1110 base 2 which is 14 in decimal.  A set of numbers between
parentheses constitutes an expression.  Expressions can be nested.
Expressions followed by a semicolon should evaluate to be true, once
the rules for evaluation have been introduced.

In the human-readable form of the message, decimal numbers can be
used.  There are converted to the above form.  Identifiers can also be
used.  Identifiers are mapped onto arbitrarily assigned numbers.
In the message, there is nothing to distinguish identifiers from 
numbers.  The actual language is carefully constructed so that
this distinction is never necessary.

The first number in an expression is treated as an index
into an environment that returns a function.  When
the lambda notation is introduced, it works by modifying
that (nested) environment.  Expressions are evaluated
from the outermost inwards, from left to right, and
lazily.

This "functional style" of expression is not always particularly easy
to follow, even for a human, but it is certainly very expressive.
Currently functional definitions are given alongside numerous examples
that are in many cases sufficient by themselves to communicate the
definition, at least for working purposes.  It is probably important
to maintain this duality and perhaps extend it with other forms
of expression.  There are so many models of computation, why not
use all of them?  Perhaps one will be easier for the reader to follow
than the others.

While it is tempting to try to make the message airtight from a 
formal point of view, defining everything in terms of axioms,
this is just one didactic approach - and may be counter-productive 
or impossible for a a large-scale message that includes AI-complete
concepts.

There are going to be bugs in the message, since there is no automated
checking mechanism in place yet, and it is being cobbled together
quite hastily.  Please be forgiving.  It'll all get fixed in an
instant of galactic time...