Nicbudd

16b64

The world's silliest programming language.

Github Link

16b64 is a work-in-progress esoteric joke programming language designed to question the fundamentality of constants in programming.

There are ten 16-bit constants in 16b64 that must be manipulated to generate the other numbers. They are numbered 0-9 and are based on the first 20 bytes of the SHA-256 hash of "16b64".

Operations are done to a stack with 16 bit words in reverse polish notation. The language has 64 instructions, each written with single characters. The operations include the characters A-Z, a-z and loops are done with (), giving 64 possible instructions.

The name comes from two parts: "16b" from the 16-bit stack and variables, and "64" from the 64 possible instructions that can be used.

The Birth Of The Idea

The idea for 16b64 came while I was looking over other esolangs, specifically Brainf**k (which I will shorten to "bf"). Something about bf intrigued me, the pure simplicity of the rules leading to intensely complex and creative solutions to work around the language, however, something seemed just too "easy" about it, and helpfully convenient. The idea of the + and - operators, being able to simply increment by one just didn't sit right with me as being inconvenient enough like the rest of the language. If you want the number 200, you can just type 200 "+"! Nonsense.

That gave the inspiration to make a language with the goal of being terribly inconvenient. Perhaps not the most inconvenient to exist, but certainly difficult to use.

Here is a quick example for the general concepts of 16b64.

CodeExplanation
5Puts 0x4fda (the value of the constant 5) on the stack.
2Puts 0xfc26 (the value of the constant 2) on the stack.
NBitwise NOT previous item on stack.
aAdd together previous two items on stack (ignore overflow).
XBitwise XOR previous two items on stack.
5NPuts 0xb025 (bitwise NOT of 0x4fda) on the stack.
22a Puts 0xf84c (0xfc26 + 0xfc26) on the stack.
5N22aXPuts 0x4869 (0xb025 XOR 0xf84c) on the stack.
CPrint previous two bytes on stack to stdout in two 8-bit characters.
5N22aXCPrints "Hi" ("H" = 0x48, "i" = 0x69)

Online Interpreter

The online interpreter is a version of the Rust 16b64 interpreter compiled for WebAssembly. This online version is definitely a work in progress still; it uses a modified version of the interpreter which I intend to merge with the original. If it doesn't respond to your input then it has probably encountered an error of some sort.


Debug Messages

Examples

Hello, World!

Prints "Hello, World!"
5r61lAaC3l33RAC7N92XlaC081lXlXC585raNXC042lANaC015AaC

Hello, World! x10

Prints "Hello, World!" 10 times, using loops.
613LA3bd(5r61lAaC3l33RAC7N92XlaC081lXlXC585raNXC042lANaC015AaC54Oa)

Doomsday Method Calculator

Calculates the anchor day for a given year for use in the doomsday method of determining the day of the week.
JJJJ099lalaaz099lalaaz099lalaaz099lalaazSlDllaa0pSlDllaaSb(6r92aAa)rb(6r92aAa)77r7NOaMN77rAaS1r5NAM00Xed(d092aAa9)52ONed(d00Xa9)092aAed(d58ONa9)102laXed(d102laXa9)d77r7NOaM00Xed(231lXaC26NArCi)52ONed(69r4raXC26NArCi)092aAed(763AraC663NalXC)102laXed(105laNXC3l67OAC663NalXC)1r5NAed(168AlXC608XrXC51r1lXaC)58ONed(792ONaC629lAaC)621rAAed(932laXC13N6NaXC393rarAC)9r55RXC701lOXC16NAlC106AAaU1l06AXC

Day of Week Calculator

Calculates the day of the week given a date in MM-DD-YYYY format. Built off previous doomsday method calculator. WORK IN PROGRESS.
45O3bd(J099lalaa25Oleid)dS45Oed(S00Xi)lDllaa6Nf3bd(J099lalaa25Oleid)dS45Oed(S00Xi)lDllaa6NfdJJJJ099lalaa1Np099lalaa1Np099lalaa1Np099lalaa1NpSlDllaa0pSlDllaaSDN7r7ArMDrAS00Xed(0fD7r7ArM00Xeidd0f(S00XAi)0f3bdi)S5lpb(6r92aAa)rb(6r92aAa)77r7NOaMN77rAaS1r5NAM00Xed(d092aAa9)52ONed(d00Xa9)092aAed(d58ONa9)102laXed(d102laXa9)d77r7NOaM0p2rN3aaS6r14XAcd(bi(N52ONaai))6r14XAed(d6rN0lOai)58ONed(d9l24Aaai)1r1Arred(d58Olai)2r3Xrred(d25Ollai)7r1Arred(d0l5Ollai)14X0Aed(d0fb0p(1r1ANai)0fbid(6rN0lOai))52ONed(d0fb0p(0l5Olai)0fbid(25Olai))a77r7NOaM00Xed(231lXaC26NArCi)52ONed(69r4raXC26NArCi)092aAed(763AraC663NalXC)102laXed(105laNXC3l67OAC663NalXC)1r5NAed(168AlXC608XrXC51r1lXaC)58ONed(792ONaC629lAaC)621rAAed(932laXC13N6NaXC393rarAC)9r55RXC701lOXC16NAlC106AAaU1l06AXC

Reference

Constants
InstructionValue (hex)
00x1c72
10x14bc
20xfc26
30x7e37
40xb53f
50x4fda
60x20fe
70x445a
80xb76a
90x25e5
Instructions

Unmarked instructions are currently unused.

The "Mode" category describes how the instructions interact with the stack. A table of modes is provided below this table. The "Stack" column describes how the total size of the stack will change after each operation.

InstructionModeAction
AArithmeticx AND y
B
CWritepush x to STDOUT as two ASCII char
DDuplicateduplicate x
E-halt; exit program
FComplex Movefind value x positions down in the stack and move it to the top. (0 = top, 1 = second from top, etc)
G
HReadpush next stdin to two values
IReadpush next two STDIN to one stack value
JReadpush next one STDIN byte to stack
K
LModifyx cyclic shift left by y places
MArithmeticy modulo x
NModifyNOT x
OArithmeticx OR y
PComplex Movemove y to x positions down in the stack.
QConstantpush random number to stack
RModifyx cyclic shift right by y places
SMoveswaps x, y on stack
T
UWritepush U+x to STDOUT as Unicode
VWritepush U+yx to STDOUT as Unicode
W
XArithmeticx XOR y
Y
Z
aArithmeticx + y, set flag true if overflow
b-flag = LSB of x
c-x < y, set flag to result
dDeletedelete x
e-x == y, set flag to result
fComplex Movefind value x%16 positions down in the stack and move it to the top (4 bit version of F)
g-x > y, set flag to result
h
i-invert flag
j
k
lModifyx cyclic shift left by 1
m
n
o
pComplex Movemove y to x%16 positions down in the stack. (4 bit version of P)
q-randomly set flag to true or false
rModifyx cyclic shift right by 1
s
t
u
v
w
x
yMovePull bottom of stack to top of stack
zMovePush x to bottom of stack
(-start of loop, enter only if flag == TRUE
)-loop if flag == TRUE
Modes
ArithmeticRemoves two values from the stack and adds one back.
ReadRemoves one or two values from the stack.
WriteAdds one or two values to the stack.
MoveMoves values around without changing amount of elements.
ModifyRemoves one value from stack, performs some operation on it, and places it back.
Complex MoveRemoves the top variable on the stack and moves the rest of the variables around.
DuplicateRemoves one value from stack and adds two.
DeleteRemoves one value from stack.
ConstantAdds one value to stack.