esolang

Recall

No loops and no jumps. A function runs where it is written, and the only way to repeat is to call it again.

I am islptng, 2026 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 8 known programs · Test method

Run it

Expected: Hello, world!

The idea

I am islptng made Recall in 2026. It works on a stack of whole numbers and has no loop and no jump. Square brackets make a function, and the function runs at once, right where it is written. Inside it, $ calls the same function again. , looks at a number on the stack and leaves the function early when that number is 0. Otherwise it takes 1 from it.

Read the story

So every loop counts a number down to 0, one call deeper each time round. Adding two numbers moves 1 from the top one to the one below until the top one is 0, and multiplying is adding inside another function.

The machine

CommandDoes
#xPush x
'x _x :xAdd 1 to number x, drop it, or push a copy of it
<x >xMove number x to the top, or the top down below x+1 numbers
. ;Print the top and pop it, or read a number
[ ... ]A function, run at once
$Call the current function again
,xLeave the function if number x is 0, else take 1 from it
+x =x \|Move number x to the extra stack, move the extra stack's top in below x+1 numbers, or reverse the extra stack
(text) / { }Print text, a line feed, ( or )
-Take back the command before it, for comments

The number after a command counts from the top of the stack, 0 being the top. Left out, it is 1 for <, 2 for > and 0 for the others. The specification's table is looser than the Python behind its Try It Online link, and this implementation follows the Python. , does not remove the number it counts down, + takes the number off the stack, and > and = put a number one place deeper than the table says.

Example

The function for adding, given 3 and 4.

The function for adding, given 3 and 4. It moves 1 from the top number to the one below until the top is 0, then drops it.

Expected: 7

The factorial, given 5. It calls itself for 4, 3, 2 and 1, and on the way back multiplies with the multiplying function inside it.

Expected: 120

The 99 bottles of beer counts down the same way, one call for each verse. At the last bottle a second , meets 0 and leaves the 98th call. $ is the last command of the function, so the other 97 calls end straight after it, and the program prints its last two verses.

Patterns it teaches

Further

Stack-based

Write your own in Run Convert a program from Recall

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run recall -e '#3#4[,'\''1$]_.'
shib manual recall

Source

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

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

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