esolang

EsoChan

Be program. A story in greentext, and nothing happens until it begins.

SpaceByte, 2022 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: Hello, World!

The idea

SpaceByte made EsoChan in July 2022, after the stories people tell on 4chan. Every command is a greentext line that starts with >, and every other line is a comment, so a program can carry its own narration.

Read the story

A story starts frozen. Nothing runs until the line > be program, and > freeze program stops it again until the next > be program. An if guards only the one command after it, so a longer branch freezes the story when the test goes the wrong way and thaws it at the end.

The machine

LineDoes
> be programStart or thaw the story
> freeze programFreeze it; commands are passed over
> view nameHighlight a variable, 0 when new
> set it to nSet the highlighted variable
> go up n > go down n > go 0Add n, take n, or clear it
> askRead a character's code into it
> print string textPrint the text
> print linebreak > print characterPrint a line feed or the variable as a character
> if n > ifnot nRun the next command only if the variable is, or is not, n
> goto nJump to command n, or to the value of the variable n

Commands are numbered from 1, and the comment lines get no number. The truth machine needs that.

Example

The truth machine.

The truth machine. The two plain lines are comments. On 0 the ifnot 49 lets goto 10 run, and command 10 prints the 0 and ends the story. On 1 it loops on commands 8 and 9 forever.

Expected: Please input 0 or 1: 0

The test program asks for a letter and freezes whichever branch does not apply.

Expected: CLICK THE COOLEST LETTER WOW YOURE COOL YOU PRESSED h ISNT THAT AMAZING

Patterns it teaches

Further

Pseudonatural

Write your own in Run Convert a program from EsoChan

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run esochan -e '> be program
> view userInput
> print string Please input 0 or 1:
> print linebreak
> ask
Input of 0? => Jump to desinent line, which prints and terminates.
> ifnot 49
> goto 10
Input of 1? => Print input, and repeat infinitely.
> print character
> goto 8
> print character' --input '0'
shib manual esochan

Source

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

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

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