TCC
A database with four commands, where printing a column is the only way to say anything.
A · Turing complete: no · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
The user A made TCC, Table Changing Code, after SQL. A program makes tables, adds rows to them, deletes rows and prints columns, in commands that read like queries. There is no input, no arithmetic and no loop, so every program stops. To print a sentence you store its letters in a table first.
The machine
| Command | Does |
|---|---|
CREATE t | Make an empty table |
INSERT t VALUES (1, "a", ...) | Add a row of integers and strings |
DELETE t WHERE n | Remove row n |
IN t CHOOSE n | Print column n |
A column prints as its values run together, with nothing between them and no line feed. A row with fewer values than the column number adds nothing. The commands are not case-sensitive. Rows and columns count from 1.
Example
The Hello World keeps one letter in each row of one column.
The Hello World keeps one letter in each row of one column.
Its second version puts Hello, in the first column and World! in the second. The last row holds only the space, so the second column skips it.
Deleting the second row of three leaves 10 and 30 in the first column.
Patterns it teaches
- Camouflage: a program that reads like database queries.
Further
See also
Also in Camouflage
Write your own in Run Convert a program from TCC
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: tcc.
Command line
shib run tcc program.txtThe program is long; save it as program.txt first.
shib manual tccSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/tcc.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org