Coding for contact

CosmicOS is a way to create messages suitable for communication across large gulfs of time and space. It is inspired by Hans Freudenthal's language, Lincos, and Carl Sagan's book, Contact. CosmicOS, at its core, is a programming language, capable of expressing simulations. Simulations are a way to talk, by anology, about the real thing they model.

CosmicOS is structured 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, and start communicating ideas through ”theater” and simulations. This is inspired by Freudenthal's idea of staging conversations between his imaginary characters Ha and Hb.

Message sections

0introduce numbers (in unary notation)
unaryis:intis:squareis:prime
11show conditionals
ifmaxminfactorial
14introduce pairs
conscarcdr
15introduce mutable cells
make-cellset!get!
16introduce lists
listundefinedheadtaillist-lengthlist-reffunction?equallist=prependpairfirstsecond
19some more list functions
list:findlastexcept-lastlist:reverseappendselect-match
20introduce pi and e
minusfracabswithinrangeevenodddecimalepipower:10pow:intpowexp
25some pure lambda calculus definitions - optional
pure:ifpure:truepure:falsepure:conspure:carpure:cdrpure:0pure:1pure:2pure:nextpure:+pure:*pure:prevpure:=:0fixed-pointpure:int:get
29introduce sets and set membership
elementset:<=set:=set:0
30introduce graph structures
graph:makeexists:graph:2exists:graph:2:list
32introduce environment/hashmap structure
hash-addhash-refhash-nullhash-defaultmake-hash
34introduce turing machine model
tape:dotape:maketape:resultdemo:tape:function:+:1
42introduce the elements
protonelectronneutronmasshydrogenheliumcarbonnitrogenoxygenhydrogen:2oxygen:2oxygen:3waternitrogen:2ammoniamethaneethane
44simulating unless gates
unlessmake-matrixmatrix-setmatrix-getsimulate-unlessbit-getmake-imageimage-getimage-heightimage-widthdistill-circuit

Message in 4-symbol form

Traditionally, CosmicOS has been represented as a long sequence of four symbols. Labeling them arbitrarily as 0, 1, 2, and 3, the message begins like this:

12100103121113223312100103121211000031211000133223312121100003121100013302312111
30203223312121100003121100013302312111302130203223312121100003121100013302312111
30213021302032233121211000031211000133023121113021302130213020322331212110000312
11000133023121113021302130213021302032233121211000031211000133023121113021302130
21302130213020322331212110000312110001330231211130213021302130213021302130203223
31212110000312110001330231211130213021302130213021302130213020322331212110000312
11000133023121113021302130213021302130213021302130203223312121100003121100013302
...
see full 337013-symbol message

Estimating message entropy by compressing this message, we get: 27 kB. This message form has some major revisions pending to ease comprehension. Please be forgiving. It'll all get fixed in an instant of galactic time.

General structure

The message is organized as follows:

The message uses the following syntax (shown in plain-text form):

  symbol   meaning
     (     marks beginning of an expression
     )     marks end of an expression
     |     opens a parenthesis which will self-close at the next parenthesis.
           (A B | C | D) is another way to write (A B (C (D))).
           This greatly simplifies complex expressions.
     $     $A is shorthand for (A).
     ;     marks end of a statement

There are also numbers and arbitrary symbols. If there's no other syntax between two of these, they must be separated from each other by whitespace. How all of this is encoded is subject to change. Originally, CosmicOS converted all arbitrary symbols into numbers, and encoded numbers in binary. The message will remain compatible with this, but the encoding of symbols is being changed.

Posts

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.