Treadnil is an esolang by User:BoundedBeans based off the idea of time travel in a world with two dimensions of time.

Basic concepts[edit]

Coordinates are always 1-based unless specified otherwise.

A timeplane is a 32x32 matrix of cells called instants. Technically it can be any size, or have more than two dimensions, but since I already mostly wrote this spec, it will discuss a 32x32 matrix. For more dimensions add the additional coordinates in the same order, for stack operations and similar things. Each instant has a queue of instructions and a stack of more timeplanes. An instant with no instructions and an empty stack is considered empty, and is the default.

Every tick in metatime (time related to the actual execution of a Treadnil program in our world), an instruction in an instant is executed twice, one advancing on X and one advancing on Y. Each instruction is actually a pair of semantics, which has a different meaning depending on X vs. Y time flow. The instruction is removed from the queue. The new versions of the instant after the half instructions are copied to the cells directly after in their directions. Once this happens, the original instant is marked as having already happened, so it won't try again unless it is overwritten. The instant backwards in X and forwards in Y both by 1 cell is also marked as already happened to prevent conflict on the cell they both affect.

The timeplane does not wrap, instants that occur at the X+ edge do not continue on X, likewise for Y, and the instant on the corner does not ever continue.

The program cycles in a loop, doing the previous for all cells that haven't already happened, aren't empty, and aren't at the X+ Y+ corner, reading in X- to X+, Y- to Y+ order. The program terminates when no such cells exist.

This is more complicated since instants can time travel. Certain instructions cause the instant to not propagate on one axis and instead replace some other instant in the timeplane. Notably, the new replacement will no longer be marked as having already happened and will propagate through the further timeline.

Timeplanes as numbers[edit]

A 32x32 timeplane can be interpreted as a number from 0-1023 as the number of non-empty instants in it. Canonical numeric timeplanes as the result of instructions fill the various diagonals from the Y- to X- edge, starting with (1,1), then (2,1) and (1,2), then (3,1), (2,2), and (1,3), and so on, with instants with an empty stack and a single instruction with both halves set to Null. All math is done on 32x32 timeplanes, no other sizes are valid.

Half-Instructions[edit]

These half instructions ignore whitespace in the syntax, except in XML strings.

Syntax[edit]

Programs are specified as the initial state of the top-level timeplane, in XML. The XML namespace URI is https://esolangs.org/wiki/Treadnil.

And since this is XML, it is of course extendable with more attributes and elements.

Examples[edit]

Hello, world[edit]

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Timeplane dims="32,32" xmlns="https://esolangs.org/wiki/Treadnil">
  <Instant coords="1,1" already="false">
    <Instructions>
      <Instruction ins="
        Nums[Repeat[Out],33,100,108,114,111,119,
        32,111,108,108,101,72,12]/Null" />
      <Instruction ins="Extinction/Null" />
    </Instructions>
    <Stack />
  </Instant>
</Timeplane>

Truth-machine[edit]

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
<Timeplane dims="32,32" xmlns="https://esolangs.org/wiki/Treadnil">
  <Instant coords="1,1" already="false">
    <Instructions>
      <Instruction ins="
        Nums[In[IfTimeplaneEqual[Swap[Drop[ExecFull]],
        Drop[ExecFull]]],0]/Null" />
    </Instructions>
    <Stack>
      <Timeplane dims="2,2">
        <Instant coords="1,1" already="false">
          <Instructions>
            <Instruction ins="
              Nums[Out,49]/
              Nums[TimeTravel[GetInstructions],1,1,1,1]" />
          </Instructions>
          <Stack />
        </Instant>
      </Timeplane>
      <Timeplane dims="2,2">
        <Instant coords="1,1" already="false">
          <Instructions>
            <Instruction ins="Nums[Out,48]/Extinction" />
          </Instructions>
        </Instant>
        <Stack />
      </Timeplane>
    </Stack>
  </Instant>
</Timeplane>