InFeeo
Language

CosmicOS: Coding for Contact(github.com)

×
Link preview GitHub - paulfitz/cosmicos: Sending the lambda calculus into deep space Sending the lambda calculus into deep space. Contribute to paulfitz/cosmicos development by creating an account on GitHub. GitHub · github.com
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)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
a long sequence of four symbols. Labeling
them arbitrarily as
0, 1, 2, and 3, the message begins like this:

21001032111322332100103210111132233210010321100003223321011113211000031232111320322332101111321100003123211132132032233210111132110000312321113213213203223321011113211000031232111321321321320322332101111321100003123211132132132132132032233210111132110000312321113213213213213213203223321011113211000031232111321321321321321321320322332101111321100003123211132132132132132132132132032233210111132110000312321113213213213213213213213213203223321011113211000031232111321321321321321321321321321320322332101111321100003123211132132132132132132132132132132132032233...

see full 303242-symbol message

Estimating message entropy by compressing this message, we get:
25 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 consists of a sequence of statements that can be
evaluated, and each statement evaluates to true.
The message can refer to itself and change its own syntax as it goes.
A core set of operators are introduced by showing examples of their use.
Once a sufficient set of operators is available, most new concepts
are introduced both by examples and a definition in terms of what is
already known.
The message is more like a programming language than a human language, and is related to Brian McConnell's notion of ACETI. The goal is to
transmit simulations whose behavior can be examined and discussed, and
to introduce higher-level notions in terms of those simulations.

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

Astraglossa

A question of character

Naming

Reboot

About CosmicOS

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.

The CosmicOS software is licensed under the CC-GNU GPL.

The CosmicOS webpages are licensed under a
Creative Commons Attribution-ShareAlike 2.5 License.

Log in Log in to comment.

No comments yet.