Glossa Mechani

A programming language by cptclvtch. Code and data share one memory, so a program can rewrite itself while it runs. The chalk logo above is his.

Run it

This is his interpreter, carried over from C to run in your browser. Pick a program, then step through it one instruction at a time. The outlined cell is the head, the thing that reads and runs the code. Cells the last instruction changed light up.

Write instruction names, argument types and numbers, separated by commas. A line with only --- starts a new array. For direct addressing, write the array number in place of the type. Press Load after editing.

instruction argument head just written

How it works

Everything lives in one memory: a list of arrays, each holding whole numbers. Instructions and data are stored side by side, with nothing to tell them apart except where the head happens to be.

The head starts at array 0, index 0. If it lands on a valid instruction, the instruction runs and the head moves past it. If not, it records an error and moves forward one cell. At the end of an array it rolls into the next one. When memory gets moved around, the head moves with the code it was sitting in, so a program keeps its place even while rearranging itself.

Each argument is a pair: a type, then a value. The type says how to read the value.

IMMEDIATEUse the value right there. Writing to it changes the instruction itself.
CURRENT_ARRAYThe value is an index in the array the head is in.
POSITIVE_RELATIVECount that many cells forward from the instruction.
NEGATIVE_RELATIVECount that many cells back from the instruction.
an array numberDirect addressing: that array, at the index given as the value.

Errors don’t stop the program. Their type, array and index get written wherever SET_ERROR_TRAP last pointed, and the program can check them. He named the instruction that ends a program DECAPITATE.

Instruction set

Descriptions are from his own documentation, which his build script generated straight from the source code.

About cptclvtch

He wrote C from the ground up and preferred building his own tools to installing other people’s. His build scripts were C programs too, run with a small compiler he kept inside each project. In this language, each instruction lives in one file that is at once the working code, its tests and its documentation.

He worked on these projects from 2023 until December 2025, coming back again and again to one idea: a visual, node-based way to build and think through things. Glossa Mechani was designed with that in mind, as a language meant to be edited as a graph.