Ako's Simple Coding Language

From Esolang
Jump to navigation Jump to search

Ako’s Simple Coding Language (ASCL) is a 3D memory-based esoteric language where execution moves across a grid and each line defines its own behavior. It is designed to be impossible to use without being a professional at everything code.

ASCL is run using a custom IDE using a single file python script. Even after working on it for weeks, I personally cannot find a way to write hello world, and because the quirks of the language, that mystical hello world code is completely different based on line position and what happened before in the code.


Rules

Memory model

  • Memory is a 3D cube of 256 x 256 x 256 bytes.
  • Cells store values from 0 to 255.
  • The interpreter stores memory sparsely, so only nonzero cells use space.

Lines

  • The cube contains exactly 256 fixed lines.
  • Each line has 256 byte positions.
  • The first byte of each line is the selector byte.
  • The first accessible byte is position 1.
  • Moving left from position 1 reaches the selector byte.
  • Moving left from the selector byte does nothing.

Line layout

  • 85 lines run along X.
  • 85 lines run along Y.
  • 86 lines run along Z.
  • The axis assignment is shuffled by a fixed deterministic algorithm so it feels random but never changes.

Active line

  • The selector byte determines the active line.
  • The selector value is passed through a fixed opaque permutation.
  • The resulting line id becomes the active line.
  • If a selector change points to another line, the new line is resolved immediately.

Chain pointer

  • The chain pointer points to a position inside the active line.
  • > moves forward.
  • < moves backward, except that it cannot move left from the selector byte.

Execution

  • Only ASCL command symbols are executed.
  • Everything else is ignored.
  • Programs execute left to right.


Commands

Command table
Symbol Action
+ Increment the current cell by 1. The new value is also written to the successor cell. The chain pointer teleports to the successor.
- Decrement the current cell by 1. The new value is also written to the successor cell. The chain pointer teleports to the successor.
> Move the chain pointer forward in the active line.
< Move the chain pointer backward in the active line. At the selector byte, < does nothing.
= Copy the current cell value into the selector byte. The active line can change immediately.
? Copy the selector byte value into the current cell.
, Read one input byte into the current cell. The value is also written to the successor cell. The chain pointer teleports to the successor.
. Output the current cell as a character using the path-sensitive mapping.
: Output the current cell as a decimal number.
! Bitwise invert the current cell.
~ XOR the current cell with the selector byte.
[ Jump forward to after the matching ] if the selector byte is zero.
] Jump back to the matching [ if the selector byte is nonzero.

Teleport math and character cipher

Successor teleport on +, -, and ,

Given current coordinate (x, y, z), current value v, and path state p:

The current cell is written, then the successor cell is written, then the chain pointer moves to that successor.

Path state update

After movement or writing, the path state is updated as:

Number to letter cipher for .

The byte value is not printed directly. Instead, the runtime builds a permutation of 0..255 using a seed derived from:

Then it shuffles [0..255] with that seed using a deterministic shuffle and outputs:

That is why the same byte can become a different character depending on the route taken through memory.

Debug mode

When debug mode is enabled, the IDE prints plain text about what happened:

  • current instruction
  • program counter
  • line id
  • axis of the line
  • chain pointer index
  • 3D coordinate
  • current cell value
  • selector value
  • successor coordinate
  • loop jumps
  • step limit events
  • parse errors and runtime errors

This is meant to make the language easier to inspect.

example code:

[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.]

(when ran with 20000 steps, produces this "G�Ì8¦*e;†·šüúÛе~ac!r~B@„ec�'¾‰#6l”Y{vAþ�‰óßÁ@:6KÃoïÿ·‰87+c"m†K,H”$?ÖñÒ#‚î;œ6"IsK¥®ô`ÉÔ^Æ£�êæ�¹½ª�²�_Õ/pH™(Œ2�C")

(only at the first line)


also first person to run a number based cat program gets discord nitro for a month, im not even kidding thats how weird this language is. the only rule is you have to do it effenciently and not just ++++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++.> and so on