esolang

Pointing

What if pointers were the main show? Every variable is one, and an assignment always writes to an address.

Calculus is fun, 2025 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 10 known programs · Test method

Run it

Expected: -1,1,3

The idea

Calculus is fun made Pointing in 2025, from an idea that came while learning C++ in 2023. Memory is a line of integers of any size. Address 0 is the read only zero, ROZ, which plays the null pointer, and writing there does nothing. Variables live below it, at -1, -2 and on, and each one holds a pointer.

Read the story

So acc is a pointer, @acc is where that pointer is kept, and $acc is the number it points at. An assignment a = b writes b at the address that a gives. A variable changes only that way, so moving a pointer means writing to its own address, @p = + p 1.

Expressions are in Polish notation, +*5,3,2 for 5 times 3 plus 2, so they need no brackets.

The machine

FormDoes
foo @foo $xA pointer, its address, the memory at x
+ - * / % _Arithmetic and negation
== < > <= >=Comparisons, true is -1
¬ ∧ ∨ ⊻ ~ & \| ^Boolean and bitwise, the binary ones skip what they need not read
? c a ba if c is true, else b
@foo = eMake or move a pointer
a = bWrite b at address a
if (c) {} else while (c) {}Control, with break and continue
function f(x) {}A function, with return

Built in are allocate, free, fread, inputInt, inputStr, outputInt and outputChar. A call puts each argument in a new cell and gives the function a pointer to it, so $x is the argument. [text] is a comment.

Example

The lesson in the three faces of a variable.

The lesson in the three faces of a variable. @acc is -1 because acc is the first variable, acc is 1 because that is where allocate found room, and $acc is the 3 written there.

The short circuit example. The three lines are the same logic, but ∨ and ∧ skip their second part when the first decides it, and each call prints its letter.

Expected: A BA CBA

The specification also has a cat, a linked list, an RPN calculator and a brainfuck interpreter that keeps its tape as a linked list.

Patterns it teaches

Further

Also in Hostile

Write your own in Run Convert a program from Pointing

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: pointing.

Command line

shib run pointing -e '@acc=allocate(1)
acc=3
outputInt(@acc) [-1 (it is the first variable)]
outputChar(44) [,]
outputInt(acc) [1 (where allocate found enough empty space)]
outputChar(44) [,]
outputInt($acc) [3 (from line 2)]'
shib manual pointing

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/pointing.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org