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
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
| Command | Does |
|---|---|
mx | Push 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 |
n | Print 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.
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
- Turing tarpit: six commands simulate a full tape language.
- Stack machines: a stack that rotates is a ring.
Further
See also
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 nasalSource
- 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