CosmicOS is a self-contained message designed to be understood primarily by treating it as a computer program and executing it. It is inspired by Hans Freudenthal‘s Lincos and resembles the programming language Scheme in many ways.
The message is written with only four basic symbols representing the binary digits one and zero and open and close brackets. Numbers are represented as a string of binary digits between a pair of brackets and expressions are represented as a string of numbers between brackets. Identifiers for operations are arbitrarily assigned numbers and their functions can be defined within the message itself.
Self-contained messages are of interest for CETI research, but there is much difference of opinion over the most appropriate encoding and broadcast medium to use. CosmicOS is released in modular form, so that the basic message can be adapted to a particular concrete instantiation. The message is released under the GPL licence.[1]
Syntax
The core language of the message is a stripped-down Lisp called Fritz.
It is written as space-separated lists of names and numbers with nesting e.g.: * 3 (+ 1 (+ 2 3))
Shorthand:
- The “
|” symbol nests to end of expression:(+ 1 | + 2 3)is equivalent to(+ 1 (+ 2 3)) - “
$x” is equivalent to “(x)“
Lists are evaluated by calling the first element with each of the others in turn. If the first element of the list is a name or number, it is treated as a lookup. Exception: “? x body” makes a function if condition A B evaluates to A if condition is true, otherwise B “define x v” means that looking up $x will return v
| Symbol | Meaning when called | Example |
|---|---|---|
false |
not true | = (> 10 20) $false
|
true |
not false | = (> 20 10) $true
|
< |
is one integer less than another | < 41 42
|
= |
test for integer equality | = 42 42
|
> |
is one integer greater than another | > 42 41
|
not |
? x | if $x 0 1 |
not (> 41 42)
|
* |
multiply two integers | * 2 21
|
+ |
add two integers | + 22 20
|
- |
subtract one integer from another | - 44 2
|
? |
create an anonymous function | ? x | - $x 1
|
@ |
define an expression in memory | @ decrement | ? x | - $x
|
assign |
memory within expression | assign x 15 | = $x 15
|
if |
conditional evaluation | if (> $x 1) (dec $x) $x
|
and |
true if both arguments are true | and (> 42 41) (< 41 42)
|
or |
true if either arguments is true | or (> 42 41) (< 42 41)
|
See also
References
- ^ “CosmicOS source”. GitHub. Retrieved 2026-06-07.
External links
- CosmicOS project website with examples and interactive console.
- Old CosmicOS project page
- Old Sourceforge archive