| COTTON(1) | General Commands Manual | COTTON(1) |
NAME
cotton — a tiny
stack machine for the cot programming language
SYNOPSIS
cotton |
file.cot |
DESCRIPTION
cotton is a small stack machine for the cot(5) programming language (inspired by Lua, Forth and Uxntal) written in C99
cotton's internals consist of 7 files (as of cotton 0.1) which are:
src/
- main.c
- Reads each .cot file from head to toe and then hands each read line to the loom, then, it returns the results
cotton.c- Handles the core operations of cotton: initializing the state, and, pushing and popping the stack
cotton.h- Has the Cotton struct, contains the cog types, opcode definitions and the specs for Cotton
cogs.c- Has the builtin and runtime keycogs
cogs.h- Declares the keycogs so they can be used elsewhere inside of Cotton
interpreter.c- For the compiler and the runtime for Cotton
interpreter.h- Where cotton_compile and cotton_run are declared to be used in loom.c
as of now it only compiles cot programs, but, i do intend to add the option to compile cot programs to uxntal in the future (IF i ever figure that out and IF i still have that goal by then) :P
SEE ALSO
| September 2026 | cotton 0.1 |