esolang

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

Expected: He

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

PartWhat it is
AThe accumulator, one byte
WheelA ring of bytes that can grow and shrink, starting as one 0
PentalA ring of exactly five bytes
ModeStandard (marker m) or alternate (marker j)
LettersDo
a u zA + 1, A − 1, A = 0
eWeave A: bits 76543210 become 64725031
w rWrite A, read a byte into A
p y lA = wheel cell, cell = A, swap them
c d i oInsert a wheel cell, delete one, move right, move left
g k v h nThe same for the pental, and move on it
s tSkip the next character if A is 0, if A is not 0
f b xJump forward or back to a marker, switch the mode
qSwap 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.
Expected: zuueeueeuuykueeucyguuuucygaaacyueecygaeeucygeeacyuuuucygcyuuuucygueecyguuuucyq

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: q turns data into the running program.
  • Quine: the swap makes printing yourself a matter of storing yourself first.

Further

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 evil

Source

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