esolang

Titled

Brainfuck with no program file. You rename the interpreter, and its name is the code.

2024 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 4 known programs · Test method

Run it

Expected: Hello, World!

The idea

Titled is brainfuck written in a file name. The interpreter reads its own name, drops the extension and runs what is left. A file name cannot hold < or >, so the pointer moves with ) and (. Two commands are added, ; to read a number and ' to print one, and $ turns the wrapping of the cells off and on.

The machine

CommandDoes
) (Move to the next or the previous cell
+ -Add 1 or take 1
[ ]Loop while the cell is not 0
. 'Print the cell as a character or as a number
, ;Read a character's code or a whole number
$Turn wrapping off or on

There are 30,000 cells and wrapping starts on. Then + on 255 gives 0 and - on 0 gives 255. With wrapping off a cell holds any whole number. Every input reads one line, and no input gives 0.

Example

The Hello World, with its line breaks taken out as the specification asks.

The Hello World, with its line breaks taken out as the specification asks.

The A+B problem turns wrapping off, reads A into the first cell and B into the second, and moves B over one at a time. ' prints the sum as a number.

Expected: 7

Patterns it teaches

  • Turing tarpit: the eight commands of brainfuck, two of them renamed to fit in a file name.

Further

Titled builds on Brainfuck.

Brainfuck derivatives

Cell-based

Write your own in Run Convert a program from Titled

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: titled.

Command line

shib run titled -e '$;);[(+)-]('\''' --input '3
4'
shib manual titled

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/titled.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org