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 mean.
The following program is a quine written in X.
[ q < < [ q > { q } < ] ( q ) > > ] ( q )
All features of X are used in the program. X is Turing-equivalent.
The program is a quine according to definition at https://en.wikipedia.org/wiki/Quine_%28computing%29. It is not a "Cheating" quine.
There are no symbols in the language that are outputting themselves.
The challenge is to figure out the syntax and semantics of X.
The rules should be the minimal set of rules.
There should be a list of numbered rules, described in English. The rules should appear in the same order as the first example of a corresponding syntactic element in the program. Use x, y and z as wild-cards. x denoting the first item, y the next and then z.
For example:
x <
bite something less then x minutes ago{ x }
eject lab mouse named xx > y
lets all eat x, y not
The winner is the one who has the most correct rules in the correct positions.
Answer
The point of this challenge was to test if it was in fact possible to become capable of reading a programming language by only looking at a quine for that language. I am very happy about how this turned out. Great success!
The accepted answer has all the key features right. There are subtleties that were not possible to decide based on the quine. Those would have been apparent with only a few additional examples.
Congratulations to The Dark Truth!
For completeness I have made an interpreter for the language with an included user manual: https://gist.github.com/thomasmf/031db24f0e63a3459e62