We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Minez

From Esolang
Jump to navigation Jump to search

Minez is an esoteric programming language designed by Dooblix in 2024. It is a stack-based and register-based language with indexed memory and explicit pointer control. The language is inspired by Urban Müller's Brainfuck and extends the minimalistic model with a stack, structured conditionals, and improved control flow. The name is pronounced /ˈmi.nɛs/ and derives from the words minimal and ez (easy), reflecting its goal of being a more accessible and expressive alternative to Brainfuck while retaining a minimalist character. The creator proved Minez' Turing-completeness by implementing a fully functioning Brainfuck interpreter in Minez.

Minez is executed by a virtual machine implemented in C, which defines a deterministic execution model with explicit memory, stack, and pointer semantics. Pre-compiled binaries for Windows and Linux are provided on the GitHub repository.(dead link) Minez v1.0.0 was released to the public on the 8th of June 2026.

Overview

Minez operates on a configurable-size array of signed integer registers and a movable pointer. Programs manipulate memory through arithmetic, stack operations, indexed jumps, and structured control flow constructs.

The language includes multiple execution structures such as loops, conditionals, and computed jumps, allowing it to express both low-level and structured algorithmic behavior. A Python helper script (minez_helper.py) is included in the repository to assist with generating repetitive code such as string printing or list initialization.

Unlike Brainfuck, Minez introduces:

  • A LIFO-stack
  • Better control flow with in-loop continue (~) and jumps
  • Indexed pointer memory for indirect jumps
  • 32-bit signed integer arithmetic on registers
  • Structured conditionals with comparison operators
  • A runtime measurement system accessible from within programs
  • Debugging and runtime introspection features

Execution model

A Minez program is executed by a virtual machine with the following core components:

  • A configurable-size register array of signed integers (default: 100)
  • A pointer referencing the current register
  • A data stack for temporary values
  • A loop stack for control flow
  • An index memory structure for indirect pointer jumps

Before execution, // comments are stripped from the source. A ; terminator is appended automatically if not already present. Execution proceeds sequentially via a zero-based program counter, unless modified by control flow instructions. Termination occurs when the ; instruction is executed or when a fatal runtime error occurs.

Memory model

The VM maintains:

  • A configurable-size array of signed integers (int), initialized to zero. The default size is 100 and can be changed via the --num-of-regs flag at runtime.
  • A pointer (ptr) of type size_t, bounded within 0 ≤ ptr < num_of_regs. Violations cause immediate termination with an IndexError.
  • A LIFO data stack of signed integers
  • A loop stack of program counter positions, used for loop control
  • An index memory list of pointer values for indirect jumps

Integer overflow follows the behavior of the host C implementation (typically two's complement wraparound).

Instruction set

Minez defines a compact instruction set. Instructions include:

  • Pointer manipulation (>, <)
  • Arithmetic operations (+, -, x)
  • Stack operations (@, _)
  • Runtime operations (@R, +R, -R)
  • Control flow ([, ], ~, ^, ^s, {}())
  • Input/output (#, #!, ., :)
  • Index memory (|, ->, ->(y), X)
  • Debugging (d)
  • Program termination (;)

Any character not recognized as part of a valid command causes an immediate SyntaxError. Whitespace and // comments are silently removed before execution.

Syntax reference

Note: This is a simplified summary. Refer to spec.md in the GitHub repository for the full specification.

Pointer manipulation

Command Description
>y Move pointer to absolute index y.
> Increment pointer by 1.
< Decrement pointer by 1.

Flow control

Command Description
^y Jump to program index y, pushing the address of the next instruction onto the data stack.
^s Pop from the data stack and jump to that address (return).
[ Begin loop. If current register = 0, skip to matching ]. Otherwise push current PC onto loop stack.
~ Continue: skip to next loop iteration. Causes SyntaxError outside a loop.
] End loop. If current register ≠ 0, jump back to loop start. Otherwise pop loop stack. Causes SyntaxError if loop stack is empty.
{a op b}(...) Conditional block. a and b are register indices or i (current register). op is =, <, or >. If the condition is false, execution skips to matching ).
; Terminate the program.

