Enn

From Esolang
Jump to navigation Jump to search
Enn
Paradigm(s) imperative, hardware descriptor
Designed by User:Las-r
Appeared in 2026
Computational class Bounded-storage machine
Major implementations GitHub
Influenced Menn, Senn
File extension(s) .enn

Enn (Executable NAND Network) is a logic-oriented esolang made by Nayif Ehan in 2026.

An interpreter, and more examples can be found on GitHub.

How Enn works

Every instruction in Enn does 1 of 4 things:

  • Set a variable
  • Output a variable
  • Toggle a variable
  • Check for input

The only computation given to you is the ability to use NAND (and also NOT, technically).

IMPORTANT NOTE: Every program loops by default. To end a program, you must forcequit it, or use the --once argument.

Syntax

Basic Guidelines

  • Line breaks, indentation, and trailing spaces do not matter.
  • Every instruction should be ended with ;.
  • Comments are padded with /.
  • Variable names cannot include spaces or use the following characters: =, l, <, >
  • Variable names also cannot be 0 or 1

Commands

Set a variable

Variables are bits.

q is the name of the variable.

q=;

Variable q is set to w NAND e. This is the only logic you can use.

q=w,e;

You can also use direct values.

q=w,0;

Toggle a variable

q is toggled between 0 and 1.

q;

Output a value

q is outputted to the console. Variable outputs are inline.

>q;

An output symbol with no variable is a newline.

>;

Two output symbols is an ASCII/UTF-8 output.

>>q,w,e,r,t,y,u,i,o,p;

Input a value

Inputs can only pull from the spacebar.

k is set to whether the spacebar is actively being pressed or not.

<k;

An input symbol with no variable pauses the program until the spacebar is pressed.

<;

Computational Class

Enn can be defined as a Bounded Storage Machine (BSM).

Proof

To categorize Enn as a Bounded Storage Machine, we must show that its computational power and memory constraints align with the formal definition of a BSM: a system with a finite, fixed number of bits and a transition function that maps current states to future states.

Memory Constraints

An Enn program's memory is defined by the variable defined in its source code. Because variables cannot be dynamically created and/or removed during runtime, the total amount of bits (n) the memory has is determined at the program's creation.

Transition Function

Enn directly implements the NAND operation, and the toggle command is effectively a NOT operation. Because programs loop by default, variables can act as latches, allowing the program to maintain a "state" over time.

Functional Completeness

Enn uses the NAND gate as its primary function. In digital logic, NAND is universal, meaning it can be used to reconstruct any other logic. Any boolean function can be constructed using only NAND gates, making Enn capable of representing any digital asynchronous circuit that fits in n bits.

Comparison to Turing Machines

Enn's memory is bounded, placing it in the same complexity class as a Finite State Automaton (FSA). Turing Machines require infinite memory (tape), which Enn is incapable of producing.

Examples

Hello World

/ Hello World /
/ Made by las-r on GitHub /

>>0,1,0,0,1,0,0,0; / H /
>>0,1,1,0,0,1,0,1; / e /
>>0,1,1,0,1,1,0,0; / l /
>>0,1,1,0,1,1,0,0; / l /
>>0,1,1,0,1,1,1,1; / o /
>>0,0,1,0,0,0,0,0; /   /
>>0,1,0,1,0,1,1,1; / W /
>>0,1,1,0,1,1,1,1; / o /
>>0,1,1,1,0,0,1,0; / r /
>>0,1,1,0,1,1,0,0; / l /
>>0,1,1,0,0,1,0,0; / d /
>;

Hello World (minified)

>>0,1,0,0,1,0,0,0;>>0,1,1,0,0,1,0,1;>>0,1,1,0,1,1,0,0;>>0,1,1,0,1,1,0,0;>>0,1,1,0,1,1,1,1;>>0,0,1,0,0,0,0,0;>>0,1,0,1,0,1,1,1;>>0,1,1,0,1,1,1,1;>>0,1,1,1,0,0,1,0;>>0,1,1,0,1,1,0,0;>>0,1,1,0,0,1,0,0;>;

XKCD Random Number

>>0,0,1,1,0,1,0,0;