CosmicOS: a next-generation Contact message
CosmicOS
message
console
github
Coding for contact
CosmicOS is a way to create messages suitable for communication across<br>large gulfs of time and space. It is inspired by Hans Freudenthal's language,<br>Lincos,<br>and Carl Sagan's<br>book, Contact.<br>CosmicOS, at its core, is a programming language, capable of<br>expressing simulations. Simulations are a way to talk, by anology,<br>about the real thing they model.
CosmicOS is structured to communicate the usual math and logic basics,<br>then use that to show how to run programs, then send<br>interesting programs that demonstrate behaviors and interactions,<br>and start communicating ideas through ”theater” and simulations.<br>This is inspired by Freudenthal's<br>idea of staging conversations between<br>his imaginary characters Ha and Hb .
Message sections
0introduce numbers (in unary notation)unaryisintsquareprime
1introduce equality and inequality of numbers=>
2introduce logical negationnot
3introduce addition+
4introduce subtraction-
5introduce multiplication*
6introduce non-unary representation of numbers
7show alternative groupings
8show local assignmentassign
9demonstrate existence of memorysquare++
10introduce true and falsetruefalse
11show conditionalsifmaxminfactorial
12introduce the AND logical operatorand
13introduce the OR logical operatoror
14introduce pairsconscarcdr
15introduce mutable cellsmake-cellset!get!
16introduce listslistundefinedheadtaillist-lengthlist-reffunction?equallist=prependpairfirstsecond
17introduce map and reducemapreduce
18how to change the imagined interpretertranslatevector
19some more list functionslist:findlastexcept-lastlist:reverseappendselect-match
20introduce pi and eminusfracabswithinrangeevenodddecimalepipower:10pow:intpowexp
21introduce isumi
22define let expressionslet
23lambda functionslambda
25some pure lambda calculus definitions - optionalpure:ifpure:truepure:falsepure:conspure:carpure:cdrpure:0pure:1pure:2pure:nextpure:+pure:*pure:prevpure:=:0fixed-pointpure:int:get
26introduce universal quantifierforall
27introduce existential quantifierexists
28introduce logical implication=>
29introduce sets and set membershipelementset:set:=set:0
30introduce graph structuresgraph:makeexists:graph:2exists:graph:2:list
31show how to execute a sequence of instructionsbegin
32introduce environment/hashmap structurehash-addhash-refhash-nullhash-defaultmake-hash
33introduce simple mutable structuresmutable-struct
34introduce turing machine modeltape:dotape:maketape:resultdemo:tape:function:+:1
35quoting syntaxquote
36introduce simple form of typing, for ease of documentation.condinstanceofreflective
37message passing / object example - a 2D pointpoint
38message passing / object example - a containercontainer
39adding a special form for classeslist-appendclass
40wrapper class for cellscell
41playing around with doors and roomsdoorroomcharacter
42introduce the elementsprotonelectronneutronmasshydrogenheliumcarbonnitrogenoxygenhydrogen:2oxygen:2oxygen:3waternitrogen:2ammoniamethaneethane
44simulating unless gatesunlessmake-matrixmatrix-setmatrix-getsimulate-unlessbit-getmake-imageimage-getimage-heightimage-widthdistill-circuit
45testing alternate primer based on gates: cos_not circuitcos_not_gatecos_not_image
46testing alternate primer based on gates: cos_and circuitcos_and_gatecos_and_image
47testing alternate primer based on gates: cos_or circuitcos_or_gatecos_or_image
48testing alternate primer based on gates: cos_nor circuitcos_nor_gatecos_nor_image
49testing alternate primer based on gates: cos_osc circuitcos_osc_gatecos_osc_image
50testing alternate primer based on gates: cos_sr circuitcos_sr_gatecos_sr_image
51testing alternate primer based on gates: cos_d circuitcos_d_gatecos_d_image
52probing networks of unless gates
54a mechanism for referring to parts of the messageprimer
55some preparatory work for integrating with Java codeObjectIntegerStringjavajvm-maker
56class translation 'COS_JavaTest'
57check that automatic conversion is workable
58another simple little text-adventure space
59native implementation of a Java list, hash classes
60testing the JList class
61basic iterator implementation
62class translation 'COS_JDoor'
63class translation 'COS_JThing'
64class translation 'COS_JRoom'
65class translation 'COS_JNamed'
66class translation 'COS_JWorld'
67class translation 'COS_JRobo'
68test JRoom, JDoor, JThing, etc
Message in 4-symbol form
Traditionally, CosmicOS has been represented as<br>a long sequence of four symbols. Labeling<br>them arbitrarily as<br>0 , 1 , 2 , and 3 , the message begins like...