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

From Esolang
Jump to navigation Jump to search

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.

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.

To collect input, the word for "to ask for" is conjugated in the singular imperitive. 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.

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 toki pana e nanpa.
toki ni li n