Wheel

From Esolang
Jump to navigation Jump to search
Wheel
Paradigm(s) Imperative
Designed by User:PixelatedStarfish
Appeared in 2021
Memory system Deque-based
Computational class Turing complete
Major implementations Interpreter (Java)
Influenced by bf, Heck
Influenced Vessel
File extension(s) .wlang

Wheel (WHolly ElEgant Language) was created by User:PixelatedStarfish in 2021. The syntax of the language is designed to be terse, with single character operations. The syntax is influenced by bf and Heck.

Memory

Wheel is designed such that memory in the language can be stored on a specialized Deque as if bytes are stored on an (expandable and unbounded) spinning wheel. Integers ranging from 0 to 255 are stored at each value, and each value is accessible via an index that wraps.

Operations

Note that some operations take parameters as decimal values. C65 prints A.

Operations Table
Op Desc
+ Add to val
- Sub from val
< Rotate Anticlockwise
> Rotate Clockwise
L Label
G Goto
Z Goto if 0
Y Goto if not 0
D Decrease size of wheel (Removes value at pointer.)
I Increase size of wheel (Adds a value to wheel.)
V Print as Value
C Print as ASCII
# Set index to 0
* Take Input and Store at Cell
% Shuffle Wheel
@ Print Wheel
^ Print Wheel Index
$ Halt
(Comment) A comment

Grammar in EBNF

Grammar:
Program ::= {Codon}
Codon ::= Symbol | (Symbol, Value)
Value ::= {Digit}
Digit ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
Symbol ::= '+' | '-' | '<' | '>' | 'L' | 'G' | 'Z' | 'Y' | 'D' | 'I' | 'V' | 'C' | '*' | '%' | '^' | '#' | '@'

Program Examples

Hello World

C72C69C76C76C79C32C87C79C82C76C68

Truth Machine

I*Y00V$L00V01G00

Random Number (0-9)

I10>+>+2>+3>+4>+5>+6>+7>+8>+9%V

Proof of Turing Completeness

Bf is Turing complete. By translating each bf command to Wheel, it can be shown that Wheel is also Turing complete. (Note that ' :: ' is a stand-in for a newline.)

Conversion Table
Wheel bf Desc
> > increment
< < decrement
+ + add 1 to cell
- - take 1 from cell
C . Output ASCII value at cell
* , Take input at cell
Zx [ Jump past ' ] ' (to label x)
Zx :: Gy :: Lx ] goto ' [ ' (label y) if cell is greater than 0

External Links

Interpreter (Java)