Kantate

Kantate is an esoteric programming language, or perhaps a computational model, published in 2016 but conceived much earlier (2010, according to the earliest files/notes I have found). However, its Turing-completeness was not proven nor its design absolutely finished until the year of its release when I (Keymaker) finally decided to complete the project.

Overview

The language operates in an infinite space/array/list of unbounded non-negative integers. This data is both the program and the memory. A program, for lack of a better term, initializes data, starting from position 0. After the described data, data is zeroes without end.

There is only one instruction. The execution pointer points at a position in the data. Initially it points to position 0. The operation/instruction takes three arguments (source, length, destination), starting from execution pointer's position. Then it does the following: take a list of numbers (as many as length describes) starting from position source. (If length is zero, the instruction does nothing, there being no elements to operate on.) Then add each number in the list to the corresponding number, starting from position destination. Then, execution pointer is increased by three, and the process repeats. It never ends. (Since the instruction pointer always moves three positions forward (and nothing can affect it), one can speak of Nth instruction, which is simply the execution pointer at position (N*3)-3. The 1st instruction is at 0, the 4th at 9, etc.)

The actual program input/file is a list of non-negative integers, each followed by a '.'. Except in the case of '-', which defines the integer 0 (writing "0." is valid too, this just saves a byte per definition). Spaces and new-lines are allowed, as are other printable characters as long as they do not break the definition of a number (for example, "5e5." is not allowed).

Example

The following program

-3.6.

would define the data

0 3 6 (0 0 0 ...)

Execution pointer, at position 0, would take the arguments 0 (source), 3 (length), 6 (destination). Taking 3 values from position 0 and adding them to position 6 (initially zeroes), the data after the first instruction would be

0 3 6 0 0 0 0 3 6 (0 0 0 ...)

Then, at position 3, the arguments would be 0, 0, 0, and nothing happens. On to position 6. There the arguments are 0, 3, 6. 3 values from position 0 are added to those starting from position 6. The result is

0 3 6 0 0 0 0 6 12 (0 0 0 ...)

The execution pointer is at position 9, and the arguments are 0, 0, 0. Nothing happens. Then the execution pointer moves on. In this example, nothing will ever happen again.

Computational class

The Turing-completeness of the language can be shown by translation. Here is a tool for translating sequential tag system to Kantate. Once run, the program asks for input. Write the initial memory string followed by '.', then the program string followed by '.'. For example, "10.11;0.", where the initial memory is 10 and the program is 11;0. Only use programs that do not halt (where the memory string never becomes empty).

Interpreter

An interpreter written in Python can be found here. Since the language has no I/O, the interpreter displays the current data after every instruction and also tells where the execution pointer now is. A number given as an extra argument halts the interpreter after that number of steps. If the program has a '%' character in it (automatically placed in the output the translator creates), the interpreter will treat the program as STS-to-Kantate translation and outputs the state of the simulated STS program's data string. Note that such output happens after every Kantate instruction! To decipher the true state of the STS's data you need to know where a simulation of an STS instruction is completed: ';', '0', '1' need 1, 2, 5 Kantate operations respectively. There are also other Kantate operations related to keeping the simulation moving. Too bad the interpreter does not have more intelligent functionality for enabling easier investigation of the data. (Let me know if you program something to that effect.)

-- Keymaker, 7.4.2016