Jump to content
MrGrj

What programming language has the shortest 'Hello World' program?

Recommended Posts

  • Active Members

Mi-am pus de cateva ori intrebarea asta. Ia sa vedem:

The language HW is the clear winner. It has no statements or expressions; all HW programs (no matter what their content) do nothing but print "Hello, World" as output. No programming langauge could be more efficient.

Here is a picture of dear programmer Kim Jong Un demonstrating how to use this remarkable language to infiltrate the computer networks of Sony Pictures and single-handedly show them how imperialist languages like C++ and Java are no match for the Juche idea: The noblest idea calling for respect for the people and the protection of human beings and the only all-powerful treasured sword not only for hewing out the destiny of independent human beings but for accomplishing the cause of each country and nation and the cause of global independence.

main-qimg-8aee2ae81a4c0f77c79d17ca9fbb941f?convert_to_webp=true

It is not the shortest, but LOLCODE is undoubtedly the cutest code:

HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE

Zero characters: Any domain-specific language whose compiler/generator/interpreter reads an empty input as the source code and produces a program that outputs the string Hello World.

Zero characters is hard to beat to make a Hello World program - but how fast can you make the language in which you can make the program? In MetaEdit+, you can build such a language in 18 characters and a few clicks:

1. Create a Graph type called H

2. Open the Generator Editor and create a new generator called H():


H()
'Hello World'

hq9+ is an esoteric language with only four commands: 'h' prints "hello, world", 'q' prints the program's source (Quine), '9' prints the lyrics to 99 bottles of beer, and '+' increments the accumulator. hq9+ was pretty much made as a joke to cheat at code golf. So the hello world is just:

h

x86 Assembly: (pt. @Psiho :D )


mov $0xb800, %ax

mov %ax, %ds


mov $'H', %al

mov %al, 0x0000

mov $0x0F, %al

mov %al, 0x0001


mov $'e', %al

mov %al, 0x0002

mov $0x0F, %al

mov %al, 0x0003


mov $'l', %al

mov %al, 0x0004

mov $0x0F, %al

mov %al, 0x0005


mov $'l', %al

mov %al, 0x0006

mov $0x0F, %al

mov %al, 0x0007


mov $'o', %al

mov %al, 0x0008

mov $0x0F, %al

mov %al, 0x0009


mov $' ', %al

mov %al, 0x000A

mov $0x0F, %al

mov %al, 0x000B


mov $'W', %al

mov %al, 0x000C

mov $0x0F, %al

mov %al, 0x000D


mov $'o', %al

mov %al, 0x000E

mov $0x0F, %al

mov %al, 0x000F


mov $'r', %al

mov %al, 0x0010

mov $0x0F, %al

mov %al, 0x0011


mov $'l', %al

mov %al, 0x0012

mov $0x0F, %al

mov %al, 0x0013


mov $'d', %al

mov %al, 0x0014

mov $0x0F, %al

mov %al, 0x0015


cli

hlt

Fourth place: oneliners like BASIC: print "Hello world"

Third place: interpretators echoing values entered, like LISP: "Hello World"

Second place: loosing the quotation marks like PHP: Hello World

First place: esoteric language outputing "Hello World" on single character

Zeroth place: esoteric language outputing "Hello World" on empty string, like making shell promt read "Hello World"

via. Puteti gasi alte solutii in link-ul alaturat :)

PS: si Python care vine tare din urma:


import __hello__

Edited by MrGrj
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...