esolang

Mеmоrу

A to-do list that keeps adding "Remember" entries to itself, and prints whatever it forgot.

iddi01, 2024 · Turing complete: unknown · ●●● hard · esolangs.org

Tested with 4 known programs · Test method

Run it

Expected: Hi

The idea

iddi01 made Mеmоrу in 2024, after to-do lists where an entry says "Remember x" and then needs another entry to remember that one. Three letters of the name are Cyrillic. A program is a numbered list, and the only output is the numbers of the entries the list forgot, printed as characters.

Read the story

Remembering is XOR. Being told to remember an entry a second time forgets it.

The machine

EntryDoes when it is newly remembered
n. Remember: xToggle every entry numbered x
n. Remember everything aboveToggle every entry above it
n. Remember everything belowToggle every entry below it
n. Occupy: xTake the number x
n. Do nothingNothing

Only the first entry is remembered at the start. Every input character joins the list as c. Do nothing, numbered by its code. The entries act in cycles until a cycle changes nothing. Then every forgotten entry prints its number as a character, top down, and one more remembered entry joins the list at the lowest free number. It is Remember: x when one number was forgotten and Remember everything above when more were. The run ends when nothing is forgotten.

Example

The Hello World lists the letters as Do nothing entries under a first entry 0.

The Hello World lists the letters as Do nothing entries under a first entry 0. The letters are forgotten and print. The added Remember everything above brings them back and forgets the first entry, which then prints a NUL. With a first entry numbered 10 that last character is a line break.

The true cat works the same way on the input.

Expected: cat

The empty program is a cat too, almost. Its first entry is the first input character, which is remembered, so it prints last.

Expected: bca

The specification also has a truth machine that it says is not a true one. By the interpreter in the specification it prints the same on both inputs, 01 and then control characters with more 01 among them, and it is still running after 30 million steps.

Patterns it teaches

Further

Pseudonatural

Self-modifying

Write your own in Run Convert a program from Mеmоrу

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: m-m-r.

Command line

shib run m-m-r -e '0. Do nothing' --input 'Hi'
shib manual m-m-r

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/m-m-r.js

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

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