esolang

MNNBFSL

Brainfuck's symbols on two stacks, where a loop is a saved address and a jump back to it.

yshl, 2014 · Turing complete: yes · ●●● hard · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: meow

The idea

The name is short for a Japanese phrase meaning "a still unnamed brainfuck style stack language". The blogger yshl invented it in July 2014 and published the specification in August. It borrows brainfuck's symbols but takes its machine from Forth. There is a data stack and a return stack, and no tape. A loop is built by hand. [ saves the program counter on the return stack, and ] returns to it while the value it pops is not 0.

The machine

CommandDoes
"Duplicate the top of the data stack
+ -Add or subtract 1 at the top
> <Move the top to the return stack, or back
[Push the program counter onto the return stack
]Pop a value; if it is not 0, jump back to the saved [
.Pop and print a byte
,Read a byte, push it and then 1; at the end push only 0

Both stacks start empty, so most programs begin with [<, which turns the saved address 0 into a first value.

Example

In the cat, , pushes a byte and a 1, the 1 sends ] back to [.,, and .
Expected: Hello world

In the cat, , pushes a byte and a 1, the 1 sends ] back to [.,, and . prints the byte. At the end of the input , pushes only 0, and the loop ends.

Further

Ideas it shows

MNNBFSL builds on Brainfuck.

Brainfuck derivatives

Stack-based

Write your own in Run Convert a program from MNNBFSL

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run mnnbfsl -e '[<+++++"[->+++++<"][]">"++>]  [.,]' --input 'meow'
shib manual mnnbfsl

Source

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

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

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