Glypho

From Esolang
Jump to: navigation, search

Glypho is an esoteric programming language based on symbol independence. It was created by Brian Thompson in September 2005. Each instruction is composed of a string of 4 symbols which may be any value, and the language determines which instruction is executed based on the set of symbols in the string.

Glypho operates on a single stack which has the ability of rotating its elements around - pushing the top element onto the bottom of the stack, and pushing the bottom element onto the top of the stack - allowing for random access of the entire stack in O(n) time where n is the number of elements on the stack.

The instruction reference is given here. For each instruction, the characters abcd represent the symbols composing each instruction. a refers to the first unique symbol, b refers to the second unique symbol, etc.

aaaa ..... n NOP - no operation; do nothing
aaab ..... i Input - push input onto top of stack
aaba ..... > Rot - pops top stack element and pushes to bottom of stack
aabb ..... \ Swap - swaps top two stack elements
aabc ..... 1 Push - pushes a 1 onto the top of stack (creates new element)
abaa ..... < RRot - pops bottom element and pushes to top of stack
abab ..... d Dup - Duplicates top stack element
abac ..... + Add - pops top two elements and pushes their sum
abba ..... [ L-brace - skip to matching ] if top stack element is 0
abbb ..... o Output - pops and outputs top stack element
abbc ..... * Multiply - pops top two elements and pushes their product
abca ..... e Execute - Pops four elements and interprets them as an instruction
abcb ..... - Negate - pops value from stack, pushes -(value)
abcc ..... ! Pop - pops and discards top stack element
abcd ..... ] R-brace - skip back to matching [

Glypho is based on Udage and the quest for symbol-independent programming languages.

Turing completeness proof[edit]

By simple conversion from brainfuck. For infinite tape to right stack must have unlimited depth.

Command Glypho short form
Start 111-+
> < [ > 11-+ 11-+ > ] <
< >>
+ 1 +
- 1 -+
. d o
,  ! i
[ [
] ]

External resources[edit]