YAASEL

From Esolang
Jump to navigation Jump to search

YAASEL (Yet Another Another Stack-Based Eso-Lang) is a Stack-Based Programming Language featuring 15 individual Instructions, it was created by Felix Eckert (user:Bertrahm). It is partly inspired by Brainfuck. It currently has a Web-Implementation written in Java-Script and a Java Implementation. The Source Code of both can be found on the YAASEL Github Repository.

Language Overview

YAASEL has a Stack consisting of bytes and a single-byte buffer or stash.

Instructions
Instruction Character Instruction Name Description
> Larger Than Checks if the top of the Stack is larger than the second to top.
< Smaller Than Checks if the top of the Stack is smaller than the second to top.
= Equal To Checks if the top of the Stack is equal to the second to top.
: Jump Point A Point for the Program to Jump Back To
! Jump Back Jumps to last Jump Point
$ Stack Empty Exit Exits if Stack is Emtpy
& Merge Adds top of Stack with the current value of the Buffer/Stash
+ Increment Increments top of Stack by 1
- Decrement Decrements top of Stack by 1
# Void Voids the top value of the Stack
' Stash Stashes the top value of the Stack to the buffer
" Push Stash Pushes the value from the stash/buffer to the stack
* New Value Creates a new entry in the stack
~ Input Gets input from the user and writes it to the stack
% Print Prints the value on top of the stack encoded in ASCII
Notes

The Conditionals (>, <, =) place the top value of the stack to the left of the operator and the second-to-top to the right. If a comparison is true, the program will continue on from that point, if not, it will jump back to the last Jump Point or start of the program.

Stashing a Value will remove it from the stack. Loading the Stash/Buffer to the stack will create a new entry in the stack.

Examples

This example prints out "HELLO WORLD!" with a new-line.

 *     Create new Entry in Stack for operation
 Increment up to a Base Value for Printing Hello World
 ++++  Start with 4
 '     Stash
 "     Copy Stash
 &     Merge      8
 '     Stash
 "     Copy Stash
 &     Merge      16
 '     Stash
 "     Copy Stash
 &     Merge      32
 '     Stash
 *     New Stack Entry (We want to keep the 32, as it is the SPACE character)
 "     Copy Stash
 &     Merge      64
 ++++++++         72 (H)
 %
 ---              69 (E)
 %
 +++++++          76 (L)
 %%
 +++
 %                79 (O)
 "%#              32 (Space)
 ++++++++         87 (W)
 %
 --------         79 (O)
 %
 +++              82 (R)
 %
 ------           76 (L)
 %
 --------         68 (D)
 %
 "+%              33 (Exclamation)
 #* ++++++++++ %  10 (LineFeed)

This is the reverse-cat program written in YAASEL

 ~   Get User Input
 :   Jump Point
 %   Print Top Value
 #   Void
 $   Exit if Stack Empty
 !   Jump Back

External Links