Zeno (Archived)

From Esolang
Jump to navigation Jump to search
Zeno
Paradigm(s) Imperative
Designed by Rdococ
Appeared in 2017
Computational class Uncomputable
Reference implementation Unimplemented
File extension(s) .zeno

Zeno is an esoteric programming language. It is designed for hypercomputation on a hypothetical machine which enables infinite, rather than merely unbounded, memory, and the ability to complete infinitely long tasks in finite time.

This means that it is not absolutely powerful by any means - due to Gödel's counting theorem, Zeno programs still cannot calculate with arbitrary real numbers, or anything else that requires uncountably infinite space or time. Still, it is infinitely more powerful than anything that could possibly exist in our universe.

Overview

Zeno is designed to run on machines that could not possibly exist in the real world, and as a result, is going to differ quite a bit from your typical C-like.

The Machine

Zeno is designed for a memory structure with hyperreal size, and support for both finite and infinite memory alignments. Zeno machines normally run at finite, but super fast speeds, but may cause a Zeno paradox where the clock speed doubles at every iteration of a loop, and an infinite number of iterations is compressed into finite time. This takes a toll on the computer, and so it must be used sparingly.

Memory

  • Finite subwords, which have a width of 64 bits.
  • Infinite words with ω bits, equivalent to ω/64 subwords.
  • An infinite memory structure with the space of 2ω infinite words, or 2ωω bits.
  • Dedicated hardware to manipulate infinite words within a finite timespan without a Zeno paradox.

Performance

  • Finite clock speed by default.
  • The ability to cause a Zeno paradox that can run ω iterations of a repeated calculation for the time it would normally take to run 2, but damages the computer if used too often.

Data types

Zeno's primitive value types are:

  • void: Placeholder for a procedure that returns nothing.
  • int: A finite, 64-bit integer for finite data.
  • float: A finite float.
  • hyint: A hyperinteger from -2ω / 2 to 2ω / 2 - 1. Does not support infinitesimals, as they are non-integers by definition.
  • hyfloat: A hyperfloating point number. Infinitely more precise than anything we could do in the real world, but not as precise as real numbers. Supports infinitesimals.
  • char: Any character within the entirety of the Unicode Infinity codeset, which contains symbols that are infinitely similar to any symbol you could possibly think of.

Zeno supports pointers and "arrays", much like C does, and does not provide any safeguards to support memory safety. Nevertheless, Zeno is still entirely memory-safe if you're only dealing with a finite number of things - no finite array will ever reach the critical operating system info located infinitely far away, and no finite amount of garbage will ever cause an OOM error.

Control flow

Zeno supports the following control flow constructs.

  • if
  • while: Does not support infinite iterations by default.
  • for: Ditto.
  • break: Breaks out of a loop.
  • continue: Continues to the next iteration of a loop.
  • goto
  • forever: A surreal FOREVER loop which causes a Zeno paradox. The total number of iterations is equal to ω, while the total run time is equivalent to that of only 2 iterations.

Syntax

Zeno's syntax is reminiscent of, but not compatible with C. TODO: Design a simple, consistent syntax to retain the feel of a systems language from the hypothetical "world of hypernumbers".

Examples

This program proves the Goldbach conjecture by brute force, given suitable implementations of pow() and prime(). There are three variables, and each is iterated up to a maximum value of ω1/3 to ensure that the whole loop only runs for ω iterations.

void main() {
    hyint i = 4;
    
    hyint j = 2;
    hyint k = 2;
    
    hyint crinf = pow(ω, 1/3);
    
    forever {
        if (!prime(j) && j < crinf) {
            j++;
            continue
        }
        
        if (j >= crinf) {
            if (!prime(k) && k < crinf) {
                k++;
                continue
            }
            
            j = 2;
            
            if (k >= crinf) {
                printf("no, %d", i);
                return
            } else {
                if (j + k == i) {
                    j = 2;
                    k = 2;
                    i++++;
                    
                    if (i >= crinf) {
                        print("yes");
                        return
                    }
                }
            }
        }
    }
}

The following program attempts to find the largest finite number. TODO: Find a consistent output for this program.

void main() {
    hyint x = 1;
    
    forever {
        x++;
        if (!finite(x + 1)) {
            break
        }
    }
    
    printf("%d", x);
}

Interpreters

Here's an interpreter I wrote in Lua.

See Also