esolang

DotSF

A small stack language whose interpreter, Agatha, will not run your program unless you tip her.

ArthroStar11, 2021 · Turing complete: no · ●●○ moderate · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: HI

The idea

ArthroStar11 made DotSF in 2021 from pieces of brainfuck, Befunge and INTERCAL. From brainfuck comes the limit of 30,000, which becomes the depth of the stack. Like Befunge, it runs one-character commands on a stack. From INTERCAL comes politeness. Where INTERCAL wants PLEASE, DotSF wants $, a tip for the interpreter. Between a tenth and a fifth of the source must be tips. Every source carries one invisible tip, so a program shorter than 5 characters always fails.

The machine

CommandDoes
0 to 9Push the digit
+ - * / %Pop A, then B, push A op B
_Duplicate
. ,Read a number; read a character
: ;Print the top as a number; as a character
[Pop; if it was 0, go on after the next ]
A to ZA label
a to zJump to that label
$A tip, which does nothing

Jumping to one label more than 1,000 times in a row is an error. The truth machine gets around that by jumping to B and back to A in turn.

Example

98* makes 72, which prints as H, and one more is I.

98* makes 72, which prints as H, and one more is I. Eight characters and one invisible tip make the tip rule hold.

The truth machine. On 0 the [ jumps past ] to the last :.

Expected: 0

Three more characters, 12:, make 11 with only the invisible tip, and Agatha refuses to run it. A $ at the end puts it right.

Expected: HI2

The count down, 0A1+_92+9*1+-_[:a]$, prints 99 to 1 with nothing between the numbers.

Patterns it teaches

Further

Stack-based

Write your own in Run Convert a program from DotSF

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run dotsf -e '98*_;1+;'
shib manual dotsf

Source

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

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

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