HGFTSNOA
Eight keywords, every one of them a row of capital T. Every name is a row of small t.
PythonshellDebugwindow, 2020 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 14 known programs · Test method
Run it
The idea
PythonshellDebugwindow made HGFTSNOA in 2020. A program may use 16 characters, which are T, t, the ten digits, the double quote, the minus sign, space and line feed. Keywords are runs of one to eight capital T. Functions and variables are runs of small t. Each keyword also has a "wimpmode" word, HELLO, GOODBYE, IF, IT, IS, THEN, OR and AND, and the language is named after a letter of each.
Read the story
There is no print command. Every value a statement leaves unused is printed, with a line feed. To print a letter other than T, a program writes keywords in a string and puts a minus in front, which turns them into their wimpmode words. That gives 14 capital letters. W, U and Z are not among them, so the Hello World prints HELLO GLOBE and its FizzBuzz prints FISSBOSS.
The machine
| Keyword | Wimpmode | Does |
|---|---|---|
T | HELLO | Begin a function body |
TT | GOODBYE | End it |
TTT | IF | Begin an if |
TTTTTTT | OR | Begin its else |
TTTTTT | THEN | End the if |
TTTT | IT | Return, or index a string |
TTTTT | IS | Declare a function, assign, or test equality |
TTTTTTTT | AND | Add integers or join strings |
A function is declared as t TTTTT tt ttt T ... TT, its parameters before the T, and the nameless T ... TT is main. Calls are prefix, t 1 2, and take as many expressions as the function has parameters. The operators all have one precedence and go left to right, so a call's last argument takes everything after it. TTTT is a return only right after T, TTTTTTT or TTTTTT, and anywhere else it indexes. That is why the programs put an empty if, TTT 0 TTTTTT, before a return that follows other statements. Integers have no bound, and variables belong to one call.
Example
-"TT" is GOODBYE, and TTTT 0 takes its G.
-"TT" is GOODBYE, and TTTT 0 takes its G. The other letters come out of HELLO and OR the same way.
Expansion also puts in the values of variables, left to right, the longest name first. With tttt set to 42, seven t read as tttt and then three t, which name nothing yet. Once t is 5, those three become 555.
The Fibonacci counts with a recursive function of four parameters and prints one number a call.
The specification also has a truth machine, the Ackermann function, a digital root, 30 factorial by repeated addition and the 99 bottles of beer. The song goes LIFT ONE OFF - TRANSFER IT, because TAKE, DOWN, PASS and AROUND need a K, W, P or U.
Patterns it teaches
- Hostile design: a whole language in two letters.
- Encoding tricks: letters are cut out of keyword names.
Further
See also
Also in Hostile
Write your own in Run Convert a program from HGFTSNOA
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: hgftsnoa.
Command line
shib run hgftsnoa -e 'T
"0123456789" TTTT 7
"12345" TTTT -2
TT'shib manual hgftsnoaSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/hgftsnoa.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org