CosmicOS: a next-generation Contact message

CosmicOS is a way to create stand-alone messages suitable for conversations across large gulfs of time and space. It is a preamble you can borrow to bootstrap up to a decent shared vocabulary, without making too many assumptions. CosmicOS is inspired by Hans Freudenthal's language, Lincos, and Carl Sagan's book, Contact.

The message consists of a long sequence of four basic symbols. Labeling them arbitrarily as 0, 1, 2, and 3, the message begins like this:
00010223300011022330001110223300011110223300011111022330001111110223300011111110
22330001111111102233000111111111022330001111111111022330001111111111102233000111
11111111102233000111111111111102233000111111111111110223300011111111111111102233
00011111111111111110223300011022330001110223300011111022330001111111022330001111
11111110223300011111111111110223300010223300011110223300011111111102233000111111
11111111110223301100100102233011001100110223301100111001110223301100111100111102
23301100111110011111022330110011111100111111022330110011111110011111110223301100

...
see full 272615-symbol message

Or reformatting into Ogham-style script (because: why not?)

ᚁᚁᚁᚆᚁᚗ
ᚁᚁᚁᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚁᚗ
ᚁᚁᚁᚆᚆᚆᚆᚆᚆᚆᚆᚆᚁᚗ
...
see full message

The message communicates:

The idea is to communicate the usual math and logic basics, then use that to show how to run programs, then send interesting programs that demonstrate behaviors and interactions that get at fuzzier stuff. This is inspired by Freudenthal's idea of staging conversations between Ha and Hb that happen to be about math but which get at ideas like helpful versus unhelpful.

Message in human-readable form

This form of the message is close to the actual “source code” of the message, and should be much easier to read (especially if you are a programmer).

0introduce numbers (in unary notation)MATH
1introduce equality for unary numbersMATH
2now introduce other relational operatorsMATH
3introduce the NOT logical operatorMATH
4introduce additionMATH
5introduce subtractionMATH
6introduce multiplicationMATH
7introduce a simple form of binary notationMATH
8show local assignmentMATH
9demonstrate existence of memoryMATH
10use equality for truth valuesMATH
11show mechanisms for branchingMATH
12introduce the AND logical operatorMATH
13introduce the OR logical operatorMATH
14illustrate pairsMATH
15introduce mutable objects, and side-effectsMATH
16illustrate lists and some list operatorsMATH
17describe changes to the implicit interpreter to allow new special formsHACK
18introduce sugar for letMATH
19build up functions of several variablesMATH
20show map function for applying a function across the elements of a listMATH
21end of part 1, start of part 2NOTE
22show an example of recursive evaluationMATH
23some pure lambda calculus definitions - optionalMATH
24introduce universal quantifierMATH
25introduce existential quantifierMATH
26introduce logical implicationMATH
27introduce sets and set membershipMATH
28introduce graph structuresMATH
29show how to execute a sequence of instructionsMATH
30introduce environment/hashmap structureMATH
31introduce simple mutable structuresOBJECT
32introduce method handler wrappersOBJECT
33introduce turing machine modelTURING
34introduce simple form of typing, for ease of documentation.OBJECT
35an example object -- a 2D pointOBJECT
36an example object -- a containerOBJECT
37expressing inheritanceOBJECT
38adding a special form for classesOBJECT
39wrapper class for cellsOBJECT
40playing around with doors and roomsMUD
41end of part 2, start of part 3NOTE
42simulating unless gatesGATE
43testing alternate primer based on gates: cos_not circuitGATE
44testing alternate primer based on gates: cos_and circuitGATE
45testing alternate primer based on gates: cos_or circuitGATE
46testing alternate primer based on gates: cos_nor circuitGATE
47testing alternate primer based on gates: cos_osc circuitGATE
48testing alternate primer based on gates: cos_sr circuitGATE
49testing alternate primer based on gates: cos_d circuitGATE
50probing networks of unless gatesGATE
51end of part 3, start of part 4NOTE
52a mechanism for referring to parts of the messageSELF
53some preparatory work for integrating with Java codeJAVA
54class translation 'COS_JavaTest'JAVA
55check that automatic conversion is workableJAVA
56another simple little text-adventure spaceMUD
57native implementation of a Java list, hash classesJAVA
58testing the JList classJAVA
59basic iterator implementationJAVA
60class translation 'COS_JDoor'JAVA
61class translation 'COS_JThing'JAVA
62class translation 'COS_JRoom'JAVA
63class translation 'COS_JNamed'JAVA
64class translation 'COS_JWorld'JAVA
65class translation 'COS_JRobo'JAVA
66test JRoom, JDoor, JThing, etcJAVA

Statistics and structure

Estimate of message entropy in compiled form: 25.3 kB.

There are bugs and rough edges in the message. Please be forgiving. It'll all get fixed in an instant of galactic time. The structure is as follows:

The generated message currently consists of a sequence of 4 symbols.

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

And two pseudo-symbols coded using the above:

  sequence  symbol   meaning
    .()        /     opens an implicit paren, which will close at next paren
                     (A B / C / D) is another way to write (A B (C (D)))
                     This greatly simplifies complex expressions.
    (())       ;     marks end of sentence

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 binary. 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.

License

I've chosen the GPL for whimsical reasons. If it is a problem for you just file an issue. I'm a license push-over.

CC-GNU GPL
The CosmicOS software is licensed under the CC-GNU GPL.
Creative Commons License
The CosmicOS webpages are licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Fork me on GitHub