EOOOL
EOOOL stands for Esoteric Obfuscated Object Oriented Language (I know it is redundant to say a language is esoteric or obfuscated on this site, but I do not really care.)
Overview
EOOOL is both a stack based and an object based language. All operations are done on the stack and all local variables are stored in the stack, while all methods, global variables, object variables, and individual items on the stack are stored in objects. The most important part of EOOOL is that every operator is a single character, and there are only two ways to create a blocks, but these are entirely handled in a preprocessor. The other important aspect that comes from this is that there are no variable names, only indexing of arrays of variables. Also all alphabetic characters are illegal unless in a comment.
Variables
There are three different types of standard objects, they are:
- Class which has type -1
- Integer which has type -2
- Array which has type -3
Their type is just their index in the array of classes. User defined objects have positive types counting from 0. Classes contain the type of their instances. Integers contain an integer. Arrays are an n-dimensional array with a specific sub-type.
Operators
There are actually a lot of operators, 35 to be exact. All of them symbols except for the digits, and there are 6 more (8 total) to define syntax.
Numbers
Integers are quite simple, just a single digit, and all they do is push their number on the stack.
6 -> [6]
That is all it is, however watch out for things like the following as they actually push two separate digits onto the stack.
34 -> [3,4]
_ is used to easily create bigger integers by concatenating the top two integers like so:
78_ -> [78] 1234___ or 12_3_4_ -> [1234]
~ negates the top integer
23_~ -> [-23]
+-*/\ add, subtract, multiply, integer divide, and modulus respectively. These are very simple except that act on a stack so there is no order of operations. Also internally, they work from right to left so:
49+ -> [13] 49- -> [5] 49* -> [36] 49/ -> [2] 49\ -> [1] 12+34*/29-\ -> [3]
| is the sign of the top integer, negative -> [-1] zero -> [0] positive -> [1]
5~| -> [-1] 0| -> [0] 5| -> [1]
= tests for equality of the top two integers, false -> [0] true -> [1]
46= -> [0] 55= -> [1]
Stack
Seeing as there is a stack, you need to be able to play with it, which can be done in a few ways, but slightly un-intuitively.
& duplicates, the top value is how many items to copy, not how many copies to make
76543& -> [7,6,5,4,6,5,4]
. removes, the top value is how many items to remove
76543. -> [7]
][% pull, push, and flip, top item is the index/amount which starts at 1
76543] -> [7,5,4,6] 76543[ -> [7,4,6,5] 76543% -> [7,4,5,6]
Objects
The object oriented operators are very annoying as they can change very slightly based on what is on the top of the stack and, unless properly taken care of, lose references the the objects you are working with, making it very long to simply use objects
> get if the top value is an integer, get the item that is the ith object variable, otherwise the next value is the index of the variable in the first item.
< set same as get, with the next item as value to set the index to
^ type number a class returns the instance type, an object returns its type, integers and arrays do not work
$ class an object returns its class, an array returns its subclass, an integer returns the ith class
! new instance a class returns a new instance of its self, two numbers return a new array top value as the depth and next value as the type of the subclass
Methods, when run, pop their input of the stack to create a new stack, and push their returned values.
' run same as get to get the method
Flow control methods can only use methods inside the current class/object
? if if the next value (top value is the method) is not equal to 0 run the method, note that the input is not removed if the method is not called, but the test and index are removed from the stack
; while same as if, except that it will continue to pop a test (it will remember the method) and run the method while the test is not 0
: for the next value is the start, then end, then step (the step argument is always there) for every step it will push the next value then run the method
Input and Output
Input and Output are very simple, yet to make it worse, they use their own (intuitive?) character set to make things difficult
)( are input and output, read/print a character/integer converted to a integer/character through the custom charset which is:
positive 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.:!<[({/|"=+^&@$ abcdefghijklmnopqrstuvwxyz,;?>])}\_'~-`*#% negative 0123456789012345678901234567890123456789012345678901 1 2 3 4 5
-1 through -9 are (though -5 through -9 are pointless and are only there to fill space):
EOF,ENTER,TAB,SPACE,START,PAUSE,SKIP,BACK,STOP -1 -2 -3 -4 -5 -6 -7 -8 -9 e n t s [ | > < ]
printing -1 through -4 print what they mean (EOF preemptively terminates the program)
-5 through -9 print *NAME*
reading \1 through \9 return -1 through -9
reading \char returns the corresponding value
reading \\ reads as \ so that for example you can read 3\\4 as 3\4 and not have problems
otherwise \? reads as \?
Syntax
The syntax is very simple, basically ,{} give structure to the program with some types to make things explicit and comments.Types are defined using !@#$ or array,object,integer,class.However, objects and arrays have some extra 'arguments'.
Objects have a preceding number to define their type(not necessarily a single digit)
Arrays have both a preceding number and type for their depth and sub-type
for example: #2!3@$ would be a 2d number array,an instance of the 3rd class, and a class
Methods are:
<input>,<output>{<method>}
Input and output are a set of types and method is a set of operators that uses a stack that starts with the input and ends with at least the output(there can be more but only the output is returned)
classes are:
<global types>,<object types>{<global methods>,<object methods>}
Global and object types are a set of types and global and object methods are a set of methods.
A program consists of a set of classes and starts by running the first method of the first class, which must have no input, and output doesn't matter(syntactically it is still there though)
Comments are surrounded by quotes. The program also omits all white space as it does not mean anything to it. Anything remaining that is not an operation or syntax is illegal. In the custom character set, all the alphabetic characters are illegal as well as `.
External resources
- Working EOOOL Interpreter written in Java.
- Some examples.