m15o.net projects journal about

nspace is a programming-language for a 2-dimensional register-machine. A dimension has a cursor and an array of registers. The cursor holds the selected register. Registers hold positive integers. These instructions operate on dim 1:

n  next
s  subtract
p  previous
a  add
c  copy
e  exec
{  if 0 jump out else carry on
}  if not 0 jump back else carry on

The following instructions aren't dependent on a dimension:

|  unconditionally jump out
:  set proc
;  return

Each instruction (or group of instructions enclosed in parentheses) takes a prefix that specifies how many times the instruction(s) should be repeated. That prefix is either a number that defaults to 1, or one of these flags:

v  repeat [cursor] times
k  repeat cursor times

Dim 2 uses the uppercase version of dim 1 instructions (with []) and flags. A standard nspace machine has 16 registers on its first dimension, 256 on the second, and a return stack with a size of 16. The stack is used to keep track of the position of the next instruction after a executing a proc, and to maintain a counter when looping over a group of instructions.

Reference implementation

refs: projects, the-little-spacer