eWagon is a queue- and stack-based language written by User:Timtomtoaster. Its name stands for Esolang Without A Good Name. What makes it unique is that you can switch between a Queue Mode and a Stack Mode. It's also got a few features I "borrowed" from Befunge, especially using quotes to push the ASCII values of strings.
- 1 Command list
- 2 eWagon2
- 3 Sample programs (both versions)
- 4 Using the interpreter (both versions)
- 5 Evil plans (again, both versions)
- 6 External resources
Note: All commands will push their results to the stack/queue (depending on mode) and take their arguments from the argument queue, except
||put the number between the single quotes into the queue/stack|
||put the ASCII values of every character between the quotes into the queue/stack|
||pop/dequeue from the main stack/queue and put it into the argument queue|
||peek from the main stack/queue and put it into the argument queue|
||discard the front value of the stack/queue|
||add two numbers|
||subtract two numbers|
||multiply two numbers|
||divide two numbers|
||perform modulo on two numbers|
||test if two numbers are equal, and push a 1 or 0 accordingly|
||test if two numbers are unequal, and push a 1 or 0 accordingly|
||test if one number is greater than the other, and push a 1 or 0 accordingly|
||test if one number is less than the other, and push a 1 or 0 accordingly|
||print an number with a linebreak|
||print an number without a linebreak|
||print an ASCII character with a linebreak|
||print an ASCII character without a linebreak|
||get numerical input|
||get text input|
||begin a loop|
|| if the condition in the argument stack is truthy, loop to the previous |
|| if the condition in the argument stack is truthy, execute the code between the |
||stop the program|
Some important info:
- Nested loops are supported, nested if-statements are not.
- Multi-line comments are supported.
- All whitespace (spaces, tabs, and linebreaks) are supported.
- Any character that's not listed above is treated as a comment.
eWagon2 is mostly the same as eWagon, but it uses a double-ended queue (deque) for storage. The
~ command switches to "front mode", and
` "back mode" (enabled by default). Front mode will enqueue, dequeue, and peek from the front of the deque, and vice versa for back mode. It doesn't include any performance enhancements, though the interpreter is 21 lines shorter than eWagon1.
Sample programs (both versions)
It seems that there isn't much of a difference in length or the actual code between the eWagon1 and 2 example programs, even though they store things rather differently. Weird.
Cat (numerical input only)
Cat (string input)
Using the interpreter (both versions)
As of writing this page, only one interpreter exists for eWagon. To use it, either execute
git clone https://github.com/tatersmaters/eWagon in the terminal or go to the GitHub page below and download the .zip file, then extract it. Then, execute
python eWagon.py [filename].ewx from the terminal. The extension for eWagon files is
.ew2, depending on which version of eWagon you're using.
Evil plans (again, both versions)
What I plan to implement (feel free to help!):
- Modules & Add-ons
- Modules will be
.ewm(eWagon Module) files, containing pieces of eWagon code. You can call these pieces from within the main program.
- Add-ons will be
.pyfiles, and the interpreter will probably have to be modified to allow new modules to be supported.
- Modules will be
THESE CHANGES AREN'T GUARANTEED!