E

From Esolang
Jump to navigation Jump to search

For the object-capability language, see wikipedia:E (programming language).

E is an esoteric programming language created by User:EeEee. E is a blatant ripoff of Chicken, however the only available token is the letter 'E'.

Commands

Stolen directly from Chicken, E (the language) works by repeating 'E' (the letter), enough times to execute the desired command.

Opcode Name Description
0 exit Stop execution.
1 eeeeeee Push the string "E" onto the stack.
2 add Add two top stack values.
3 subtract Subtract two top stack values.
4 multiply Multiply two top stack values.
5 compare Compare two top stack values for equality, push truthy or falsy result onto the stack.
6 load Double wide instruction. Next instruction indicates source to load from. 0 loads from stack, 1 loads from user input. Top of stack points to address/index to load onto stack.
7 store Top of stack points to address/index to store to. The value below that will be popped and stored.
8 jump Top of stack is a relative offset to jump to. The value below that is the condition. Jump only happens if condition is truthy.
9 char Interprets the top of the stack as ascii and pushes the corresponding character.
10+ push Pushes the literal number n-10 onto the stack.

Memory model

As in Chicken, the stack (represents the memory of the program) has three segments. The first segment contains two registers. The first register just points to the stack itself (by reference). The second register contains the user input, which is usually a string. These registers are used by the LOAD instruction. The second segment contains the loaded code. For each line of the code there is a cell on the stack containing the amount of chickens on that line. This segment is directly used for execution. It is automatically padded with a single EXIT instruction. The third segment contains the actual program stack. As instructions are executed, they will push and pop values in this space. Since the segments are not isolated, it is possible to modify values in the code space or execute in the user stack space.

Sample programs

Cat

E E E E E E E E E E E
E E E E E E

Hello, world!

E E E E E E E E E E E E E E E E E E E E
E E E E E E E E E E E E E E E E E E E E
E E E E
E E E E E E E E E
E E E E E E E E E E E
E E E E E E E
E E E E E E E E E E
E E E E E E E E E E E E E E E E
E E E E E E E E E E E E E E E E
E E E E
E E E
E E E E E E E E E E
E E E E E E E E E E E E E E E E E
E E E
E E E E E E E E E E
E E E E E E E E E E
E E E E E E E E E E E E E
E E E E E E E E E E E
E E E E E E E E E E E E
E E E E E E

E E E
E E E E E E E E E E E E E E
E E E E
E E E E E E E E E E E E E E E E E E E E E
E E E E E E E E E E E E E
E E E E E E E E E E E E E E E E
E E E E E E E E E E
E E E E E E E E E E E E E E E
E E E E E E E E E E E E E
E E E E E E

E E E E
E E E E E E E E E E E E E E E E E E
E E
E E
E E E E E E E E E
E E E E E E E E E E E
E E E E E E

E E
E E E E E E E E E E E
E E E E E E E
E E E E E E E E E E E E
E E E E E E

E E E E E E E E E E E E
E E E
E E E E E E E E E E E E
E E E E E E E
E E E E E E E E E E E E
E E E E E E

E E E E E E E E E E
E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E
E E E
E E E E E E E E
E E E E E E E E E E E
E E E E E E

External resources

It is interesting to note, that there is a direct bijection between E, and another Esolang known as Chicken. It is easy to convert an E program into a Chicken one or vice-versa with a simple find-and-replace; thus we provide links relevant to the Chicken language below: