esolang

NyaScript

Brainfuck, meowed. Every command is a way of writing Nya, and a spare paw holds one more number.

ThatCookie, 2020 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: Hello, World!

The idea

NyaScript started on the Discord server of Tetra Online, where one member kept talking in a "Nya" language of words like Nya, hewo and UwU. When another member said the word "nyascript", ThatCookie streamed the making of it that same day.

Read the story

Underneath it is brainfuck. Each of the eight commands is Nya with its own mix of capital letters, so Nya moves right and NyA adds 1. Seven longer words work a temp value beside the tape, a place to keep one number while the pointer moves on. The Hello World keeps the 108 of l there and puts it back twice while it spells World.

The specification goes on to NyaScript Extended and NyaScript++, with variables, functions, arrays, classes and Python imports. They are sketched rather than defined, so only pure NyaScript runs.

The machine

WordBrainfuckDoes
Nya nyA> <Move right or left
NyA nYa+ -Add or take 1
NYa nYA[ ]Loop while the cell is not 0
NYA nya. ,Print or read a byte
WordDoes to the temp
nyanCopy the cell into it
NYANCopy it into the cell
NyaN nYAnAdd or take 1
NYAn nYANAdd or take the cell
NyANClear it

Words are separated by spaces or line breaks. Cells and the temp hold 0 to 255 and wrap, the tape grows to the right as far as needed, and reading past the end of the input gives 0.

Example

The Hello World, by ThatCookie.

The Hello World, by ThatCookie. The loop on the first six lines fills six cells at once.

A cat reads a byte, then prints it and reads again until the input runs out.

Expected: meow

Patterns it teaches

Further

NyaScript builds on Brainfuck.

Brainfuck derivatives

Cell-based

Write your own in Run Convert a program from NyaScript

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run nyascript program.txt

The program is long; save it as program.txt first.

shib manual nyascript

Source

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

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

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