We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
HLAAPL
HLAAPL, which stands for Human Language as a Programming Language, is an esolang that tries to simulate natural language syntax. Any natural language can be used; this article will primarily be using Esperanto. To add a bit of esotericness, you should try to write your programs in a language that you don't know.
Input and Output
To make the program output something, you conjugate the word for "to write" in the singular imperative and put the thing you want to output as the object. In quotes if a string, not if a variable or number.
Skribu "Saluton, la mondo!".
This program outputs a string.
Skribu dudek du.
This program outputs the number 22. You can also ouput 2 things at the same time.
Skribu ok kaj "skribu".
To collect input, the word for "to ask for" is conjugated in the singular imperative. and then the word for "number" or "phrase" is put as the object. To assign it to a variable, you write "The answer is (variable name)." where the variable is a definite noun phrase.
Demandu nombron. La respondo estas la nombro. Skribu la nombron.
This outputs the number that's inputed.
Variables
Variables are definite noun phrases. To assign a value to a variable, you use the word for "to be" and the value that you want to set the variable to. It can be a number or a string. Mathematical operations are what they are in the language.
La unua nombro estas du. La dua nombro estas okcent kvindek kvin. Skribu la unuan nombron kaj la dunan nombron.
Loops
To make a loop that repeats until a certain condition is met, you use "to repeat" in the imperative, followed by "until" with the object of the preposition being the condition. Then, you put the lines to repeat indented. Conditions can be "is" or "is less/greater than" and can be negated normally.
La nombro estas ok.
Ripetu ĝis la nombro estas unu:
Skribu la nombron.
La nombro estas la nombro minus unu.
This program would print the numbers from 8-2.
If Statements
To make an if statement, you use the word "if". For "else", "if no" is used.
La nombro estas du.
Se la nombro estas du,
Skribu "yay".
Se ne,
Skribu "sad".
This programs outputs "yay" is the number is two, and "sad" is the number isn't two.
Goto
To create a goto label, you write "This instruction is (adjective)." The adjective is the name of the label. To jump to the label, you write, "Go to the (adjective) instruction."
Tiu ĉi instrukciono estas bona. Iru al la bona instrukciono.
This causes an infinite loop.
Functions
You can make custom functions. To do that, you pick a verb (in its dictionary form) and put "is" after it. You can put parameters such as "phrase" (as a string), "number" (as a number), "verb" (as a verb) and "type" (as an adjective). Each noun parameter must be indefinite, and have an ordinal number. These act as variables in the code of the function.
Grandi unuan nombron je dua nombro estas:
La unua nombro estas la unua nombro plus la dua nombro.
This function adds two numbers together. It could be used as such:
La granda nombro estas ok. Grandu la grandan nombron je okdek. Skribu la grandan nombron.
This would print 88.
Example Programs
Adder
English
Ask for a number. The answer is the first number. Ask for a number. The answer is the second number. Write the first number plus the second number.
French
Demande un nombre. La réponse est le premier nombre. Demande un nombre. La réponse est le second nombre. Écris le premier nombre plus le second nombre.
Esperanto
Demandu numeron. La respondo estas la unua numero. Demandu numberon. Le respondo estas la dua numero. Skribu la unuan numberon plus la duan numeron.
Chinese
要数。 回答是第一数。 要数。 回答是第二数。 寫第一数加第二数。
(I tried my best; I don't know Chinese.)
Toki Pona
o pali pana e nanpa. toki ni li nanpa pi nanpa wan. o pali pana e nanpa. toki ni li nanpa pi nanpa tu. o sitelen e nanpa pi nanpa wan en nanpa pi nanpa tu.
Czech
Požádej o číslo. Odpověď je to první číslo. Požádej o číslo. Odpověď je to druhé číslo. Piš to první číslo plus to druhé číslo.
Russian
Проси о числе. Ответ первые число. Проси о числе. Ответ вторые число. Пиши первое число плус второе число.
99 Bottles of Beer
English
The beer is ninety-nine.
Repeat until the beer is two:
Write the beer and " bottles of beer on the wall."
Write the beer and " bottles of beer."
Write "Take one down, pass it around."
The beer is the beer minus one.
Write the beer and " bottles of beer on the wall."
Write "2 bottles of beer on the wall."
Write "2 bottles of beer."
Write "Take one down, pass it around."
Write "1 bottle of beer on the wall."
Write "1 bottle of beer on the wall."
Write "1 bottle of beer."
Write "Take one down, pass it around."
Write "No more bottles of beer on the wall."
French
La bière est quatre-vingt-dix-neuf.
Répète jusqu'à ce que la bière soit deux:
Écris la bière et " bottles of beer on the wall."
Écris la bière et " bottles of beer."
Écris "Take one down, pass it around."
La bière est la bière moins un.
Écris la bière et " bottles of beer on the wall."
Écris "2 bottles of beer on the wall."
Écris "2 bottles of beer."
Écris "Take one down, pass it around."
Écris "1 bottle of beer on the wall."
Écris "1 bottle of beer on the wall."
Écris "1 bottle of beer."
Écris "Take one down, pass it around."
Écris "No more bottles of beer on the wall."
Esperanto
La biero estas naŭdek naŭ.
Ripetu ĝis la biero estas du:
Skribu la bieron kaj " bottles of beer on the wall."
Skribu la bieron kaj " bottles of beer."
Skribu "One fell down, pass it around."
La biero estas la biero minus unu.
Skribu la bieron kaj " bottles of beer on the wall."
Skribu "2 bottles of beer on the wall."
Skribu "2 bottles of beer."
Skribu "Take one down, pass it around."
Skribu "1 bottle of beer on the wall."
Skribu "1 bottle of beer on the wall."
Skribu "1 bottle of beer."
Skribu "Take one down, pass it around."
Skribu "No more bottles of beer on the wall."
Chinese
啤酒是九十九。
重複直到啤酒是二:
寫啤酒和" bottles of beer on the wall."
寫啤酒和" bottles of beer."
寫啤"Take one down, pass it around."
啤酒是啤酒減一。
寫啤酒和" bottles of beer on the wall."
寫"2 bottles of beer on the wall."
寫"2 bottles of beer."
寫"Take one down, pass it around."
寫"1 bottle of beer on the wall."
寫"1 bottle of beer on the wall."
寫"1 bottle of beer."
寫"Take one down, pass it around."
寫"No more bottles of beer on the wall."
Toki Pona
telo nasa li mute mute mute mute luka luka luka tu tu.
o pali tawa ni: telo nasa li tu:
o toki e telo nasa e " bottles of beer on the wall."
o toki e telo nasa e " bottles of beer."
o toki e "Take one down, pass it around."
telo nasa li telo nasa en wan ike.
o toki e telo nasa e " bottles of beer on the wall."
o toki e "2 bottles of beer on the wall."
o toki e "2 bottles of beer."
o toki e "Take one down, pass it around."
o toki e "1 bottle of beer on the wall."
o toki e "1 bottle of beer on the wall."
o toki e "1 bottle of beer."
o toki e "Take one down, pass it around."
o toki e "No more bottles of beer on the wall."
Truth-Machine
English
Ask for a number.
The answer is the number.
If the number is zero,
Write zero.
If no,
Repeat until one is two:
Write the number.
French
Demande un nombre.
La réponse est le nombre.
Si le nombre est zéro,
Écris zéro.
Si non,
Répète jusqu'à ce qu'un soit deux.
Écris le nombre.
Esperanto
Demandu nombron.
La respondo estas la nombron.
Se la nombro estas nul,
Skribu nul.
Se ne,
Ripetu ĝis unu estas du.
Skribu la nombron.
Chinese
要数。
回答是数。
如果数是零,
寫零。
如果不,
重複直到一是二:
寫数。
Toki Pona
o pali pana e nanpa.
toki ni li nanpa.
nanpa li ala la,
o toki e ala.
ala la,
o pali tawa ni: wan li tu:
o toki e nanpa.
Four Function Calculator
English
Add a first number to a second number is:
The first number is the first number plus the second number.
Subtract a first number from a second number is:
The second number is the second number minus the first number.
Multiply a first number by a second number is:
The first number is the first number times the second number.
Divide a first number by a second number is:
The first number is the first number divided by the second number.
The continuation is "Y".
Repeat until the continuation is "N":
Ask for a number.
The answer is the first number.
Write "Type +, -, * or /."
Ask for a phrase.
The answer is the operation.
Ask for a number.
The answer is the second number.
If the operation is "+",
Add the first number to the second number.
Write the first number.
Go to the final instruction.
If the operation is "-",
Subtract the second number from the first number.
Write the first number.
Go to the final instruction.
If the operation is "*",
Multiply the first number by the second number.
Write the first number.
Go to the final instruction.
If the operation is "/",
Divide the first number by the second number.
Write the first number.
Go to the final instruction.
This instruction is final.
Write "Again? (Y/N)".
The answer is the continuation.
Chinese
加第一数和第二数是:
第一数是第一数加第二数。
減第一数和第二数是:
第一数是第一数減第二数。
乘第一数和第二数是:
第一数是第一数乘第二数。
除第一数和第二数是:
第一数是第一数除第二数。
续编是"Y"。
重複直到续编是"N":
要数。
回答是第一数。
寫"Type +, -, * or /."
要短語。
回答是算术运算。
要数。
回答是第二数。
如果算术运算是"+",
加第一数和第二数是。
寫第一数。
去最后教导。
如果算术运算是"-",
減第一数和第二数是。
寫第一数。
去最后教导。
如果算术运算是"*",
乘第一数和第二数是。
寫第一数。
去最后教导。
如果算术运算是"/",
除第一数和第二数是。
寫第一数。
去最后教导。
这教导是最后。
寫"Again? (Y/N)"。
回答是续编。