Recursive

From Esolang
Jump to navigation Jump to search

Recursive is an esolang that is recursive.

Commands

Each program must contain exactly one command, and there is only one possible command.

Command Action
The program's existence Run the current program as a program in Recursive.

Non-existent programs are undefined behavior, although the most convenient action to take is to run the program in Recursive.

Example programs

Infinite loop

// This program is an infinite loop.

Self-interpreter

// This program is a self-interpreter.
// It first compiles any input into a more convenient representation.
// Each command in the input is represented with a copy of this program.
// Then, the compiled program is interpreted as Recursive.

Use an infinite amount of memory (for some interpreters)

// This program uses an infinite amount of memory in this FALSE interpreter:
// [$1_=~][^]#[r;!]r:r;!
// The program causes the interpreter to call itself infinitely, thus using an infinite amount of the call stack.

Crash the interpreter (for some interpreters)

// This program crashes in this Python interpreter:
// def run_recursive(program):
//     if program is program: # if program exists, run program in Recursive
//         run_recursive(program)

See also