Stack operations

Command Description
@ Push value of current register onto the data stack.
@R Push current runtime (in ms) onto the data stack.
_ Pop from the data stack and add the value to the current register. Causes StackError if stack is empty.

Note: The pop operator _ is additive rather than replacing the register. This design allows arithmetic to be expressed more concisely. For example, the pattern <@>_ adds the value of the left register to the current one, replacing what would otherwise require a loop.

Register arithmetic

Command Description
+y Increment current register by y.
+R Add current runtime (in ms) to the current register.
+ Increment current register by 1.
-y Decrement current register by y.
-R Subtract current runtime (in ms) from the current register.
- Decrement current register by 1.
x Reset current register to 0.

Input/output

Command Description
# Output ASCII character of current register. Valid range: 0–255. Otherwise ValueError.
#! Output numeric value of current register.
. Read a single character and store its ASCII value in the current register.
: Read a signed integer (any size, including negatives) into the current register.

Index memory

Command Description
| Push current pointer value onto index memory.
-> Set pointer to last saved index memory value. Causes StackError if index memory is empty.
->(y) Set pointer to the y-th saved index. Causes IndexError if out of range.
X Pop last value from index memory. Causes StackError if empty.

Runtime operations

The runtime instructions (@R, +R, -R) expose the elapsed execution time in milliseconds to programs. This was designed to allow performance measurement from within Minez itself. This feature was used notably in the Brainfuck interpreter to report execution time.

Debugging

Command Description
d Print current memory, pointer, stack, index memory, and loop stack. Suppressed in --quiet mode.

Error model

All errors in Minez are fatal — execution halts immediately with no recovery. The error categories are:

Error Typical cause
IndexError Pointer out of bounds, invalid ->(y) index, or ^y jump past program end.
StackError Pop from empty data stack, empty index memory access.
SyntaxError Unknown command, ~ or ] outside loop, invalid conditional operator, negative index in ->(y).
ValueError ASCII output of value outside 0–255.
InputError Invalid input.

Each error reports the instruction index, the offending command, relevant parameters, and a human-readable hint.

CLI usage

The Minez interpreter is invoked from the command line:

minez <path-to-program> [options]

Options include:

  • --num-of-regs N — Number of registers (default: 100).
  • --print-until N — Number of memory cells to display after execution.
  • --print-intervals A B ... — Display memory in specified index intervals.
  • --pre-input "" — Supply input values before execution (e.g. "234\n-34\n").
  • --no-pause — Do not wait for keypress after program ends.
  • --quiet / -q — Suppress all metadata and d output.

Example programs

Hello World

Traditionally, the first program written in a new programming language displays "Hello World!". Dooblix wrote this program before a working interpreter existed.

// "Hello World!"-program in Minez
// needs at least 1 memory cell
+72#+29#+7##+3#-79#+55#+24#+3#-6#-8#-67#;

It works by arithmetically manipulating the integer in register 0 to the ASCII value of each character in sequence and printing it.

Calculator (early version)

This program dates from the earliest version of Minez and uses only the features available at the time: conditionals, integer I/O and the terminator. It features two operations (+ and -) as well as a fallback error message if an unsupported operator has been provided. The program still works on the current interpreter.

