Execoil

From Esolang
Jump to navigation Jump to search

Execoil is an esolang by User:BoundedBeans inspired by Underload and _. The code is a stack, kind of like _, but unlike _, it is a stack of strings rather than a stack of characters like _.

Storage

Execoil has only one data storage space: the stack. The code is the original stack contents, with the later lines being popped first. Any line of the code not containing exclusively digits is treated as a comment and is not added to the stack.

Execution

Execution starts at the bottom of the stack, on the first character. It continues executing commands in the string, from left to right. Once the string has been executed, it is NOT deleted and rather stays below the pointer, and the pointer moves to the next string. In the case that the current string is deleted, the pointer moves to the next. Once the pointer reaches the end of the stack, it moves back to the bottom of the stack. The program halts when the stack is empty, either through the only element popping itself, or the only element deleting itself. The program also halts if it encounters an empty string. If there is only one element, it executes over and over until another element is added or a halt condition is met.

Commands

0 - no-op
1 - pop and discard an element from the stack
2 - delete the currently executing string
3 - push "0" onto the stack. Mainly useful for later concatenation
4 - save everything after the 4, push it onto the stack, and delete the currently executing string
5 - save everything after the 5, concatenate it to the end of the top stack element, and delete the currently executing string
6 - save the whole current string, push it twice onto the stack, but don’t delete it
7 - remove the first and last digit of the top item
8 - pop the top item off, output it
9 - skip the next command, depending on it, execute something else
91 - input a string, push onto the stack, but remove all non-numbers
92 - reverse the stack, placing the pointer at the place where the string now is
93 - if the top string has 0, 1, or 2 characters, skip the pointer to the next string
94 - "eat" the top string, appending it to the current one and placing an empty string in its place
95 - pop the top string, append it to all strings
96 - pop the top string, go through every string and replace the contents of that top string with "0"

See also

  • Sugueziume, the sequel
  • Underload, a language with a similar idea of executing memory to process it
  • _, another language with the stack as the code