Goldfish

Goldfish is an esoteric programming language by User:Fergusq inspired by Deadfish i. Only way to store data is creating functions and static variables inside them.

Design
Goldfish is heavily inspired by Deadfish and Deadfish i. Dfi resembles Goldfish in that it contains a list of functions (called classes).

0<+++] # calls function 3 3<+. # prints something

The author tried to make a truth-machine implementation in Dfi, but it turned to be impossible due to ambiguity in the specification: it is not clear whether all functions share the same accumulator or have each their own. The above program may print 4 or 1.

Goldfish is based on possible semantics of Dfi: every function has it's own accumulator which does not reset when function is called again.

Goldfish commands are more like Deadfish than Dfi: i, d, s, o instead of +, -, >, .. That is because all commands can be written both in upper case and lowercase depending on which variable they modify.

Overview
A source file is a list of function declarations. For example, the following declares two functions, 0 and 1. It prints three times HI.

0 ic n ic n ic 1 niisiiiisiiiiiiiioioniiisio

Function number can be positive or negative. All undefined functions are empty at the begining. There are no comments, but unused functions can be used as such.

Each function has it's own static variable (called v) and receives one argument (called p). All commands which modify v are in lower case and all which p in UPPER CASE. Function returns the value of v.

99 calls 1 three times ~ should print 1 2 3 0 ico n ico n ico 1 i

At the begining, function 0 is called with argument 0.

Hello world
0 iisiiiisiiiiiiiioniiisisioiiiiiiiooiiioniisiisddddoniisiiiiisiiiiiioniiisiisddddddddddoiiioddddddoddddddddoniiisio

Cat program
0 ronc

Truth-machine
0 rc 48 iisiiisdoh 49 niisiiisoc

Computational class
Goldfish is Turing complete as Minsky machines can be compiled into it. See external resources for proof.

External resources

 * Interpreter
 * Minsky machine to Goldfish compiler