Mountain

From Esolang
Jump to navigation Jump to search
Not be confused with the earlier version of the language.

Mountain is a stack-based esolang created by User:ChuckEsoteric08 which was inspired by Grass and Unreadable. Program is made out of two characters: ʌ and ʍ.

Commands

Instructions are 1-indexed and are normally written without spaces between them

Pseudocode Instruction Meaning
psh ʌʍ...ʍ push the number of ʌ (which shouldn't be zero) between ʍ's to the stack
neg ʌʍʍ negate top element
jmp ʌʌʍ pop n, a and b and if a is equal to b jump to the n-th instruction. If n is negative or 0 halt
add ʌʌʍʍ pop a and b  push b+a
rot ʌʍʍʍ pop number from the bottom and push it to the top
dup ʌʌʌʍ duplicate top element
out ʌʌʍʍʍ pop number and output it as ASCII character
inp ʌʍʍʍʍ push next byte of input to the stack

Computational class

Mountain is Turing-complete because it can simulate Minsky machine.

Examples

Cat Program

The following program demonstrates an infinitely repeating cat program:

ʌʍʍʍʍʌʌʍʍʍʌʍʌʍʌʍʌʍʌʍʌʍʌʌʍ

Truth-Machine

A truth-machine is implemented below:

ʌʍʍʍʍʌʌʌʍʌʌʍʍʍʌʌʌʍʌʍʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʌʍʌʍʌʌʍʌʌʍ

Interpreter

  • Common Lisp implementation of the Mountain 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.