esolang

FakeScript

Six commands, no variables, and no way to print a space.

Viba, 2021 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: HelloWorld!

The idea

FakeScript was made to be easy to implement, also for people who do not know much about programming. Its name comes from a forum post its author wrote in 2013 at the age of 7, which contained a program in an imaginary language called FakeScript. The real language came 8 years later and looks nothing like that post. Terms are separated by spaces, so a printed text can never contain one. The only memory is the last line of input.

The machine

CommandDoes
print XPrint X
inputRead a line; #input stands for it
!label NAMEA label
goto NAMEJump to the label
if A B NAMEJump to the label when A and B are equal
stopEnd the program

Newlines count as spaces. In this implementation print ends its text with a newline.

Example

The truth machine compares the input with 1 and 0 and jumps to the label of the same name.
Expected: 0

The truth machine compares the input with 1 and 0 and jumps to the label of the same name. Label 1 prints 1 and jumps back to itself forever.

Further

Ideas it shows

Also in Jokes

Write your own in Run Convert a program from FakeScript

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run fakescript -e 'print HelloWorld!'
shib manual fakescript

Source

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

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

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