// This program is a calculator made in the early versions of Minez. It has no input prompts. 
// Expects: Num1, op (+/-), Num2
// Needs at least 5 memory cells
+43>1+45>2:>3.>4:{3=0}(>0[>4+1>2-1]>4#!;){3=1}(>0[>2-1>4-1]>2#!;)>5+85#+25#-7#+149#-144#+8#-11#-2#;

Fibonacci

// Fibonacci numbers in Minez
// needs at least 49 memory cells
+32>+44 // can't go higher due to 32-Bit limit
>+1#!>0#>>>+1#!>|>0#>1
[->X<@>_<<@>>_#!>|>0#>1-];

Brainfuck interpreter

To prove Minez' Turing-completeness, Dooblix implemented a complete Brainfuck interpreter in Minez. The program takes as input the number of Brainfuck memory registers to allocate, then reads a Brainfuck program terminated by a newline, and executes it.

// Brainfuck Interpreter written in Minez
// needs at least ~20 memory cells (ideally: 15+num_of_regs+bf_program_length)
// Memory usage:
//     0: zero comparison
//     1: printing host
//     2: bf program counter
//     3: bf memory pointer
//     4 - 11: bf chars comparison
//     12: 255 constant comparison
//     13: bf program length
//     14: num_of_regs, later: runtime
//     14+num_of_regs: start of brainfuck program
// Index memory usage:
//     0: start of program string


// Initialize brainfuck chars
>4+43>+44>+45>+46>+60>+62>+91>+93>+255
// Take num_of_regs input
>1+69#+41#+6#-15#+13#-82#+68#+1#+14#-10#+9#-13#-1#-68#+78#+7#-8#-11#+3#+13#-82#+79#-9#-70#+82#-13#+2#+2#+10#+1#-15#+13#+1#-83#+8#+77#-12#+5#+6#-75#+17#-26#
>14:
// Make sure at least 1 register is allocated
{14=0}(
    >14+
)
{14<0}(
    >14x+
)

// Allocate memory
@|[->X>|>14-]_->X>|

// Brainfuck program input loop
>1x+69#+41#+6#-15#+13#-82#+34#+48#-17#+8#+5#-8#+15#-18#+8#-75#+80#+2#-3#-8#+11#-17#+12#-51#-26#
>0+10 // NOTE: Change to +13 on Windows!
->>.>|<[->X.>|<{i=0}(>0x~)>13+]X>1x+10#
>14x-R
>13+
[
    ->|>2@[->X>|>2-]x_->X> // go to current char
    // Case '+'
    {i=4}(
        >15|>3@[->X>|>3-]x_->X // go to current memory location
        {i=12}(
            x // set to zero if 255 to simulate 8-Bit
            >2+~
        )
        + // otherwise just add one
        >2+~
    )
    // Case ','
    {i=5}(
        >15|>3@[->X>|>3-]x_->X // go to current memory location
        . // take input
        >2+~
    )
    // Case '-'
    {i=6}(
        >15|>3@[->X>|>3-]x_->X // go to current memory location
        {i=0}(
            +255 // set to 255 if zero to simulate 8-Bit
            >2+~
        )
        -1 // otherwise just subtract one
        >2+~
    )
    // Case '.'
    {i=7}(
        >15|>3@[->X>|>3-]x_->X // go to current memory location
        # // print char
        >2+~
    )
    // Case '<'
    {i=8}(
        >3
        {i=0}(
            // Error message (pointer < 0)
            >1x+10#+63#+37#-10#+1#+19#-51#+45##-3#+3#-56#-26#+80#-1#-6#+5#+6#-15#+13#-82#+79#+6#-1#-84#+79#-9#-70#+66#+13#+6#-7#-10#+15#-69#-36#-1#+56#+51#-84#+73#+5#+5#+1#-2#+3#-18#+17#-11#+6#-1#-78#+73#+5#-10#+1#+19#-62#-26#>2#!>1-22#-1#+71#+31#-6#+5#+6#-15#+13#-82#+67#-2#+13##+1#+5#-84#+66#+3#-69#+78#-9#+2#-6#+19#-11#+13#-17#-68#
            ;
        )
        -1
        >2+~
    )
    // Case '>'
    {i=9}(
        >3
        {i=14}(
            // Error message (pointer > num_of_regs)
            >1x+10#+63#+37#-10#+1#+19#-51#+45##-3#+3#-56#-26#+80#-1#-6#+5#+6#-15#+13#-82#+79#+6#-1#-84#+79#-9#-70#+66#+13#+6#-7#-10#+15#-69#-36#-1#+56#+51#-84#+73#+5#+5#+1#-2#+3#-18#+17#-11#+6#-1#-78#+73#+5#-10#+1#+19#-62#-26#>2#!-22#-1#+71#+31#-6#+5#+6#-15#+13#-82#+67#-2#+13##+1#+5#-84#+66#+3#-69#+72#+1#-2#+1#-3#+13#-82#+84#-12#-7#+13#-78#+84#-12#-3#-69#+78#+7#-8#-11#+3#+13#-82#+79#-9#-70#+82#-13#+2#+2#+10#+1#-15#+13#+1#-82#
            ;
        )
        +
        >2+~
    )
    // Case '['
    {i=10}(
        >15|>3@[->X>|>3-]x_->X // go to current memory location
        {i>0}(
            >2@+~ // add current pc to stack and continue
        )
        // if i=0 skip this loop
        >1x+13>0+
        [
            >2+
            ->|>2@[->X>|>2-]x_->X> // go to current char
            {i=10}(
                >0+
            )
            {i=11}(
                >0-
            )
            {i=1}(
                // Error message (missing closing bracket)
                >1x+10#+73#+38#-11#+6#-19#+23#-51#+45##-3#+3#-56#-26#+77#-4#+10##-10#+5#-7#-71#+67#+9#+3#+4#-10#+5#-7#-71#+66#+16#-17#+2#+8#-6#+15#-84#+7#+54#-54#+7#-36#-1#+56#+51#-84#+73#+5#+5#+1#-2#+3#-18#+17#-11#+6#-1#-78#+73#+5#-10#+1#+19#-62#-26#>2x_#!
                ;
            )
            >0
        ]
        >0x
        >2+~
    )
    // Case ']'
    {i=11}(
        >2x_~
    )
    >0+10 // NOTE: Change to +13 on Windows!
    {i=0}(
        x~
    )
    >0x>2+
]
>1x+10#+56#+4#-25#+37#+35#-7#+6#-11#+4#-8#-43#-26#
>14+R#!
>1#+77#+6#
;

The program simulates 8-bit memory semantics (wrapping at 0 and 255), supports all eight Brainfuck commands, detects and reports pointer underflow and overflow with descriptive error messages, and prints the total execution time in milliseconds upon completion using the +R runtime instruction.

More

There are a total of seven official example programs on the Minez GitHub repository(dead link):

  • brainfuck_interpreter.minez
  • bubble_sort.minez
  • calc.minez (a "modern" Minez calculator that supports all four basic arithmetic operations (+, -, *, :))
  • early_calc.minez
  • fibonacci.minez
  • hello_world.minez
  • mlp.minez (a working multilayer perceptron that identifies handwritten digits in MNIST format)

History

The idea for Minez arose in mid-2024 when Dooblix first discovered Brainfuck. Together with a friend, he set out to create a high-level language that would compile down to Brainfuck, with Minez intended as an intermediate representation. The project achieved early results: simple if-statements, integer printing, and small programs could be transpiled successfully. The project was ultimately terminated due to limited experience and the complexity of the task.

After the compiler project was abandoned, Dooblix decided to make Minez its own standalone language: a more expressive and accessible alternative to Brainfuck. The first interpreter was written in Python. Development was then paused for roughly a year. In late 2025, Dooblix revisited the project and found the original Python interpreter to be unreliable and too slow for non-trivial programs. A second Python implementation was written but also deemed unsatisfactory in terms of performance. The final interpreter was implemented in C and Minez v1.0.0 was published on GitHub on the 8th of June 2026.

The loss of an SSD during the early development period destroyed most programs written for the first version of Minez. Only two are known to have survived: the Hello World program and the early calculator shown above.

The most complex known Minez program is mlp.minez, a multilayer perceptron implementation that spans nearly 100,000 characters.

External links