Skip to content

Instantly share code, notes, and snippets.

@thomasmf
Last active March 13, 2016 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasmf/5aae6f0824950996f572 to your computer and use it in GitHub Desktop.
Save thomasmf/5aae6f0824950996f572 to your computer and use it in GitHub Desktop.
Alien Quine Puzzle

Alien quine puzzle

The following program is a quine written in X. All mechanism of X are used in the program.

[ q < < [ q > { q } < ] ( q ) > > ] ( q )

Describe syntax and semantics of programming language X.

Background

Years ago I made a very simple programming language. Despite its lack of mostly all typical programming language features, it is possible to do some interesting stuff with it.

I recently watched a documentary where they talked about messages sent into space and how they imagined aliens figuring out how to understand them. They used math and geometry in clever ways.

I wonder if it may be possible to use programming to send such messages.

The question is then if it is possible to figure out the syntax and semantics of a language by looking at a program. I think a quine would be a natural choice of program since it is its own output regardless of what the symbols may mean. The only hand-waving necessary is to convey that something results in something else, and I think that is an unavoidable problem.

I think a message should have at least length, data and checksum, and could contain in order:

  • quine
  • definition of numbers and operators relating them to the symbols with some math examples
  • definition of lists with some example operations like sums and sorting
  • definition of messages and functions for calculating message checksums

Once the basic framework is set it will be possible to build on it like any other computer system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment