Revision 105750204 of "HQ9+" on enwiki<!-- Please do not remove or change this AfD message until the issue is settled -->{{#if:{{{nosubst|}}}|<div style="display:none;">}} {{#ifeq:{{NAMESPACE}}|| |{{error:not substituted|AFD}}<div style="display:none;">}}{{#if:{{{nosubst|}}}|</div></div>}}
<div class="boilerplate metadata" id="afd" style="margin: 0 5%; padding: 0 7px 7px 7px; background: #EDF1F1; border: 1px solid #999999; text-align: left; font-size:95%;">
'''This article is being considered for deletion''' for the 2nd time in accordance with Wikipedia's [[Wikipedia:Deletion policy|deletion policy]].<br />
Please share your thoughts on the matter at '''[[Wikipedia:Articles for deletion/{{{2|HQ9+}}} (2nd nomination)|this article's entry]]''' on the [[Wikipedia:Articles for deletion|Articles for deletion]] page.<br />
You are welcome to edit this article, but please do not blank this article or remove this notice while the discussion is in progress. For more information, particularly on merging or moving the article during the discussion, read the [[Wikipedia:Guide to deletion|Guide to deletion]].<br/>
''<small>Steps to [[Template:AfD footer|list an article for deletion]]: {{tls|afd}} • [http://en.wikipedia.org/w/index.php?action=edit&preload=Template:Afd2+starter&editintro=Template:Afd3+starter&title=Wikipedia:Articles+for+deletion/{{PAGENAMEE}}_({{urlencode:2nd nomination}}) Preloaded debate] OR <nowiki>{{</nowiki>subst:afd2|pg={{PAGENAME}}|cat=|text=}} • <nowiki>{{</nowiki>subst:afd3|pg={{PAGENAME}} (2nd nomination)}} [{{SERVER}}{{localurl:Wikipedia:Articles for deletion/Log/{{CURRENTYEAR}}_{{CURRENTMONTHNAME}}_{{CURRENTDAY}}|action=edit}} log] </small></div>
{{{category|[[Category:Articles for deletion]]}}}
<!-- End of AfD message, feel free to edit beyond this point -->
'''HQ9+''' is a [[joke programming language]] created by [[Cliff Biffle]] that consists of only four [[command (computing)|commands]], each represented by a single character: H, Q, 9, and +. It is not [[Turing-complete]], but it allows highly efficient programs, as long as they need do nothing except increment their accumulator, print "Hello, world", display their source, or output the lyrics 99 Bottles of Beer.
* The <code>H</code> command prints out [[Hello world program|"Hello, world!"]]
* The <code>Q</code> command prints out a copy of the [[source code]] of the program (i.e., it's a [[quine (computing)|quine]]).
* The <code>9</code> command prints out the lyrics for "[[99 Bottles of Beer|99 Bottles of Beer on the Wall]]".
* The <code>+</code> command increments the [[Accumulator (computing)|accumulator]], which happens to serve no purpose.
An example '''HQ9+''' program would be: <code>HHQ+HQ++</code>.
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 [[vacuous truth|vacuously true]]. The only programs in HQ9+ that can reasonably be called "useful" are ones that print out messages in [ASCII] text. To do this, a programmer simply has to write the ASCII text message within the source code by using the accumulator incrementor, and place a Q anywhere in the program to print the source code when compiled. This is a sample code that prints the message "HI" in large letters:<br>
<code>q+ ++ ++++++<br>
++ ++ ++ <br>
++++++ ++ <br>
++ ++ ++ <br>
++ ++ ++++++</code><br>
Incidentally, the q can go anywhere in the body of the code.
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 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+ [[Interpreter (computing)|interpreters]] are extremely simple to write, so there have been many written. For example, [[Media:Hq9-plus.py|this]] HQ9+ interpreter was written (in [[Python (programming language)|Python]]) in around five minutes and is only 18 lines long. And, [[Media:hq9p.c|this]] HQ9+ [[compiler]] written in [[C programming language|C]] translates source code from HQ9+ to C, 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++''',<ref>{{cite web|url=http://www.cliff.biffle.org/esoterica/hq9plus.html|title=HQ9++|work=DM's Esoteric Programming Languages|date=[[2007-01-12]]|accessdate=2007-01-21|first=David|last=Morgan-Mar}}</ref> also known as '''HQ9+ with Classes''', an [[object-oriented]] version created by [[David Morgan-Mar]]. This adds a new command, <code>++</code>, which increments the accumulator twice and instantiates an object. Following the principle of [[information hiding]], it is not possible to access this object.
==References==
<references />
==External links==
*[http://www.cliff.biffle.org/esoterica/hq9plus.html HQ9+]
*[http://www.almnet.de/esolang/hq9plus.php online HQ9+ interpreter]
*[http://code.eachmapinject.com/esoteric/hq9plus.rb HQ9+ interpreter in] [[Ruby programming language|Ruby]]
[[Category:Esoteric programming languages]]
[[cs:HQ9+]]
[[de:HQ9+]]
[[es:HQ9+]]
[[ko:HQ9+]]
[[it:HQ9+]]
[[ja:HQ9+]]
[[pl:HQ9+]]
[[ru:HQ9+]]All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://en.wikipedia.org/w/index.php?oldid=105750204.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|