AminetAminet
Search:
84782 packages online
About
Recent
Browse
Search
Upload
Setup
Services

dev/lang/hq9p-mos.lha

Mirror:Random
Showing: ppc-morphos icongeneric icon
No screenshot available
Short:HQ9plus joke programming language
Author:Cliff Biffle, Morphos port by Fabrizio "Lanch" Bartoloni
Uploader:lanch tiscali it (Fabrizio Bartoloni)
Type:dev/lang
Architecture:ppc-morphos
Date:2006-01-17
Download:dev/lang/hq9p-mos.lha - View contents
Readme:dev/lang/hq9p-mos.readme
Downloads:772

This definition taken from Wikipedia, the free encyclopedia. 

HQ9+ is a joke programming language created by Cliff Biffle that consists of only four commands , each represented by a single character:
 H, Q, 9, and +. It is not Turing-complete, but it is highly efficient at certain types of programs. 
 The H command prints out   "Hello, world!"   
 The Q command prints out a copy of the source code of the program (i.e., it's a quine).   
 The 9 command prints out the lyrics for 99 Bottles of Beer on the Wall .   
 The + command increments the   accumulator .   

An example   HQ9+   program would be: "HHQ+HQ++". 
This program would output "Hello, world! Hello, world! HHQ+HQ++ Hello, world! HHQ+HQ++" as well as incrementing the accumulator three times. 
It is claimed that all useful programs written in HQ9+ run over twice as fast as the same programs written in any other language.
Since no useful programs can be written in HQ9+, this is vacuously true. 
HQ9+ is a joke; each command represents a common task that beginners are given when learning to program, or that programmers give themselves when learning a new programming language. A common exercise, for example, is to write a computer program that prints  "Hello, world!". There are some programming languages in which this is actually quite difficult; however, in HQ9+ the task is elementary, since the program "H" will accomplish the task. One of the hardest tasks in many programming languages is to write a quine, that is, a program which prints its own source code. However, in HQ9+, this is also trivial. 
HQ9+ interpreters   are extremely simple to write, so there have been many written. For example, this   HQ9+ interpreter was written (in Python ) in around five minutes and is only 18 lines long. And, this HQ9+ compiler written in C compiles HQ9+ programs to C code and is only about 40 lines long. 
Since HQ9+ programs do not accept input, it is not possible to write an HQ9+ interpreter or compiler in HQ9+. 
There is also another joke language called HQ9++ created by David Morgan-Mar, an object-oriented language backward compatible with HQ9+.
 This adds a new command, ++ , which increments the accumulator twice and instantiates an object. Following the principle of information hiding, it is not possible to access this object.


Contents of dev/lang/hq9p-mos.lha
 PERMSSN    UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP          NAME
---------- ----------- ------- ------- ------ ---------- ------------ -------------
[generic]                 4194   10664  39.3% -lh5- 6f00 Jan  9 21:14 hq9p
[generic]                 1162    2564  45.3% -lh5- 26c0 Jan  9 21:25 hq9p-mos.readme
[generic]                  592    1460  40.5% -lh5- 7d6a Jan  9 20:15 Hq9p.c
---------- ----------- ------- ------- ------ ---------- ------------ -------------
 Total         3 files    5948   14688  40.5%            Jan 17 00:38
Page generated in 0.001 seconds
Aminet © 1992-2024 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>