Eul

From Esolang
Jump to navigation Jump to search

Eul is an esoteric programming language, created by User:Backspace. It has been desinged to be short and percise. It is a stack-based language.

Naming

Eul's name comes from words "eu", meaning "good" in latin, and "l", contradiction of word "language". It means "good language".

Memory

The only data structure in Eul is its single stack. This stack supports basic operations, such as push and pop, as well as other operations, including arithmetic operations, number to string conversion and others. Every item of stack is a 32 bit integer.

Operators

operator what it does
~ Pops the first element.
[ Pops last element and pushes it to top.
] Pops the first element and pushes it to bottom.
+ Pops first two elements and pushes their sum.
- Pops first two elements, substracts them, and pushes result.
* Pops first two elements, multiplies them, and pushes result.
/ Pops first two elements, divides the second by the first, and pushes result.
% Pops first two elements, divides the second by the first, and pushes remeinder.
> Pops first two elements and pushes 1 if the second is greater, 0 if not.
< Pops first two elements and pushes 1 if second is smaller, 0 if not.
= Pops first two elements and pushes 1 if they are equal, 0 if not.
& Pops first two elements, performs logical and on them, and pushes result.
| Pops first two elements, performs logical or on them, and pushes result.
$ Adds label at current location.
? If second element on stack is not 0, then jump to the label indicated by the first element of stack (indicates the number of label). Also, pop the first element.
! Pops the first element, performs logical not on it, and pushes result.
: Duplicates the first element.
_ Swaps first two elements.
# Pops first element, converts each of its digits into their UTF-8 values, and pushes these values. Basically, converts interger into string.
@ Pops specified number (by the value of first element) of elements, reads them as digits, and pushes all digits together to form an integer. Basically, converts string to interger. Also pops first element.
. Used as a separator between to integer literals. Pushes an integer when coming directly after it, does nothing otherwise.
; If used at the beginning of program turns debugging mode on.

Computational Class

Eul has stack roll operations, which put the first item on stack to the back of stack or the last item on stack to the front. These operations (probably) make the language Brainfuck equvalent, thus Turing complete.

Example programs

  • Hello World
Hello, World!
  • Cat

(empty program)

  • Quine
this is quine
it is also quine
a
  • Print all ASCII characters
0.0$~:1+:126<0?~

External resources

You can learn more about Eul at GitHub.