evil
Every lowercase letter is a command, so almost any word is a program. The point is that it looks like line noise.
Tom Wrensch, 1999 · Turing complete: unknown · ●●● hard · esolangs.org
Tested with 4 known programs · Hello World on Try It Online: identical · Test method
Run it
The idea
Tom Wrensch made evil around 1999, as a graduate student at the University of Colorado. It belongs to the line-noise school, with 26 commands, one for each lowercase letter, and nothing else matters. A program is a string like zaeeeaeeew.
Read the story
Most work happens in one byte, the accumulator A. Constants are built with a trick called the weave, e, which shuffles A's bits. Eight weaves give the starting value back, and a mix of weaves and a (add 1) reaches any byte in about ten letters. 72, H, is zaeeeaeee.
The strangest command is q. It swaps the program with the wheel, a ring of data bytes. Data becomes code and code becomes data, which makes a quine possible.
The machine
| Part | What it is |
|---|---|
| A | The accumulator, one byte |
| Wheel | A ring of bytes that can grow and shrink, starting as one 0 |
| Pental | A ring of exactly five bytes |
| Mode | Standard (marker m) or alternate (marker j) |
| Letters | Do |
|---|---|
a u z | A + 1, A − 1, A = 0 |
e | Weave A: bits 76543210 become 64725031 |
w r | Write A, read a byte into A |
p y l | A = wheel cell, cell = A, swap them |
c d i o | Insert a wheel cell, delete one, move right, move left |
g k v h n | The same for the pental, and move on it |
s t | Skip the next character if A is 0, if A is not 0 |
f b x | Jump forward or back to a marker, switch the mode |
q | Swap the program and the wheel |
The program ends when the source pointer leaves the source.
Example
The first is the hello world, cut to two letters; spaces are ignored.
The first is the hello world, cut to two letters; spaces are ignored. The second is the quine. It builds a small program on the wheel, one letter per cell, then q swaps. The new program walks the wheel, which now holds the old source, and prints every letter.
Patterns it teaches
- Hostile design: no character means anything to a reader.
- Self-modifying code:
qturns data into the running program. - Quine: the swap makes printing yourself a matter of storing yourself first.
Further
See also
Also in Hostile
Write your own in Run Convert a program from evil
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: evil.
Command line
shib run evil -e 'rwfwmrw' --input 'ab'shib manual evilSource
- Module
langs/tio/ports.js- Interpreter
langs/tio/evil.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org