esolang

How to learn this language

Three letters. o says the next character, i takes a word, q starts again.

Turing complete: no · ●○○ easy · esolangs.org

Tested with 4 known programs · Test method

Run it

Expected: Hell0, w0rld!

The idea

The joke is in the name. Its full name never ends, because "this language" can always be replaced by the name itself, giving How to learn "How to learn this language" and so on. The longest example prints that name in capitals, over and over, forever.

The machine

CodeDoes
o + characterPrint that character, unless it is i, o or q
oiRead a word and print it with a newline
iRead a word and forget it
qStart the program over

Everything else does nothing. Only the first line is code, as in the C++ interpreter. Words are read as C++ reads them, up to the next space or newline. The printed character is still run afterwards, so ooH prints H and oq prints nothing and then loops.

Example

The second program is the specification's interpreter for the language 6.
Expected: 6
Expected: meow

The second program is the specification's interpreter for the language 6. It reads a program and ignores it, then prints 6.

Further

Ideas it shows

Also in Jokes

Write your own in Run Convert a program from How to learn this language

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: how-to-learn-this-language.

Command line

shib run how-to-learn-this-language -e 'oi' --input 'meow'
shib manual how-to-learn-this-language

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/how-to-learn-this-language.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org