esolang

NASAL

Six nasal letters, a stack that can turn around, and one loop.

ChuckEsoteric08, 2023 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: m

The idea

ChuckEsoteric08 made NASAL in 2023. Every command is a letter for a nasal sound, m, ɱ, ɳ, ɲ, ŋ and ɴ, and the only values are those letters themselves. Moving elements between the top and the bottom turns the stack into a ring, which is enough to act as the tape of BitBrain, so the specification shows NASAL is Turing complete.

The machine

CommandDoes
mxPush the letter x
ɱPop
ɳx ... ɲLoop while the top is not x
ŋMove the top element to the bottom
ɴMove the bottom element to the top
nPrint the top, from the output extension

Any other character in the program, even a space, is an error.

Example

The first is the pop until m, with an n at the end to show what is left.
Expected: ŋɴɲm

The first is the pop until m, with an n at the end to show what is left. It pushes m, ɴ and ŋ and pops until m is on top. The second is the rearranging loop with an n before it and one at the end of each turn. Each turn moves the top to the bottom, so the stack comes round one place at a time until m is on top.

Patterns it teaches

Further

Also in Turing tarpits

Write your own in Run Convert a program from NASAL

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run nasal -e 'mmmɴmŋɳmɱɲ'
shib manual nasal

Source

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

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

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