Hello, world!



As described in more detail in the related Wikipedia article, Hello, world! is a classic "first program" one creates when learning a new programming language. The objective of the application is the same: to print the text "Hello, world!" to the screen in some form, be it console output or a dialog.

In many cases, the statement required to do this is a single line.

It seems appropriate that our introduction to Computer Science occupied this title. As a student, the first choice to make is to decide what kind of knowledge you are looking for. Of course, this depends upon your needs. You might be:


 * A learned computer scientist or professional eager to contribute research and course material
 * Computer professional seeking an alternative to expensive commercial certification
 * Adult non-computer professional or entrepreneur who could benefit from academic/practical knowledge of computing
 * College-eligible (or not) student considering a degree
 * Casual user trying to to catch/spread the next virus
 * Hobbyist or computer gamer looking to get the most out of your computing experience
 * Complete newbie looking for a place to start

This is an exciting time for education, and for those of us wishing to collaborate and share knowledge, skills and experience. At present, we are only limited by the sky, and some very large hard drives in a server farm somewhere.

Ada
For an explanation see b:Ada Programming:Basic.

ASP
or

Assembly
x86 compatible for MS-DOS.

Applesoft BASIC
Used on Apple ][ machines (Apple ][+, ][e, //c, ][GS)

-or-

Bally/Astrocade Basic
As used on the Bally and Astrocade game systems ca. 1978

Commodore BASIC
As used on a Commodore 64, ca. 1984

FreeBASIC and QuickBASIC
or:

Intellivision Basic
As used on a Mattel Intellivision, ca. 1983

Intellivision ECS Basic
As used in the Mattel Intellivision ECS

''! not on ECS keyboard. Only 4 char. commands in ECS Basic''

Common Lisp
Or:

JavaScript (aka JScript, ECMAScript, LiveScript)
or

or

Luka
print "Hello, world"

or, with proper syntax

print( "Hello, world!" );

Oberon
MODULE Hello;

IMPORT Out;

PROCEDURE World*; BEGIN Out.Open; Out.String("Hello, world!"); Out.Ln; END World;

END Hello.

PHP
or (with short_tags enabled in php.ini)

or (with asp_tags enabled in php.ini)

or

Python
With Python 2 Or with Python 3 The first line is used on Unix systems only, and is optional even there. The advantage is that it allows the file to be invoked directly (if ), without explicitly specifying the   interpreter.

Ruby
Another way to do it, albeit more obscure:

Trekkie
"Computer?" "Create program 'Hello, World! Picard-alpha-1'" "Parameters: Display the phrase 'Hello, world!' on the screen the program is executed from until the program is terminated." "Save program."
 * Bee bee boo
 * Boo boo bee
 * Bee bee
 * Boo bee boo

Turing
put "Hello World!"

Assignment
Create a Hello, world! program in a language not listed above, then edit this page and add it to the collection.

C
Because the tradition of using the phrase "Hello, world!" as a test message was influenced by an example program in the seminal book The C Programming Language. that original example is reproduced here.

Natural
WRITE 'Hello, world!' END Hello, world!

XML
Or with attributes:

More about Computer Programming

 * Topic:Computer Programming