Nulla

From Esolang
Jump to navigation Jump to search

Nulla is Latin for 'zero'. Nulla is a one dimensional stack-based programming language created by User:TheCanon2. Nulla files have the .huh extension. It can be said that Nulla has zero valid symbols, for the entire program is in the file name and not in the actual file.

Decoding

Nulla filenames are read using a modified Base-64 encoding in which "+" and "/" are replaced with "-" and "_" respectively. The bits are then grouped into triades.

The first triade points to a file's position in a series of files. 0b000 is the first file, and then the position increments One can have up to eight files for the same program. The remaining triads are the code.

Commands

Opcode Symbol Action
000 PSZ Pushes 0 to the stack
001 POP Pops the top of the stack
010 OUT Outputs the top of the stack as Unicode
011 PSH Pushes one character of Unicode input to the top of the stack as a number
100 INC Increments the top of the stack.
101 DEC Decrements the top of the stack
110 [ Jumps to its corresponding 111 if the top of the stack == 0
111 ] Jumps to its corresponding 110 if the top of the stack != 0

Examples

Cat

Ga4.huh

When converted, becomes:

000  110 011 010 111 000

Decoded:

0 [PSH OUT] PSZ

The PSZ is superfluous, but it still gets read.

XKCD Random Number

AkkY.huh

When converted, becomes:

000  000 100 100 100 100 011 000

Decoded:

0 PSZ INC INC INC INC OUT PSZ

The final PSZ is superfluous.

Print all of Unicode

Eyn.huh

When converted, becomes:

000  100 110 010 100 111

Decoded:

0 INC [OUT INC]

Flip input

AmfN0v.huh

When converted, becomes:

000  000 100 110 011 111 001 101 110 100 010 001 101 111

Decoded:

0 PSZ INC [PSH] POP DEC [INC OUT POP DEC]