esolang

Self-modifying Brainfuck

brainfuck whose program sits on its own tape, so writing a cell rewrites the code that runs next.

2006 · esolangs.org

Tested with 2 examples and 3 known programs · Hello World on Try It Online: identical · Test method

Run it

Example

Expected output

<[<]>[.>]Quines are easy!

Output


What it is

Self-modifying Brainfuck: runs from the tape it edits; cells left of it read 0

How its machine works

Its machine has code that can change itself.

Examples

Example

Expected output

<[<]0>[.>]

Output


Quirks

  • A run stops after 3,000,000 steps.

Ideas it shows

Self-modifying Brainfuck builds on Brainfuck.

Self-modifying

Brainfuck derivatives

Write your own in Run Convert a program from Self-modifying Brainfuck

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run smbf -e '<[<]0>[.>]'
shib manual smbf

Source

Module
langs/dialects/ports.js
Interpreter
langs/dialects/bf.js

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

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