Subtle cough

From Esolang
Jump to navigation Jump to search

Subtle cough is an esoteric programming language by User:ihope127 that can be defined as Unlambda with c as its only function primitive. That is, the set of Subtle cough programs is the set of Unlambda programs which use only the characters ` and c, and the Subtle cough programs do the same thing as these Unlambda programs.

There are only three nonequivalent expressions (and thus programs):

c
The Unlambda primitive.
`cc
Evaluating this in any continuation ends up returning that continuation to itself. The expressions `c`cc and ``ccc both have the same effect.
``cc`cc
Never terminates. Neither does any expression containing it.

It follows that ` acts essentially as a simple ternary logic operator:

` c `cc ``cc`cc
c `cc `cc ``cc`cc
`cc `cc ``cc`cc ``cc`cc
``cc`cc ``cc`cc ``cc`cc ``cc`cc

This language clearly has too little computational power to be used for programming.

Calculation of operator table

We will evaluate the expressions using Unlambda meta-notation.

`cc = `c(*) = `(*)(*) = (*).
`c`cc = `c(`c*)   (from above)
  = `(`c*)(*) = `c(*) = `(*)(*) = (*).
``ccc = `(`*c)c = `cc = (*).
``cc`cc = `(`*`cc)`cc = `(`*`cc)(`(`*`cc)*) = `(`(`*`cc)*)`cc
  = `(`*`cc)`cc   (circular, because (`(`*`cc)*) = (`*`cc)).
`c``cc`cc evaluates the ``cc`cc.
``cc``cc`cc = `(`*``cc`cc)``cc`cc, at which point ``cc`cc is evaluated.
```cc`cc``cc`cc evaluates the first ``cc`cc.