Braindead

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

Braindead is a simple variant Brainfuck, designed to mimic the amount of commands that are present in Deadfish, while still remaining Turing complete and allowing both input and output. Input is provided as the second argument of the interpreter after the program and stored in the first cell. No Interpreter exists as of yet. The tape is unbounded in both directions.

Architecture

Similar to brainfuck, the program memory resolves to a tape-like arrangement of cells, extending in both directions without limits, with each component storing an unbounded signed integer object that always defaults to zero (0).

Operating on this structure, initially located at the first cell, a marker, known as the cell pointer, selects the currently active cell. The cell pointer, or simply pointer, may be moved by certain Braindead commands.

Commands

Command Description
> Move the pointer to the right and increment its memory cell
< Move the pointer to the left and decrement its memory cell
/ Output the character signified by the cell at the pointer
\ Jump to the command signified by the cell at the pointer


Jumps

A further deviation from brainfuck's operations, the commands [ and ] have been exchanged for a single \ command, permitting the direct navigation to an instruction in the Braindead program by dereferencing the value of the cell pointed to by the pointer and using it as an zero-based index to resolve to a valid location in the source. It is up to the Implementation to decide how it should respond to a jump instruction violating the possible indices.

Examples

Cat program

A one-time cat program can be implemented using

/

User input is expected in the form of the second argument when invoking the interpreter.

Computational class

a subset of Brainfuck can be trivially translated to Braindead.

Braindead brainfuck
> >+
< <-
/ .
\ None.

Turing-completeness has not yet been proven.

Interpreter

  • Common Lisp implementation of the Braindead programming language.