esolang

Meowlang

Every program is a cat talking. The more meows in a row, the higher the number.

Wixette · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 4 known programs · Test method

Run it

Expected: 🐈🐈🐈

The idea

Wixette made Meowlang after Chicken. A program is a list of numbers, and each number is written as that many meows, ended by a semicolon. Meow; is 1 and a bare ; is 0. The cat may speak any of nine words, Meow, Miaow, Meaw, Miaou, Miao, Miau, 喵, ニャー and Мяу, and mix them freely. There is also a plain form with one number on each line.

Read the story

The list is the program and the only memory at once. A push adds to the end of the program and a pop takes from it, so a program can read, overwrite and even eat its own instructions.

The machine

The tail is the last element of the list, and N is the element after the instruction.

NumberNameDoes
0RETPrint a line feed
1MEOWPrint as many cat emoji as the tail says
2 NPUSHPush N
3POPPop the tail
4 N, 5 NLOAD, SAVEPush element N; copy the tail into element N
6, 7ADD, SUBAdd or subtract the last two; never below 0
8 N, 9 NJMP, JEJump to N; jump if the tail is 0
10, 11YOWL, SNIFFPrint a character; read one, 0 at the end
12, 13NAP, SCRATCHSleep; clear the screen

Anything from 14 up does nothing. The run ends when the pointer passes the end of the list.

Example

Meow; is MEOW and the three meows after it are the tail, so it prints three cats.

Meow; is MEOW and the three meows after it are the tail, so it prints three cats. Then the 3 runs as POP and eats itself.

In the plain form, PUSH 72 and YOWL print H, PUSH 105 and YOWL print i, and RET ends the line.

Expected: Hi

The echo reads until the 0 at the end of input and jumps to RET. That 0 stays on the list, runs as one more RET, and the output ends with two line feeds.

Expected: cat

The Fibonacci program keeps the last two numbers in elements 2 and 3 of its own code. It prints ten rows of 1, 1, 2, 3, 5, 8, 13, 21, 34 and 55 cats, and at the end its YOWL pops the program's own last element, a 10, and prints it as one more line feed.

Patterns it teaches

Further

Pseudonatural

Self-modifying

Write your own in Run Convert a program from Meowlang

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run meowlang -e '11 // [0] SNIFF — read one character from stdin
9  // [1] JE
6  // [2] → jump to index 6 if input is 0 (end of input)
10 // [3] YOWL  — echo the character
8  // [4] JMP
0  // [5] → back to index 0
0  // [6] RET   — final newline' --input 'cat'
shib manual meowlang

Source

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

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

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