HQ9 +

from Wikipedia, the free encyclopedia

HQ9 + is a parody of esoteric programming languages that is not itself Turing-complete , as neither conditional statements nor loops are possible. HQ9 + was developed by the later Google employee Cliff L. Biffle, who also created the Turing-complete esoteric programming languages 4DL and Beatnik , in which source texts have to be noted as hypercubes or texts to be evaluated according to the Scrabble rules.

With HQ9 +, Biffle developed a language with which frequently asked tasks in programming courses can be solved in a trivial way. Hello world programs, for example, are used to get to know the basic syntactic elements of a programming language and counting rhymes are used to get to know loops. The development of a quine serves as an indication of the Turing completeness of a language. HQ9 + takes these tasks ad absurdum by not only introducing its own commands, but also limiting the scope of the language to them.

The principle of trivialization is continued in the object-oriented variant HQ9 ++ by David Morgan-Mar, in which objects can be created that, like the counter , cannot fulfill any function. HQ9 + - by Ivan Zaigralin adds a quality control operator to the language , which triggers syntax and various runtime errors and thus tests the behavior of the interpreter or ( trans ) compiler in these cases.

Instruction set

Each character in the name stands for one of the language commands available:

H If the text “ Hello World! " out.
Q Outputs its own source code and mimics the behavior of a quine .
9 Outputs the lyrics of " 99 Bottles of Beer on the Wall ".
+ Increases the accumulator by one.

Examples

input output
H Hello world!
HQ Hello world!
HQ
QQQQ QQQQ
QQQQ
QQQQ
QQQQ
Q + Q + Q Q + Q + Q
Q + Q + Q
Q + Q + Q

literature

  • Philipp Winterberg: The "99 Bottles of Beer" program: A journey through the world of programming languages, 2013, p. 46 [1]
  • Тюгашев Андрей Александрович: Языки программирования. Учебное пособие. Стандарт третьего поколения, "Издательский дом" "Питер" "", 2014, p. 246 [2]

Individual evidence

  1. Documentation of HQ9 ++ on the author's website
  2. Documentation of HQ9 + - on the author's website
  3. see the archive 99 Bottles of Beer for more than 1000 programming examples, see also the e-book by Philipp Winterberg (pdf) (on HQ9 + : p. 46)

Web links