NASAL

From Esolang
Jump to navigation Jump to search

NASAL is an esolang by User:ChuckEsoteric08.

Specification

NASAL uses stack as memory. If program contains any invalid character it's an error.

Command Function
mx push x to the stack. x should be valid character
ɱ pop and discard
ɳx while top!=x
ɲ end while
ŋ move element from top to bottom
ɴ move element from bottom to top

Output extension

It adds command n which outputs top of the stack

Examples

Pop until zero

This program is populated with the numbers (m, ɴ, ŋ, m), ere it repeatedly iterates and pops the these elements until the desinent member, m, remains:

mmmɴmŋɳmɱɲ

Rearrange until zero at top

This program repeatedly rearranges the initial stack (ŋ, ɴ, ɲ, m) until the element m is empighted at the front:

mmmɲmɴmŋɳmŋɴŋɲ

Computational class

NASAL is Turing-complete because it can simulate BitBrain-R :

BitBrain NASAL
start of the program mmmmmmmmmmmmmmmmmmmm
> ŋ
< ɴ
[ ɳm
] ɲ
+ mmŋ
* ɳmɱmɴmmɲɳɴŋɳɴɴɱmɴŋmɴɲɱɴɲ

Interpreter

  • Common Lisp implementation of the NASAL programming language. Please note that the concrete character set deployed constitutes a dependency on the Common Lisp implementation; in corollary, Unicode support may or may not be a feature incorporated in the personal environment. The interpreter at hand has been developed and tested with Steel Bank Common Lisp (SBCL) version 1.1.4 as part of the Lisp Cabinet 0.3.5 bundle.