{"id":16190576,"url":"https://github.com/paulfitz/cosmicos","last_synced_at":"2025-04-21T11:33:34.319Z","repository":{"id":10290614,"uuid":"12409442","full_name":"paulfitz/cosmicos","owner":"paulfitz","description":"Sending the lambda calculus into deep space","archived":false,"fork":false,"pushed_at":"2022-04-27T00:37:15.000Z","size":2521,"stargazers_count":127,"open_issues_count":8,"forks_count":8,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-05-01T19:58:46.350Z","etag":null,"topics":["conlang","space","translation"],"latest_commit_sha":null,"homepage":"https://cosmicos.github.io/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paulfitz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["paulfitz"]}},"created_at":"2013-08-27T15:15:07.000Z","updated_at":"2024-04-16T16:35:51.000Z","dependencies_parsed_at":"2022-09-01T08:51:01.062Z","dependency_job_id":null,"html_url":"https://github.com/paulfitz/cosmicos","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulfitz%2Fcosmicos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulfitz%2Fcosmicos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulfitz%2Fcosmicos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulfitz%2Fcosmicos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulfitz","download_url":"https://codeload.github.com/paulfitz/cosmicos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223863958,"owners_count":17216234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conlang","space","translation"],"created_at":"2024-10-10T07:43:36.426Z","updated_at":"2024-11-09T18:03:33.394Z","avatar_url":"https://github.com/paulfitz.png","language":"Java","funding_links":["https://github.com/sponsors/paulfitz"],"categories":[],"sub_categories":[],"readme":"CosmicOS: a next-generation Contact message\n===========================================\n\nCommunicating programs and simulations into deep space.  http://cosmicos.github.io/\n\n[![Build Status](https://travis-ci.org/paulfitz/cosmicos.svg?branch=master)](https://travis-ci.org/paulfitz/cosmicos)\n\nCommunication through theater\n-----------------------------\n\nIt's a familiar problem. You've finally managed to contact that alien \ncivilization. Things are going great. You feel like your world will \nnever be the same, that whole new realms of possibilities are opening up \nbefore your eyes. Then, inevitably, a hint of strain starts to creep into \nyour relationship. You find that you don't really have all that much in \ncommon. Heck, sometimes it feels like you're not even in the same \ngalaxy. It's as if there is this vast gulf between you, making communication \nalmost impossible. You're not even sure you'd understand each other no matter \nhow physically close you became. What do you do?\n\nYou design a language for cosmic intercourse. Hans Freudenthal made a start at \none in his book, Lincos, published in 1960.\n\n![Lincos](https://user-images.githubusercontent.com/118367/44816347-ff8f2d80-abaf-11e8-8066-4535e43f8b79.jpg)\n\nOne of the most interesting ideas in Lincos is to bootstrap up from\nmathematics and logic to *conversations about* mathematics and logic\nbetween imaginary characters __Ha__ and __Hb__, and from there to\nstatements about behavior of those characters.  That's a pretty rich universe\nof shared ideas already.\n\nIn CosmicOS, we develop this idea of communicating through theater by\nintroducing a new topic of conversation: programs and simulations.\nFor example, if discussing logic circuits, we transmit a program for\nsimulating the circuits, so the listener isn't restricted to the\nexamples we show.  If discussing movement through space, we transmit a\nsimulation of a small adventure game, and show navigation from room to\nroom.  And so on.\n\nPutting on a show\n-----------------\n\nHere's the idea behind CosmicOS:\n\n * Communicate the usual math and logic basics ...\n * ... then use that to show how to run programs ...\n * ... then send interesting programs that demonstrate behaviors and interactions ...\n * and start communicating ideas through theater and theater commentary.\n\nThis is inspired by Freudenthal's idea of staging written conversations between his imaginary characters __Ha__ and __Hb__.\n\nWhat the message looks like\n---------------------------\n\nWhat would you like it to look like?  A string of numbers?\n\n\u003cpre\u003e\n20321001113223321001113023210101032032233210011130232101010321320322332100111302\n32101010321321320322332100111302321010103213213213203223321001113023210101032132\n13213213203223321001113023210101032132132132132132032233210011130232101010321321\n32132132132132032233210011130232101010321321321321321321321320322332100111302321\n01010321321321321321321321321320322332100111302321010103213213213213213213213213\n21320322332100111302321010103213213213213213213213213213213203223321001113023210\n...\n\u003c/pre\u003e\n\nSome kind of spidery scrawl?\n\n![spidery scrawl](https://user-images.githubusercontent.com/118367/44754717-fee39200-aaf0-11e8-8c5e-e7f3ba71e89b.png)\n\nVaguely understandable symbols?\n\n\u003cpre\u003e\n...\n✉ ᚋ (+) | ✉ ᚌ 3 | ☯ 4 (ᚋ 1 (ᚌ))\n☯ 2 | ✉ ᚋ 1 | + $ᚋ 1\n☯ 1 | ✉ ᚋ 1 $ᚋ\n☯ 14 | ✉ ᚋ 1 14\n☯ 4 | ✉ ᚋ (✉ ᚌ 3 | + 1 $ᚌ) $ᚋ\n☯ 4 | ✉ ᚋ (✉ ᚋ 3 | + 1 $ᚋ) $ᚋ\n✉ ᚋ 1 | ☯ (ᚋ) 1\n✉ ᚋ 1 | ☯ $ᚋ 1\n...\n\u003c/pre\u003e\n\nLogic gates?\n\n![A D latch](https://user-images.githubusercontent.com/118367/64082227-b9e0d580-ccd9-11e9-89db-dee9920a771f.gif)\n\nAudio?  You can listen to one rendering of the message at https://cosmicos.github.io/\n\nBuilding the message\n--------------------\n\n\nI recommend you use docker to build the message.\nInstall docker (see https://docs.docker.com/install/), then do:\n\n```\n./make.sh tiny\n```\n\nYou should find a message saved as `build/tiny/index.txt` and\n`build/tiny/index.json`.\n\nThere is a tool for browsing parts of the message in:\n```\nnode ./build/tiny/bin/cosmsg.js\n```\n\nThere will be a simple console for playing with Fritz in:\n```\nnode ./build/tiny/bin/cosh.js\n```\n\nIf you don't want to use docker, you can see all the steps needed in `docker/Dockerfile`\nand `src/make_without_docker.sh`.\n\nBy default, `./make.sh` will compile the message in json form.  There are specific targets\nif you want other forms of the message.  Do `./make.sh help` to list all targets.\n\nMessage source code\n-------------------\n\nThe CosmicOS message is assembled from a series of \"chapters\".  Each\nchapter is written in one of several languages, which are then\ncompiled into a common language called `Fritz`.  This is a low-level\nlanguage that is suitable for further conversion into a number of\nforms for transmission.\n\nSupported languages and how they are treated are:\n\n * __*.scm__: These files are incorporated into the message verbatim.  They are written\n   in a lisp-like language called Fritz.\n\n * __*.js__:  These scripts are executed using node, and their output is incorporated\n   into the message.\n\n * __*.java__: These files are compiled to bytecode, and that bytecode is then converted\n   into Fritz statements, using elements introduced in the message itself.  Not all\n   Java constructs are supported, don't get carried away here.\n\n * __*.pl__: These scripts are executed using perl, and their output is incorporated into\n   the message.  CosmicOS is so old that its original source is was written in perl, and\n   some of it is still lying around.  I can feel you judging me, please stop.\n\n * __*.gate__: These files are interpreted as a specification for a kind of circuit.\n   You can find a simulator on the CosmicOS website.  The circuit specifications\n   are converted into a form that can be incorporated into the message.  Rules for\n   evaluating a circuit are given in the message.\n\nFritz\n-----\n\nThe core language of the message is a stripped-down Lisp called Fritz.  Here's an example statement:\n\n```\n= 42 (+ 20 22);\n```\n\nIf you've coded in scheme or lisp, this should feel familiar, except we've stripped\na pair of parentheses around the whole expression, and added a semicolon.  In general,\nFritz takes every opportunity to reduce nesting, since it seems a cognitive burden.\nThe above would typically be written as:\n\n```\n= 42 | + 20 22;\n```\n\nThe `|` means: nest everything from here to the end of the current expression.\n\nWe can define new symbols with `@ symbol value`, and create functions with `? symbol body`:\n```\n@ square | ? x | * (x) (x);\n= 100 | square 10;\n```\n\nNote the parentheses in `* (x) (x)`, which multiplies an argument stored in x by itself.\nTo get the value of x, you evaluate it like an expression (this makes writing self-referential\nmessages so much easier).  A shorthand for `(x)` is `$x`, so the above can be written as:\n```\n@ square | ? x | * $x $x;\n= 100 | square 10;\n```\n\nThere's nothing special about symbols in Fritz, this code would work just as well\nwith `square` and `x` replaced by arbitrary integers:\n```\n@ 9999 | ? 88 | * $88 $88;\n= 100 | 9999 10;\n```\n\nThe message can be encoded in lots of ways.  Originally, CosmicOS was encoded\nin a four-symbol message, with symbols corresponding to:\n\n * `0`: binary digit zero\n * `1`: binary digit one\n * `(`: open parenthesis\n * `)`: close parenthesis\n\nFritz messages can still be encoded this way by expanding out all references\nto `|` and `$`, ignoring `;`s, and replacing symbols with arbitrary integers.\nThis does not seem very kind to the reader though, so other encodings are used\ntoday.  There is a lot of scope for imaginative renderings of the same message.\n\nVariant messages\n----------------\n\nPerhaps you'd like to work on a somewhat different message without disturbing\nthe main message.  You can do that.  Take a look in the `variant` directory.\nEach file there defines a different message.  For example, `variant/tiny.cmake`\ncontains:\n\n```\nset(COSMIC_DEPENDS\n  COS_Intro\n  COS_Compare)\n```\n\nThis means to build the message by concatenating `msg/COS_Intro.*` and `msg/COS_Compare.*`.\nYou can make your own file, `mine.cmake`, and then build it using:\n\n```\n./make.sh mine\n```\n\nYou can optionally add this line:\n```\nset(COSMIC_USE_FLATTENER false)\n```\nIf you think the `$` and `|` message symbols should be converted to parentheses in the message.\n\nCode quality\n------------\n\nOh my goodness what can I say except \u003cs\u003eyou're welcome\u003c/s\u003e sorry.\n\nChatter\n-------\n\n * https://en.wikipedia.org/wiki/CosmicOS\n * https://www.theatlantic.com/science/archive/2016/04/math-language-extraterrestrials/477051/\n * https://www.vice.com/en_asia/article/53gvvq/2017-will-be-the-year-we-decide-whether-to-put-a-call-out-to-aliens\n * https://spectrevision.net/2016/04/08/exolinguistics/\n * http://timeblimp.com/?page_id=1976\n\nLicense\n-------\n\nCopyright (C) 2018 Paul Fitzpatrick\n\nCosmicOS is released under the GNU General Public Licence --\nSee COPYING.txt for license information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulfitz%2Fcosmicos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulfitz%2Fcosmicos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulfitz%2Fcosmicos/lists"}