esolang

-string

Every word is a variable unless a dash makes it text, and brackets make a line be read twice.

Runius, 2025 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 5 known programs · Test method

Run it

Expected: Hello, world!

The idea

Runius made -string in July 2025, after This=That. Almost everything in a line is text that gets evaluated. A word with a dash in front is literal text, a bare word is a variable, and a lone dash is a space, usually the only way to get one. Text in square brackets is evaluated first and its result written in its place, so [--Layered] -Parsing becomes -Layered -Parsing and then LayeredParsing. A variable can hold the name of another, like a pointer.

Read the story

There are no numbers to compare and no if. A jump goes to a label whose name is built from text, and a jump to a label that does not exist does nothing. So num2 -Exit makes 0Exit only when the counter is 0, and only then is there a label to land on. The truth machine, A+B and FizzBuzz in the specification all decide that way.

The machine

LineDoes
left = rightStore the right side in the variable the left side names
-out = textPrint the text and a line feed
! textJump to the label the text names, if there is one
+ text - textAdd or take 1 from the variable the text names, if it holds a whole number
: nameA label
anything elseA comment
TokenGives
-wordThe word itself
-A space
inA line of input
wordThe value of the variable, or nothing
[ ... ]Its result, put in place before the rest is read

Example

The truth machine jumps to the label named by its input.
Expected: LayeredParsing

The truth machine jumps to the label named by its input. There is a label 0, so 0 prints once; there is no label 1, so 1 falls through into the loop and prints forever.

Expected: 0

The A+B program moves 1 from one number to the other until the second one is 0.

Expected: 7

The FizzBuzz program counts to 100 with two countdowns, one from 3 and one from 5.

Patterns it teaches

Further

Also in Rewriting

Write your own in Run Convert a program from -string

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run string -e '-out = in' --input 'meow'
shib manual string

Source

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

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

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