esolang

TextGarbage

Variables, arithmetic, ifs and functions, written with no spaces and one character per word.

Dominicentek · Turing complete: unknown · ●○○ easy · esolangs.org

Tested with 7 known programs · Test method

Run it

Expected: Hello, World!

The idea

Dominicentek made TextGarbage, first under the name Gibberish. It is an ordinary small language with variables, arithmetic, ifs, functions and goto. The trick is the spelling. Every command is one letter, every argument is one character, and nothing separates them. So a program is one long run of letters that looks like noise.

Read the story

A value is either a variable, named by one character, or c followed by one character, which is a constant. A digit after c is that number and anything else is its character code. So cH is 72 and c7 is 7, and a variable named c can be set but never read.

The machine

CommandArgumentsDoes
vname, valueSet a variable
inameRead a line of input into a variable
o nvaluePrint as a character; print as a number
mname, value, op, valueSet a variable to two values joined by a add, s subtract, m multiply, d divide or r remainder
cvalue, test, valueRun the block up to e only if the test holds, e equal, n not equal, g greater or l less
f rnameMake the block up to e a function; run it
l gnameMark a label; go to it
xExit

Characters that are no command are ignored. The specification leaves the input format open. In this implementation input comes a line at a time; a whole number is read as that number and any other text as the code of its first character. Numbers are whole and 32 bits wide.

Example

Hello World prints each letter as a constant.

Hello World prints each letter as a constant. Read it as o cH, o ce, o cl and so on.

The truth machine reads x. If it is 1, it marks a label l, prints 1 and goes back to it for ever. Otherwise it skips the block and prints 0.

Expected: 0

The calculator reads a number, an operator and a number. It builds the codes of +, -, *, / and % in the variables a, s, m, d and r, then compares the operator with each.

Expected: 42

Further

Also in Hostile

Write your own in Run Convert a program from TextGarbage

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run textgarbage -e 'ixcxec1llnc1glenc0' --input '0'
shib manual textgarbage

Source

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

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

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