StackNya

Description

StackNya is a stack-based language. This means that there's a single array (called a stack) around which all calculations are based. When a function is called, it receives its arguments by removing them from the stack.

Syntax

A StackNya program consists of one or mowe tokens. A token consists of a type (single letter) followed by a payload, optionally in parentheses, in which case it goes on as long as the initial parentheses are closed. Currently, these types exist:

Functions

Functions that correspond to binary operators work mostly as you'd expect, taking the second-to-top element on the stack as their first argument, and the top element as their second argument. These include

+, -, *, /, %, >, <, = (like C ==), >=, <=, . (used for concatenation - + works for integers only), &, | (like C && and ||)

The others are:

Examples

Hello, World!

s(Hello, World!) fMeow

yes

s(s(y
) fMeow bPurr) bPurr fNya
    

FizzBuzz

Interpreter