We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
Mutual Modification Machine
Mutual Modification Machine is a Brainfuck derivative where program and memory can switch roles, and this switching serves as the main mechanism for control flow.
Instructions
Mutual Modification Machine borrows all of Brainfuck's instructions except for looping instructions which are replaced by the "#" instruction. In Mutual Modification Machine, the program is a circular tape (wraps around after the last instruction as opposed to halting) howand the memory tape is an unbounded one, initially.
If we encouter a "#" instruction and the current cell is non-zero, we create a new run where the program is interpreted as the memory and vice versa, with pointers being set to 0. The swap also carries the state of being unbounded or circular. Upon halting, we swap the roles back again and continue with the next instruction after the "#", but the modifications to the program persists. Halting only occurs when we encounter a zero cell in the program.