HQ9++
Introduction
HQ9++ is an object-oriented extension of the well-known esoteric language
HQ9+, created by Cliff L. Biffle.
Design Principles
- Extend the elegance, simplicity, and power of HQ9+ to the object-oriented paradigm.
- Be backwards compatible with HQ9+. That is, any valid HQ9+ program will also run in HQ9++ and will produce
identical output.
Language Concepts
HQ9+ was created to make some very common programming tasks extremely straightforward. HQ9++ bulds on this strong core
functionality with the purest implementation of the object-oriented paradigm in any language.
Hello, World!
The quintessential test of a programming language is its ability to print the statement "Hello, World!" HQ9+ naturally
allows the writing of this test program in a very efficient and straightforward manner.
99 Bottles of Beer on the Wall
A good test of a language's control flow and recursive capabilities is the ability to print the full lyrics to the
song "99 Bottles of Beer on the Wall" with code as concise as possible. HQ9+ provides the definitive standard in this test.
Quines
A quine is a program that print its own source code. In most languages this requires some very tricky programming. HQ9+
again set a new standard for this test of a programming language's capability.
Objects
HQ9++ extends HQ9+ by allowing it to define and instantiate objects. HQ9++ is a so-called pure object-oriented
language, in that all data is stored in objects - there are no simple variables such as the integers or chars which
exist in "unpure" object-oriented langages such as C++ or Java.
Syntax Elements
HQ9++ has four syntax elements:
These are combined into five different commands, described below.
Commands
H
Prints "Hello, world!".
Q
Prints the entire text of the source code file.
9
Prints the complete canonical lyrics to "99 Bottles of Beer on the Wall".
+
Increments the accumulator.
++
When the sequence ++
is encountered, it (naturally) increments the accumulator twice, and also instantiates
an object of a new subclass of the generic superclass. In line with the best data-hiding principles, there is no way to
access this object.
Resources
- The original HQ9+ specification, by Cliff L. Biffle.
- A further extension of this amazingly versatile and useful language: HQ9+-, by melikamp.
Home | Esoteric Programming Languages
Last updated: Sunday, 20 January, 2013; 22:29:58 PST.
Copyright © 1990-2022, David Morgan-Mar. dmm@dangermouse.net
Hosted by: DreamHost