esolang

MoonScript

One number, four characters, and no way to repeat anything.

2022 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: BA

The idea

MoonScript is presented as the answer a GPT neural network gave in 2022 when it was asked to invent an esoteric programming language. The only data is one number, and the only operations move it up or down by one. It has no loop and no condition, so every program runs once from left to right. The specification itself says it is not Turing complete.

The machine

CharDoes
+ -Add 1, take 1 away
.Print the number as a character
,Read a character into the number

The number is a signed 8-bit integer, from -128 to 127. The specification leaves the edges open. This implementation wraps it, so 127 plus 1 is -128, and the end of the input reads as 0.

Example

The one program reads a character, goes up by one, prints, goes down by one and prints again.

The one program reads a character, goes up by one, prints, goes down by one and prints again. Its description names only the last output, but the first . prints too.

Expected: 10

Without input every character has to be reached one step at a time from 0.

Expected: HI

Further

Generated by AI

Write your own in Run Convert a program from MoonScript

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run moonscript -e ',+.-.' --input 'A'
shib manual moonscript

Source

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

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

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