Hello world/Text: Difference between revisions

From Rosetta Code
Content added Content deleted
(This version technically worked in the Waduzitdo web interpreter, but I'm sure some implementations require the stop run command S: so I finally gave the program a proper end)
(276 intermediate revisions by more than 100 users not shown)
Line 9: Line 9:
*   [[Hello world/Graphical]]
*   [[Hello world/Graphical]]
*   [[Hello world/Line Printer]]
*   [[Hello world/Line Printer]]
*   [[Hello world/Newbie]]
*   [[Hello world/Newline omission]]
*   [[Hello world/Newline omission]]
*   [[Hello world/Standard error]]
*   [[Hello world/Standard error]]
Line 15: Line 16:


=={{header|0815}}==
=={{header|0815}}==
<lang 0815>
<syntaxhighlight lang="0815">
<:48:x<:65:=<:6C:$=$=$$~<:03:+
<:48:x<:65:=<:6C:$=$=$$~<:03:+
$~<:ffffffffffffffb1:+$<:77:~$
$~<:ffffffffffffffb1:+$<:77:~$
Line 21: Line 22:
<:06:x-$x<:0e:x-$=x<:43:x-$
<:06:x-$x<:0e:x-$=x<:43:x-$


</syntaxhighlight>
</lang>


=={{header|11l}}==
=={{header|11l}}==
<lang 11l>print(‘Hello world!’)</lang>
<syntaxhighlight lang="11l">print(‘Hello world!’)</syntaxhighlight>


=={{header|360 Assembly}}==
=={{header|360 Assembly}}==
Using native SVC (Supervisor Call) to write to system console:
Using native SVC (Supervisor Call) to write to system console:
<syntaxhighlight lang="360 assembly">
<lang 360 Assembly>
HELLO CSECT
HELLO CSECT
USING HELLO,15
USING HELLO,15
Line 38: Line 39:
DC XL2'00' 2 bytes binary of zeros
DC XL2'00' 2 bytes binary of zeros
DC C'Hello world!' Text to be written to system console
DC C'Hello world!' Text to be written to system console
END</lang>
END</syntaxhighlight>
Using WTO Macro to generate SVC 35 and message area:
Using WTO Macro to generate SVC 35 and message area:
<lang 360 Assembly> WTO 'Hello world!'
<syntaxhighlight lang="360 assembly"> WTO 'Hello world!'
BR 14 Return
BR 14 Return
END
END
</syntaxhighlight>
</lang>

=={{header|IBM Z HL/ASM}}==
Using Modern IBM Z High Level assembler to write 'Hello World' to the Unix System Services 'stdout' file descriptor
<syntaxhighlight lang="360 assembly">
PRINT ON,GEN,DATA
HELLO CSECT
HELLO RMODE ANY
HELLO AMODE 31
*
* Prolog
*
SAVE (14,12)
BASR R12,0
USING *,R12
STORAGE OBTAIN,LENGTH=DYNL,ADDR=(R11)
USING DYNAREA,R11

LA R2,DSA
ST R2,8(,R13)
ST R13,DSA+4
LR R13,R2
*
* Body
* Write Hello World to STDOUT
*

*
* Store values into parameter list
*
MVC REC(HWL),HW
LA R1,REC
ST R1,RECA
LA R1,HWL
ST R1,RECL
L R1,STDOUT
ST R1,FD
L R1,BPXALET
ST R1,ALET

CALL BPX1WRT,(FD, x
RECA, x
ALET, x
RECL, x
RV, x
RC, x
RN),MF=(E,BPXWRTD)

L R8,RV
L R9,RC
L R10,RN
*
* Epilog
*
L R13,DSA+4
STORAGE RELEASE,LENGTH=DYNL,ADDR=(R11)
RETURN (14,12),RC=0

*
* Statics, Dynamic Storage, Equates follows
*
* Naming convention:
* Suffixes:
* L : length
* S : static
* D : dynamic
* A : address

LTORG
*
* Statics (constants)
*
STDIN DC F'0'
STDOUT DC F'1'
STDERR DC F'2'
BPXALET DC F'0'
BPX1WRT DC V(BPX1WRT)

BPXWRTS CALL ,(0,0,0,0,0,0,0),MF=L
BPXWRTL EQU *-BPXWRTS

HW DC C'Hello World'
NEWLINE DC X'15'
HWL EQU *-HW

*
* Dynamic (storage obtain'ed) area
*
DYNAREA DSECT
*
* Dynamic Save Area regs always first
*
DSA DS 18F

*
* Working storage
*
FD DS F

RECSIZE EQU RECEND-*
REC DS CL80
RECEND EQU *
RECA DS A
BPXWRTD DS CL(BPXWRTL)
ALET DS F
RECL DS F
RV DS F
RC DS F
RN DS F

DYNL EQU *-DYNAREA
*
*
* End of working storage
*

*
* Equates
*
R0 EQU 0
R1 EQU 1
R2 EQU 2
R3 EQU 3
R4 EQU 4
R5 EQU 5
R6 EQU 6
R7 EQU 7
R8 EQU 8
R9 EQU 9
R10 EQU 10
R11 EQU 11
R12 EQU 12
R13 EQU 13
R14 EQU 14
R15 EQU 15
END
</syntaxhighlight>


=={{header|4DOS Batch}}==
=={{header|4DOS Batch}}==
<lang 4dos>echo Hello world!</lang>
<syntaxhighlight lang="4dos">echo Hello world!</syntaxhighlight>


=={{header|6502 Assembly}}==
=={{header|6502 Assembly}}==
<lang asm>; goodbyeworld.s for C= 8-bit machines, ca65 assembler format.
<syntaxhighlight lang="asm">; goodbyeworld.s for C= 8-bit machines, ca65 assembler format.
; String printing limited to strings of 256 characters or less.
; String printing limited to strings of 256 characters or less.


a_cr = $0d ; Carriage return.
a_cr = $0d ; Carriage return.
bsout = $ffd2 ; C64 KERNEL ROM, output a character to current device.
bsout = $ffd2 ; C64 KERNEL ROM, output a character to current device.
; use $fded for Apple 2
; use $fded for Apple 2, $ffe3 (ascii) or $ffee (raw) for BBC.
.code
.code


Line 70: Line 207:


text:
text:
.byte "Hello world!", a_cr, 0</lang>
.byte "Hello world!", a_cr, 0</syntaxhighlight>


=={{header|6800 Assembly}}==
=={{header|6800 Assembly}}==
<lang> .cr 6800
<syntaxhighlight lang="text"> .cr 6800
.tf gbye6800.obj,AP1
.tf gbye6800.obj,AP1
.lf gbye6800
.lf gbye6800
Line 103: Line 240:
;=====================================================;
;=====================================================;
string .as "Hello world!",#13,#10,#0
string .as "Hello world!",#13,#10,#0
.en</lang>
.en</syntaxhighlight>

=={{header|8080 Assembly}}==

<syntaxhighlight lang="8080asm"> ; This is Hello World, written in 8080 assembly to run under CP/M
; As you can see, it is similar to the 8086, and CP/M is very
; similar to DOS in the way it is called.
org 100h ; CP/M .COM entry point is 100h - like DOS
mvi c,9 ; C holds the syscall, 9 = print string - like DOS
lxi d,msg ; DE holds a pointer to the string
jmp 5 ; CP/M calls are accessed through the jump at 05h
; Normally you'd CALL it, but since you'd end the program by RETurning,
; JMP saves a byte (if you've only got 64k of address space you want to
; save bytes).
msg: db 'Hello world!$'</syntaxhighlight>


=={{header|8086 Assembly}}==
=={{header|8086 Assembly}}==


<lang masm>DOSSEG
<syntaxhighlight lang="masm">DOSSEG
.MODEL TINY
.MODEL TINY
.DATA
.DATA
Line 122: Line 273:
MOV AX, 4C00h ; go back to DOS
MOV AX, 4C00h ; go back to DOS
INT 21h
INT 21h
END START</lang>
END START</syntaxhighlight>


With A86 or NASM syntax:
With A86 or NASM syntax:
Line 138: Line 289:


=={{header|8th}}==
=={{header|8th}}==
<lang forth>"Hello world!\n" . bye</lang>
<syntaxhighlight lang="forth">"Hello world!\n" . bye</syntaxhighlight>


=={{header|AArch64 Assembly}}==
=={{header|AArch64 Assembly}}==
<lang ARM_Assembly>.equ STDOUT, 1
<syntaxhighlight lang="arm_assembly">.equ STDOUT, 1
.equ SVC_WRITE, 64
.equ SVC_WRITE, 64
.equ SVC_EXIT, 93
.equ SVC_EXIT, 93
Line 162: Line 313:


msg: .ascii "Hello World!\n"
msg: .ascii "Hello World!\n"
.align 4</lang>
.align 4</syntaxhighlight>


=={{header|ABAP}}==
=={{header|ABAP}}==
<lang ABAP>REPORT zgoodbyeworld.
<syntaxhighlight lang="abap">REPORT zgoodbyeworld.
WRITE 'Hello world!'.</lang>
WRITE 'Hello world!'.</syntaxhighlight>


=={{header|ACL2}}==
=={{header|ACL2}}==
<lang lisp>(cw "Hello world!~%")</lang>
<syntaxhighlight lang="lisp">(cw "Hello world!~%")</syntaxhighlight>

=={{header|Acornsoft Lisp}}==

Since there is no string data type in the language, a symbol (an identifier or 'character atom') must be used instead. When writing a symbol in source code, exclamation mark is an escape character that allows characters such as spaces and exclamation marks to be treated as part of the symbol's name. Some output functions will include exclamation mark escapes when outputting such symbols, and others, such as <code>printc</code>, will not.

<syntaxhighlight lang="lisp">(printc 'Hello! world!!)</syntaxhighlight>

The single quote in front of <code>Hello! world!!</code> makes it an expression that evaluates to the symbol itself; otherwise, it would be treated as a variable and its value (if it had one) would be printed instead.

=={{header|Action!}}==
<syntaxhighlight lang="action!">Proc Main()
Print("Hello world!")
Return</syntaxhighlight>


=={{header|ActionScript}}==
=={{header|ActionScript}}==
<lang ActionScript>trace("Hello world!");</lang>
<syntaxhighlight lang="actionscript">trace("Hello world!");</syntaxhighlight>


=={{header|Ada}}==
=={{header|Ada}}==
{{works with|GCC|4.1.2}}
{{works with|GCC|4.1.2}}
<lang ada>with Ada.Text_IO; use Ada.Text_IO;
<syntaxhighlight lang="ada">with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
procedure Main is
begin
begin
Put_Line ("Hello world!");
Put_Line ("Hello world!");
end Main;</lang>
end Main;</syntaxhighlight>

=={{header|Agda}}==
For Agda 2.6.3, based on its [https://agda.readthedocs.io/en/v2.6.3/getting-started/hello-world.html documentation].
<syntaxhighlight lang="agda">module HelloWorld where

open import Agda.Builtin.IO using (IO)
open import Agda.Builtin.Unit renaming (⊤ to Unit)
open import Agda.Builtin.String using (String)

postulate putStrLn : String -> IO Unit
{-# FOREIGN GHC import qualified Data.Text as T #-}
{-# COMPILE GHC putStrLn = putStrLn . T.unpack #-}

main : IO Unit
main = putStrLn "Hello world!"
</syntaxhighlight>


=={{header|Agena}}==
=={{header|Agena}}==
<lang agena>print( "Hello world!" )</lang>
<syntaxhighlight lang="agena">print( "Hello world!" )</syntaxhighlight>


=={{header|Aime}}==
=={{header|Aime}}==
<lang aime>o_text("Hello world!\n");</lang>
<syntaxhighlight lang="aime">o_text("Hello world!\n");</syntaxhighlight>


or:
or:


<lang aime>integer
<syntaxhighlight lang="aime">integer
main(void)
main(void)
{
{
Line 196: Line 376:


return 0;
return 0;
}</lang>
}</syntaxhighlight>


=={{header|Algae}}==
=={{header|Algae}}==
<lang algae>printf("Hello world!\n");</lang>
<syntaxhighlight lang="algae">printf("Hello world!\n");</syntaxhighlight>


=={{header|ALGOL 60}}==
=={{header|ALGOL 60}}==
<lang algol60>'BEGIN'
<syntaxhighlight lang="algol60">'BEGIN'
OUTSTRING(1,'('Hello world!')');
OUTSTRING(1,'('Hello world!')');
SYSACT(1,14,1)
SYSACT(1,14,1)
'END'</lang>
'END'</syntaxhighlight>


=={{header|ALGOL 68}}==
=={{header|ALGOL 68}}==
<lang algol68>main: (
<syntaxhighlight lang="algol68">main: (
printf($"Hello world!"l$)
printf($"Hello world!"l$)
)</lang>
)</syntaxhighlight>


=={{header|ALGOL W}}==
=={{header|ALGOL W}}==
<lang algolw>begin
<syntaxhighlight lang="algolw">begin
write( "Hello world!" )
write( "Hello world!" )
end.</lang>
end.</syntaxhighlight>


=={{header|ALGOL-M}}==
=={{header|ALGOL-M}}==
<lang algol>BEGIN
<syntaxhighlight lang="algol">BEGIN
WRITE( "Hello world!" );
WRITE( "Hello world!" );
END</lang>
END</syntaxhighlight>


=={{header|Alore}}==
=={{header|Alore}}==
<lang alore>Print('Hello world!')</lang>
<syntaxhighlight lang="alore">Print('Hello world!')</syntaxhighlight>
=={{header|Amazing Hopper}}==

1)
<syntaxhighlight lang="amazing hopper">
main:
{"Hello world!\n"}print
exit(0)
</syntaxhighlight>
<pre>execute with: hopper helloworld.com</pre>
2)
<syntaxhighlight lang="amazing hopper">
#include <hopper.h>
main:
exit("Hello world!\n")
</syntaxhighlight>
<pre>execute with: hopper helloworld.com -d</pre>
3)
<syntaxhighlight lang="amazing hopper">
main:
{"Hello world!\n"}return
</syntaxhighlight>
<pre>execute with: hopper helloworld.com -d</pre>


=={{header|AmbientTalk}}==
=={{header|AmbientTalk}}==
<lang ambienttalk>system.println("Hello world!")</lang>
<syntaxhighlight lang="ambienttalk">system.println("Hello world!")</syntaxhighlight>


=={{header|AmigaE}}==
=={{header|AmigaE}}==
<lang amigae>PROC main()
<syntaxhighlight lang="amigae">PROC main()
WriteF('Hello world!\n')
WriteF('Hello world!\n')
ENDPROC</lang>
ENDPROC</syntaxhighlight>

=={{header|AngelScript}}==
<syntaxhighlight lang="angelscript">void main() { print("Hello world\n"); }</syntaxhighlight>


=={{header|AntLang}}==
=={{header|AntLang}}==
Note, that "Hello, World!" prints twice in interactive mode.
Note, that "Hello, World!" prints twice in interactive mode.
One time as side-effect and one as the return value of echo.
One time as side-effect and one as the return value of echo.
<lang AntLang>echo["Hello, World!"]</lang>
<syntaxhighlight lang="antlang">echo["Hello, World!"]</syntaxhighlight>


=={{header|Anyways}}==
=={{header|Anyways}}==


<lang Anyways>There was a guy called Hello World
<syntaxhighlight lang="anyways">There was a guy called Hello World
"Ow!" it said.
"Ow!" it said.
That's all folks!</lang>
That's all folks!</syntaxhighlight>


=={{header|APL}}==
=={{header|APL}}==
<lang apl>'Hello world!'</lang>
<syntaxhighlight lang="apl">'Hello world!'</syntaxhighlight>


=={{header|AppleScript}}==
=={{header|AppleScript}}==
To show in Script Editor Result pane:
To show in Script Editor Result pane:
<lang applescript>"Hello world!"</lang>
<syntaxhighlight lang="applescript">"Hello world!"</syntaxhighlight>


To show in Script Editor Event Log pane:
To show in Script Editor Event Log pane:
<lang applescript>log "Hello world!"</lang>
<syntaxhighlight lang="applescript">log "Hello world!"</syntaxhighlight>


=={{header|Applesoft BASIC}}==
=={{header|Applesoft BASIC}}==
Line 259: Line 464:
Important Note: Although Applesoft BASIC allowed the storage and output of mixed-case strings, the ability to enter mixed-case via the keyboard and to output mixed-case on the default display was not offered as standard equipment on the original Apple II/II+. Since Applesoft WAS the default programming language for the Apple II+, perhaps some flexibility in the task specification could be offered, for this and for other systems that lacked proper mixed-case I/O capabilities in at least one popular configuration.
Important Note: Although Applesoft BASIC allowed the storage and output of mixed-case strings, the ability to enter mixed-case via the keyboard and to output mixed-case on the default display was not offered as standard equipment on the original Apple II/II+. Since Applesoft WAS the default programming language for the Apple II+, perhaps some flexibility in the task specification could be offered, for this and for other systems that lacked proper mixed-case I/O capabilities in at least one popular configuration.


<lang Applesoft BASIC> PRINT "Hello world!"</lang>
<syntaxhighlight lang="applesoft basic"> PRINT "Hello world!"</syntaxhighlight>


=={{header|Apricot}}==
=={{header|Apricot}}==
<lang apricot>(puts "Hello world!")</lang>
<syntaxhighlight lang="apricot">(puts "Hello world!")</syntaxhighlight>


=={{header|Arc}}==
=={{header|Arc}}==
<lang arc>(prn "Hello world!")</lang>
<syntaxhighlight lang="arc">(prn "Hello world!")</syntaxhighlight>


=={{header|Arendelle}}==
=={{header|Arendelle}}==
Line 271: Line 476:


=={{header|Argile}}==
=={{header|Argile}}==
<lang Argile>use std
<syntaxhighlight lang="argile">use std
print "Hello world!"</lang>
print "Hello world!"</syntaxhighlight>
compile with: arc hello_world.arg -o hello_world.c && gcc -o hello_world hello_world.c
compile with: arc hello_world.arg -o hello_world.c && gcc -o hello_world hello_world.c


=={{header|ARM Assembly}}==
=={{header|ARM Assembly}}==


<lang ARM_Assembly>.global main
<syntaxhighlight lang="arm_assembly">.global main


message:
message:
Line 288: Line 493:


mov r7, #1
mov r7, #1
swi 0</lang>
swi 0</syntaxhighlight>

Alternative versions

<pre>
Developed on an Acorn A5000 with RISC OS 3.10 (30 Apr 1992)
Using the assembler contained in ARM BBC BASIC V version 1.05 (c) Acorn 1989

The Acorn A5000 is the individual computer used to develop the code,
the code is applicable to all the Acorn Risc Machines (ARM)
produced by Acorn and the StrongARM produced by digital.

In the BBC BASIC part of the program I have included:
OS_WriteC = &00
OS_WriteO = &02
OS_NewLine = &03
this is so I can write SWI OS_WriteC etc instead of SWI &0 to make the assembler more legible

(a) method1 - output the text character by character until the terminating null (0) is seen

.method1_vn00
ADR R8 , method1_string \ the ARM does not have an ADR instruction
\ the assembler will work out how far the data item
\ is from here (in this case a +ve relative offset)
\ and so will produce an ADD R8 , PC, offset to method1_string
\ a magic trick by the ARM assembler

.method1_loop
LDRB R0 , [R8], #1 \ load the byte found at address in R8 into R0
\ then post increment the address in R8 in preparation
\ for the next byte (the #1 is my choice for the increment)
CMP R0 , #0 \ has the terminating null (0) been reached
SWINE OS_WriteC \ when not the null output the character in R0
\ (every opportunity to have a SWINE in your program should be taken)
BNE method1_loop \ go around the loop for the next character if not reached the null

SWI OS_NewLine \ up to you if you want a newline

MOVS PC , R14 \ return
\ when I call an operating system function it no longer operates
\ in 'user mode' and it has its own R14, and anyway the operating system
\ is too polite to write rubbish into this return address


.method1_string
EQUS "Hello world!" \ the string to be output
EQUB &00 \ a terminating null (0)
ALIGN \ tell the assembler to ensure that the next item is on a word boundary




(b) method2 - get the supplied operating system to do the work

.method2_vn00
ADR R0 , method2_string \ the ARM does not have an ADR instruction
\ the assembler will work out how far the data item
\ is from here (in this case a +ve relative offset)
\ and so will produce an ADD R0 , PC, offset to method2_string
\ a magic trick by the ARM assembler

SWI OS_WriteO \ R0 = pointer to null-terminated string to write

SWI OS_NewLine \ up to you if you want a newline

MOVS PC , R14 \ return
.method2_string
EQUS "hELLO WORLD!" \ the string to be output
EQUB &00 \ a terminating null (0)
ALIGN \ tell the assembler to ensure that the next item is on a word boundary
</pre>


=={{header|ArnoldC}}==
=={{header|ArnoldC}}==
<lang ArnoldC>IT'S SHOWTIME
<syntaxhighlight lang="arnoldc">IT'S SHOWTIME
TALK TO THE HAND "Hello world!"
TALK TO THE HAND "Hello world!"
YOU HAVE BEEN TERMINATED</lang>
YOU HAVE BEEN TERMINATED</syntaxhighlight>


=={{header|Arturo}}==
=={{header|Arturo}}==
<lang arturo>print "Hello world!"</lang>
<syntaxhighlight lang="rebol">print "Hello world!"</syntaxhighlight>

{{out}}

<pre>Hello world!</pre>


=={{header|AsciiDots}}==
=={{header|AsciiDots}}==


<syntaxhighlight lang="asciidots">
<lang AsciiDots>
.-$'Hello, World!'
.-$'Hello, World!'
</syntaxhighlight>
</lang>


=={{header|Astro}}==
=={{header|Astro}}==
<lang python>print "Hello world!"</lang>
<syntaxhighlight lang="python">print "Hello world!"</syntaxhighlight>


=={{header|Asymptote}}==
=={{header|Asymptote}}==
<syntaxhighlight lang="asymptote">write('Hello world!');</syntaxhighlight>


=={{header|Atari BASIC}}==
<lang asymptote>write('Hello world!');</lang>
<syntaxhighlight lang="Atari BASIC">10 PRINT "Hello World"</syntaxhighlight>


=={{header|ATS}}==
=={{header|ATS}}==
<lang ATS>implement main0 () = print "Hello world!\n"</lang>
<syntaxhighlight lang="ats">implement main0 () = print "Hello world!\n"</syntaxhighlight>


=={{header|AutoHotkey}}==
=={{header|AutoHotkey}}==
script launched from windows explorer
script launched from windows explorer
<lang AutoHotkey>DllCall("AllocConsole")
<syntaxhighlight lang="autohotkey">DllCall("AllocConsole")
FileAppend, Goodbye`, World!, CONOUT$
FileAppend, Goodbye`, World!, CONOUT$
FileReadLine, _, CONIN$, 1</lang>
FileReadLine, _, CONIN$, 1</syntaxhighlight>
scripts run from shell
scripts run from shell
[requires Windows XP or higher; older Versions of Windows don´t have the "AttachConsole" function]
[requires Windows XP or higher; older Versions of Windows don´t have the "AttachConsole" function]
<lang AutoHotkey>DllCall("AttachConsole", "int", -1)
<syntaxhighlight lang="autohotkey">DllCall("AttachConsole", "int", -1)
FileAppend, Goodbye`, World!, CONOUT$</lang>
FileAppend, Goodbye`, World!, CONOUT$</syntaxhighlight>
<lang AutoHotkey>SendInput Hello world!{!}</lang>
<syntaxhighlight lang="autohotkey">SendInput Hello world!{!}</syntaxhighlight>


=={{header|AutoIt}}==
=={{header|AutoIt}}==
<lang AutoIt>ConsoleWrite("Hello world!" & @CRLF)</lang>
<syntaxhighlight lang="autoit">ConsoleWrite("Hello world!" & @CRLF)</syntaxhighlight>


=={{header|AutoLISP}}==
=={{header|AutoLISP}}==
<lang cadlisp>(printc "Hello World!")</lang>
<syntaxhighlight lang="cadlisp">(printc "Hello World!")</syntaxhighlight>


=={{header|Avail}}==
=={{header|Avail}}==
<lang Avail>Print: "Hello World!";</lang>
<syntaxhighlight lang="avail">Print: "Hello World!";</syntaxhighlight>


=={{header|AWK}}==
=={{header|AWK}}==
<lang awk>BEGIN{print "Hello world!"}</lang>
<syntaxhighlight lang="awk">BEGIN{print "Hello world!"}</syntaxhighlight>




"BEGIN" is a "special pattern" - code within "{}" is executed before the input file is read, even if there is no input. "END" is a similar pattern, for after completion of main processing.
"BEGIN" is a "special pattern" - code within "{}" is executed before the input file is read, even if there is no input. "END" is a similar pattern, for after completion of main processing.
<lang awk>
<syntaxhighlight lang="awk">
END {
END {
print "Hello world!"
print "Hello world!"
}
}
</syntaxhighlight>
</lang>


For a file containing data, the work can be done in the "body". The "//" is "match anything" so gets the first data, the "exit" halts processing the file (any "END" would then be executed). Or instead of //, simply 1 is true.
For a file containing data, the work can be done in the "body". The "//" is "match anything" so gets the first data, the "exit" halts processing the file (any "END" would then be executed). Or instead of //, simply 1 is true.
<lang awk>
<syntaxhighlight lang="awk">
// {
// {
print "Hello world!"
print "Hello world!"
exit
exit
}
}
</syntaxhighlight>
</lang>




For a "single record" file.
For a "single record" file.
<lang awk>
<syntaxhighlight lang="awk">
// {
// {
print "Hello world!"
print "Hello world!"
}
}
</syntaxhighlight>
</lang>


For a "single record" file containing - Hello world! -. The "default" action for a "pattern match" (the "/" and "/" define a "pattern" to match data) is to "print" the record.
For a "single record" file containing - Hello world! -. The "default" action for a "pattern match" (the "/" and "/" define a "pattern" to match data) is to "print" the record.
<lang awk>
<syntaxhighlight lang="awk">
//
//
</syntaxhighlight>
</lang>


=={{header|Axe}}==
=={{header|Axe}}==
Note that the i here is the imaginary ''i'', not the lowercase letter i.
Note that the i here is the imaginary ''i'', not the lowercase letter i.
<lang axe>Disp "Hello world!",i</lang>
<syntaxhighlight lang="axe">Disp "Hello world!",i</syntaxhighlight>


=={{header|B}}==
=={{header|B}}==
{{works with|The Amsterdam Compiler Kit - B|V6.1pre1}}
{{works with|The Amsterdam Compiler Kit - B|V6.1pre1}}
<lang B>main()
<syntaxhighlight lang="b">main()
{
{
putstr("Hello world!*n");
putstr("Hello world!*n");
return(0);
return(0);
}</lang>
}</syntaxhighlight>

=={{header|B4X}}==
<syntaxhighlight lang="b4x">Log("Hello world!")</syntaxhighlight>


=={{header|Babel}}==
=={{header|Babel}}==


<lang babel>"Hello world!" <<</lang>
<syntaxhighlight lang="babel">"Hello world!" <<</syntaxhighlight>

=={{header|BabyCobol}}==
<syntaxhighlight lang="cobol">
* Since no quotes are used, two undeclared fields (variables) are printed.
* Their default values are their own names in uppercase.
IDENTIFICATION DIVISION.
PROGRAM-ID. USER OUTPUT.
PROCEDURE DIVISION.
DISPLAY HELLO WORLD.
</syntaxhighlight>

=={{header|Bait}}==
<syntaxhighlight lang="bait">fun main() {
println('Hello World!')
}</syntaxhighlight>

=={{header|Ballerina}}==
<syntaxhighlight lang="ballerina">import ballerina/io;

public function main() {
io:println("Hello World!");
}</syntaxhighlight>


=={{header|bash}}==
=={{header|bash}}==
<lang bash>echo "Hello world!"</lang>
<syntaxhighlight lang="bash">echo "Hello world!"</syntaxhighlight>


=={{header|BASIC}}==
=={{header|BASIC}}==
{{works with|BASICA}}
{{works with|BASICA}}
{{works with|Chipmunk Basic}}
{{works with|Commodore BASIC}}
{{works with|Commodore BASIC}}
{{works with|GW-BASIC}}
{{works with|IS-BASIC}}
{{works with|Just BASIC}}
{{works with|Liberty BASIC}}
{{works with|Locomotive Basic}}
{{works with|Locomotive Basic}}
{{works with|M2000 Interpreter}}
{{works with|M2000 Interpreter}}
{{works with|MSX BASIC}}
{{works with|MSX BASIC}}
{{works with|QBasic}}
{{works with|Quite BASIC}}
{{works with|Run BASIC}}
{{works with|Tiny BASIC}}
{{works with|Tiny BASIC}}
{{works with|ZX Spectrum Basic}}
<lang qbasic>10 print "Hello world!"</lang>
<syntaxhighlight lang="qbasic">10 print "Hello world!"</syntaxhighlight>



{{works with|7Basic}}
{{works with|7Basic}}
{{works with|Applesoft BASIC}}
{{works with|BaCon}} [[Category:BaCon]]
{{works with|BaCon}} [[Category:BaCon]]
{{works with|QBasic}}
{{works with|BASIC256}}
{{works with|FreeBASIC}}
{{works with|IS-BASIC}}
{{works with|M2000 Interpreter}}
{{works with|M2000 Interpreter}}
{{works with|QBasic}}
<lang qbasic>PRINT "Hello world!"</lang>
{{works with|QB64}}

{{works with|Script Basic}}
=={{header|Basic Casio}}==
{{works with|SmallBASIC}}
<lang Basic Casio>Locate 1,1,"Hello World!"</lang>
{{works with|Yabasic}}
or just
<lang Basic Casio>"Hello World!"</lang>
<syntaxhighlight lang="qbasic">PRINT "Hello world!"</syntaxhighlight>


=={{header|BASIC256}}==
=={{header|BASIC256}}==
<lang BASIC256>PRINT "Hello world!"</lang>
<syntaxhighlight lang="basic256">PRINT "Hello world!"</syntaxhighlight>


=={{header|Batch File}}==
=={{header|Batch File}}==
'''Under normal circumstances, when delayed expansion is disabled'''
'''Under normal circumstances, when delayed expansion is disabled'''
<lang dos>echo Hello world!</lang>
<syntaxhighlight lang="dos">echo Hello world!</syntaxhighlight>


'''If delayed expansion is enabled, then the ! must be escaped twice'''
'''If delayed expansion is enabled, then the ! must be escaped twice'''
<lang dos>setlocal enableDelayedExpansion
<syntaxhighlight lang="dos">setlocal enableDelayedExpansion
echo Hello world!^^!</lang>
echo Hello world!^^!</syntaxhighlight>


=={{header|Battlestar}}==
=={{header|Battlestar}}==
<!--- supports C syntax highlighting --->
<!--- supports C syntax highlighting --->
<lang c>const hello = "Hello world!\n"
<syntaxhighlight lang="c">const hello = "Hello world!\n"


print(hello)</lang>
print(hello)</syntaxhighlight>


=={{header|BBC BASIC}}==
=={{header|BBC BASIC}}==
<lang bbcbasic> PRINT "Hello world!"</lang>
<syntaxhighlight lang="bbcbasic"> PRINT "Hello world!"</syntaxhighlight>


=={{header|bc}}==
=={{header|bc}}==
<lang bc>"Hello world!
<syntaxhighlight lang="bc">"Hello world!
"</lang>
"</syntaxhighlight>


=={{header|BCPL}}==
=={{header|BCPL}}==
<lang BCPL>GET "libhdr"
<syntaxhighlight lang="bcpl">GET "libhdr"


LET start() = VALOF
LET start() = VALOF
{ writef("Hello world!")
{ writef("Hello world!")
RESULTIS 0
RESULTIS 0
}</lang>
}</syntaxhighlight>

=={{header|Beef}}==
<syntaxhighlight lang=csharp>Using System;
namespace HelloWorld {
class Program
{
static void Main()
{
Console.Writeln("Hello World!");
}
}
}
</syntaxhighlight>


=={{header|beeswax}}==
=={{header|beeswax}}==
Straightforward:
Straightforward:


<lang Beeswax>*`Hello, World!</lang>
<syntaxhighlight lang="beeswax">*`Hello, World!</syntaxhighlight>


Less obvious way:
Less obvious way:


<lang beeswax>>`ld!
<syntaxhighlight lang="beeswax">>`ld!
`
`
r
r
Line 450: Line 783:
W
W
`
`
b` ,olleH`_</lang>
b` ,olleH`_</syntaxhighlight>


Even less obvious, demonstrating the creation and execution order of instruction pointers, and the hexagonal layout of beeswax programs:
Even less obvious, demonstrating the creation and execution order of instruction pointers, and the hexagonal layout of beeswax programs:


<lang beeswax>r l
<syntaxhighlight lang="beeswax">r l
l o
l o
``
``
Line 460: Line 793:
``
``
e H
e H
W</lang>
W</syntaxhighlight>


=={{header|Befunge}}==
=={{header|Befunge}}==
<lang befunge>52*"!dlroW ,eybdooG">:#,_@</lang>
<syntaxhighlight lang="befunge">52*"!dlroW ,olleH">:#,_@</syntaxhighlight>

=={{header|Binary Lambda Calculus}}==
As explained at https://www.ioccc.org/2012/tromp/hint.html
<pre> Hello world!</pre>


=={{header|Bird}}==
=={{header|Bird}}==
It's not possible to print exclamation marks in [[Bird]] which is why it is not used in this example.
It's not possible to print exclamation marks in [[Bird]] which is why it is not used in this example.
<lang Bird>use Console
<syntaxhighlight lang="bird">use Console


define Main
define Main
Console.Println "Hello world"
Console.Println "Hello world"
end</lang>
end</syntaxhighlight>

=={{header|Blade}}==
<syntaxhighlight lang="blade">echo 'Hello world!'</syntaxhighlight>
or
<syntaxhighlight lang="blade">print('Hello world!')</syntaxhighlight>
or
<syntaxhighlight lang="blade">import io
io.stdout.write('Hello world!')</syntaxhighlight>


=={{header|Blast}}==
=={{header|Blast}}==
<lang blast># This will display a goodbye message on the terminal screen
<syntaxhighlight lang="blast"># This will display a goodbye message on the terminal screen
.begin
.begin
display "Hello world!"
display "Hello world!"
return
return
# This is the end of the script.</lang>
# This is the end of the script.</syntaxhighlight>

=={{Header|BlitzMax}}==
<syntaxhighlight lang="blitzmax">
print "Hello world!"
</syntaxhighlight>

=={{header|Blue}}==

Linux/x86

<syntaxhighlight lang="blue">global _start

: syscall ( num:eax -- result:eax ) syscall ;

: exit ( status:edi -- noret ) 60 syscall ;
: bye ( -- noret ) 0 exit ;

1 const stdout

: write ( buf:esi len:edx fd:edi -- ) 1 syscall drop ;
: print ( buf len -- ) stdout write ;

: greet ( -- ) s" Hello world!\n" print ;

: _start ( -- noret ) greet bye ;</syntaxhighlight>


=={{header|blz}}==
=={{header|blz}}==
<lang blz>print("Hello world!")</lang>
<syntaxhighlight lang="blz">print("Hello world!")</syntaxhighlight>


=={{header|BML}}==
=={{header|BML}}==
<lang bml>display "Hello world!"</lang>
<syntaxhighlight lang="bml">display "Hello world!"</syntaxhighlight>


=={{header|Boo}}==
=={{header|Boo}}==
<lang boo>print "Hello world!"</lang>
<syntaxhighlight lang="boo">print "Hello world!"</syntaxhighlight>


=={{header|bootBASIC}}==
=={{header|bootBASIC}}==
<lang bootBASIC>10 print "Hello world!"</lang>
<syntaxhighlight lang="BASIC">10 print "Hello world!"</syntaxhighlight>

=={{header|BQN}}==

Works in: [[CBQN]]

<syntaxhighlight lang="bqn">•Out "Hello world!"</syntaxhighlight>


=={{header|Brace}}==
=={{header|Brace}}==
<lang brace>#!/usr/bin/env bx
<syntaxhighlight lang="brace">#!/usr/bin/env bx
use b
use b
Main:
Main:
say("Hello world!")</lang>
say("Hello world!")</syntaxhighlight>


=={{header|Bracmat}}==
=={{header|Bracmat}}==
<lang bracmat>put$"Hello world!"</lang>
<syntaxhighlight lang="bracmat">put$"Hello world!"</syntaxhighlight>


=={{header|Brainf***}}==
=={{header|Brainf***}}==
Line 518: Line 894:


Commented version:
Commented version:
<lang bf>+++++ +++++ First cell 10 (its a counter and we will be "multiplying")
<syntaxhighlight lang="bf">+++++ +++++ First cell 10 (its a counter and we will be "multiplying")


[
[
Line 576: Line 952:


CRLF
CRLF
< +++ . --- .</lang>
< +++ . --- .</syntaxhighlight>


Uncommented:
Uncommented:
<lang bf>++++++++++[>+>+++>++++>+++++++>++++++++>+++++++++>++
<syntaxhighlight lang="bf">++++++++++[>+>+++>++++>+++++++>++++++++>+++++++++>++
++++++++>+++++++++++>++++++++++++<<<<<<<<<-]>>>>+.>>>
++++++++>+++++++++++>++++++++++++<<<<<<<<<-]>>>>+.>>>
>+..<.<++++++++.>>>+.<<+.<<<<++++.<++.>>>+++++++.>>>.+++.
>+..<.<++++++++.>>>+.<<+.<<<<++++.<++.>>>+++++++.>>>.+++.
<+++++++.--------.<<<<<+.<+++.---.</lang>
<+++++++.--------.<<<<<+.<+++.---.</syntaxhighlight>
It can most likely be optimized, but this is a nice way to show
It can most likely be optimized, but this is a nice way to show
how character printing works in Brainf*** :)
how character printing works in Brainf*** :)


=={{header|Brat}}==
=={{header|Brat}}==
<lang brat>p "Hello world!"</lang>
<syntaxhighlight lang="brat">p "Hello world!"</syntaxhighlight>


=={{header|Brlcad}}==
=={{header|Brlcad}}==
Line 593: Line 969:
The mged utility can output text to the terminal:
The mged utility can output text to the terminal:


<lang brlcad>
<syntaxhighlight lang="brlcad">
echo Hello world!
echo Hello world!
</syntaxhighlight>
</lang>

=={{header|Bruijn}}==

Ignore stdin by not referring to the abstraction:

<syntaxhighlight lang="bruijn">
main ["Hello world!"]
</syntaxhighlight>


=={{header|Burlesque}}==
=={{header|Burlesque}}==


<lang burlesque>
<syntaxhighlight lang="burlesque">
"Hello world!"sh
"Hello world!"sh
</syntaxhighlight>
</lang>


Although please note that ''sh'' actually does not print anything.
Although please note that ''sh'' actually does not print anything.
Line 607: Line 991:
=={{header|C}}==
=={{header|C}}==
{{works with|gcc|4.0.1}}
{{works with|gcc|4.0.1}}
<lang c>#include <stdlib.h>
<syntaxhighlight lang="c">#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>


Line 614: Line 998:
printf("Hello world!\n");
printf("Hello world!\n");
return EXIT_SUCCESS;
return EXIT_SUCCESS;
}</lang>
}</syntaxhighlight>
Or:
Or:
<lang c>#include <stdlib.h>
<syntaxhighlight lang="c">#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>


Line 623: Line 1,007:
puts("Hello world!");
puts("Hello world!");
return EXIT_SUCCESS;
return EXIT_SUCCESS;
}</lang>
}</syntaxhighlight>
Or, the eternal favourite :)
Or, the eternal favourite :)
<syntaxhighlight lang="c">
<lang c>
#include<stdio.h>
#include<stdio.h>


Line 632: Line 1,016:
printf("\nHello world!");
printf("\nHello world!");
return 0;
return 0;
}</lang>
}</syntaxhighlight>


or better yet...
or better yet...
<syntaxhighlight lang="c">
<lang C>
#include<stdio.h>
#include<stdio.h>


Line 642: Line 1,026:
return printf("\nHello World!");
return printf("\nHello World!");
}
}
</syntaxhighlight>
</lang>


=={{header|C sharp|C#}}==
=={{header|C sharp|C#}}==
{{works with|Mono|1.2}}
{{works with|Mono|1.2}}
{{works with|Visual C sharp|Visual C#|2003}}
{{works with|Visual C sharp|Visual C#|2003}}
<lang csharp>namespace HelloWorld
<syntaxhighlight lang="csharp">namespace HelloWorld
{
{
class Program
class Program
Line 656: Line 1,040:
}
}
}
}
}</lang>
}</syntaxhighlight>

{{works with|Visual C sharp|Visual C#|9.0+}}
C# 9.0 allows statements at the top level of a source file (a ''compilation_unit'' in the specification) between any using statements and namespace declarations. These statements become the program entry point and are placed in a method in a compiler-generated type.
<syntaxhighlight lang="csharp">System.Console.WriteLine("Hello world!");</syntaxhighlight>
or
<syntaxhighlight lang="csharp">using System;
Console.WriteLine("Hello world!");</syntaxhighlight>


=={{header|C++}}==
=={{header|C++}}==
<lang cpp>#include <iostream>
<syntaxhighlight lang="cpp">#include <iostream>


int main () {
int main() {
std::cout << "Hello world!" << std::endl;
std::cout << "Hello world!\n";
}</lang>
}</syntaxhighlight>
Since C++23’s addition of the <code><print></code> header and the standard library module <code>std</code> we could now write this:
<syntaxhighlight lang="cpp">import module std; // here does the same thing as #include <print>

int main() {
std::print("Hello world!\n");
}</syntaxhighlight>


=={{header|C++/CLI}}==
=={{header|C++/CLI}}==
<lang cpp>using namespace System;
<syntaxhighlight lang="cpp">using namespace System;
int main()
int main()
{
{
Console::WriteLine("Hello world!");
Console::WriteLine("Hello world!");
}</lang>
}</syntaxhighlight>


=={{header|C1R}}==
=={{header|C1R}}==
<lang C0H>Hello_world/Text</lang>
<syntaxhighlight lang="c0h">Hello_world/Text</syntaxhighlight>
{{out}}
{{out}}
<pre>
<pre>
Line 681: Line 1,078:
Hello world!
Hello world!
</pre>
</pre>

=={{header|C2}}==
<syntaxhighlight lang="c2">module hello_world;
import stdio as io;

func i32 main(i32 argc, char** argv) {
io.printf("Hello World!\n");
return 0;
}</syntaxhighlight>

=={{header|C3}}==
<syntaxhighlight lang="c3">import std::io;

fn void main()
{
io::printn("Hello, World!");
}</syntaxhighlight>

=={{header|Casio BASIC}}==
<syntaxhighlight lang="basic casio">Locate 1,1,"Hello World!"</syntaxhighlight>
or just
<syntaxhighlight lang="basic casio">"Hello World!"</syntaxhighlight>


=={{header|Cat}}==
=={{header|Cat}}==
<lang Cat>"Hello world!" writeln</lang>
<syntaxhighlight lang="cat">"Hello world!" writeln</syntaxhighlight>


=={{header|Cduce}}==
=={{header|Cduce}}==
<lang Cduce>print "Hello world!";;</lang>
<syntaxhighlight lang="cduce">print "Hello world!";;</syntaxhighlight>

=={{header|CFEngine}}==
<syntaxhighlight lang="cfengine3">#!/usr/bin/env cf-agent
# without --no-lock option to cf-agent
# this output will only occur once per minute
# this is by design.
bundle agent main
{
reports:
"Hello world!";
}</syntaxhighlight>

See https://docs.cfengine.com/docs/master/examples.html for a more complete example and introduction.

=={{header|Chapel}}==
<syntaxhighlight lang="chapel">writeln("Hello world!");</syntaxhighlight>


=={{header|Chef}}==
=={{header|Chef}}==
<lang Chef>Goodbye World Souffle.
<syntaxhighlight lang="chef">Goodbye World Souffle.
Ingredients.
Ingredients.
Line 724: Line 1,159:
Pour contents of the mixing bowl into the baking dish.
Pour contents of the mixing bowl into the baking dish.
Serves 1.</lang>
Serves 1.</syntaxhighlight>

=={{header|Chipmunk Basic}}==
<syntaxhighlight lang="qbasic">10 print "Hello world!"</syntaxhighlight>


=={{header|ChucK}}==
=={{header|ChucK}}==
<lang><<< "Hello world!">>>;</lang>
<syntaxhighlight lang="text"><<< "Hello world!">>>;</syntaxhighlight>


=={{header|Cind}}==
=={{header|Cind}}==


<lang cind>
<syntaxhighlight lang="cind">
execute() {
execute() {
host.println("Hello world!");
host.println("Hello world!");
}
}
</syntaxhighlight>
</lang>


=={{header|Clay}}==
=={{header|Clay}}==
<lang clay>main() {
<syntaxhighlight lang="clay">main() {
println("Hello world!");
println("Hello world!");
}</lang>
}</syntaxhighlight>


=={{header|Clean}}==
=={{header|Clean}}==
<lang clean>Start = "Hello world!"</lang>
<syntaxhighlight lang="clean">Start = "Hello world!"</syntaxhighlight>


=={{header|Clio}}==
=={{header|Clio}}==
<lang clio>'hello world!' -> print</lang>
<syntaxhighlight lang="clio">'hello world!' -> print</syntaxhighlight>


=={{header|Clipper}}==
=={{header|Clipper}}==
<lang Clipper>? "Hello world!"</lang>
<syntaxhighlight lang="clipper">? "Hello world!"</syntaxhighlight>


=={{header|CLIPS}}==
=={{header|CLIPS}}==
<lang clips>(printout t "Hello world!" crlf)</lang>
<syntaxhighlight lang="clips">(printout t "Hello world!" crlf)</syntaxhighlight>

=={{header|CLU}}==
<syntaxhighlight lang="clu">start_up = proc ()
po: stream := stream$primary_output()
stream$putl(po, "Hello world!")
end start_up</syntaxhighlight>


=={{header|Clojure}}==
=={{header|Clojure}}==
<lang lisp>(println "Hello world!")</lang>
<syntaxhighlight lang="lisp">(println "Hello world!")</syntaxhighlight>


=={{header|CMake}}==
=={{header|CMake}}==
<lang cmake>message(STATUS "Hello world!")</lang>
<syntaxhighlight lang="cmake">message(STATUS "Hello world!")</syntaxhighlight>


This outputs
This outputs
Line 769: Line 1,213:
{{works with|Dell Enterprise COBOL}}
{{works with|Dell Enterprise COBOL}}


<lang cobol> program-id. hello.
<syntaxhighlight lang="cobol"> program-id. hello.
procedure division.
procedure division.
display "Hello world!".
display "Hello world!".
stop run.</lang>
stop run.</syntaxhighlight>


Using relaxed compilation rules, the hello program can become a single DISPLAY statement.
Using relaxed compilation rules, the hello program can become a single DISPLAY statement.
{{works with|GnuCOBOL}}
{{works with|GnuCOBOL}}


<lang cobol>display"Hello, world".</lang>
<syntaxhighlight lang="cobol">display"Hello, world".</syntaxhighlight>


<pre>prompt$ cobc -x -frelax-syntax -free hello.cob
<pre>prompt$ cobc -x -frelax-syntax -free hello.cob
Line 789: Line 1,233:


=={{header|Cobra}}==
=={{header|Cobra}}==
<lang cobra>class Hello
<syntaxhighlight lang="cobra">class Hello
def main
def main
print 'Hello world!'</lang>
print 'Hello world!'</syntaxhighlight>


=={{header|CoffeeScript}}==
=={{header|CoffeeScript}}==
{{works with|Node.js}}
{{works with|Node.js}}
<lang coffeescript>console.log "Hello world!"</lang>
<syntaxhighlight lang="coffeescript">console.log "Hello world!"</syntaxhighlight>
{{works with|Rhino engine}}
{{works with|Rhino engine}}
<lang coffeescript>print "Hello world!"</lang>
<syntaxhighlight lang="coffeescript">print "Hello world!"</syntaxhighlight>


=={{header|ColdFusion}}==
=={{header|ColdFusion}}==
<lang coldfusion><cfoutput>Hello world!</cfoutput></lang>
<syntaxhighlight lang="coldfusion"><cfoutput>Hello world!</cfoutput></syntaxhighlight>


=={{header|Comal}}==
=={{header|Comal}}==
<lang Comal>PRINT "Hello world!"</lang>
<syntaxhighlight lang="comal">PRINT "Hello world!"</syntaxhighlight>


=={{header|Comefrom0x10}}==
=={{header|Comefrom0x10}}==
<lang cf0x10>'Hello world!'</lang>
<syntaxhighlight lang="cf0x10">'Hello world!'</syntaxhighlight>


<lang cf0x10>"Hello world!"</lang>
<syntaxhighlight lang="cf0x10">"Hello world!"</syntaxhighlight>


=={{header|Commodore BASIC}}==
=={{header|Commodore BASIC}}==
By default some Commodore computers boot into uppercase/graphics mode (C64, C128, VIC-20, Plus 4, etc.) while others (PET, CBM etc.) boot into lowercase/uppercase mode. Therefore, depending on machine used, the CHR$(14) may or may not be required to switch into mixed-case mode.
By default some Commodore computers boot into uppercase/graphics mode (C64, C128, VIC-20, Plus 4, etc.) while others (PET, CBM etc.) boot into lowercase/uppercase mode. Therefore, depending on machine used, the CHR$(14) may or may not be required to switch into mixed-case mode.
<lang GWBasic>10 print chr$(147);chr$(14);:REM 147=clear screen, 14=switch to lowercase mode
<syntaxhighlight lang="gwbasic">10 print chr$(147);chr$(14);:REM 147=clear screen, 14=switch to lowercase mode
20 print "Hello world!"
20 print "Hello world!"
30 end
30 end
</syntaxhighlight>
</lang>


{{Out}}<pre>Hello world!</pre>
{{Out}}<pre>Hello world!</pre>


=={{header|Common Lisp}}==
=={{header|Common Lisp}}==
<lang lisp>(format t "Hello world!~%")</lang>
<syntaxhighlight lang="lisp">(format t "Hello world!~%")</syntaxhighlight>


Or
Or


<lang lisp>(print "Hello world!")</lang>
<syntaxhighlight lang="lisp">(print "Hello world!")</syntaxhighlight>


===Alternate solution===
===Alternate solution===
I use [https://franz.com/downloads/clp/survey Allegro CL 10.1]
I use [https://franz.com/downloads/clp/survey Allegro CL 10.1]


<lang lisp>
<syntaxhighlight lang="lisp">
;; Project : Hello world/Text
;; Project : Hello world/Text


(format t "~a" "Hello world!")
(format t "~a" "Hello world!")
</syntaxhighlight>
</lang>
Output:
Output:
<pre>
<pre>
Line 840: Line 1,284:


=={{header|Component Pascal}}==
=={{header|Component Pascal}}==
<lang oberon2>
<syntaxhighlight lang="oberon2">
MODULE Hello;
MODULE Hello;
IMPORT Out;
IMPORT Out;
Line 848: Line 1,292:
Out.String("Hello world!"); Out.Ln
Out.String("Hello world!"); Out.Ln
END Do;
END Do;
END Hello.</lang>
END Hello.</syntaxhighlight>
Run command ''Hello.Do'' by commander.
Run command ''Hello.Do'' by commander.

=={{header|Coq}}==
<syntaxhighlight lang="coq">
Require Import Coq.Strings.String.

Eval compute in ("Hello world!"%string).
</syntaxhighlight>

=={{header|Corescript}}==
<syntaxhighlight lang="corescript">print Hello world!</syntaxhighlight>

=={{header|Cowgol}}==
<syntaxhighlight lang="cowgol">include "cowgol.coh";
print("Hello world!");
print_nl();</syntaxhighlight>



=={{header|Crack}}==
=={{header|Crack}}==
<lang crack>
<syntaxhighlight lang="crack">
import crack.io cout;
import crack.io cout;
cout `Hello world!\n`;
cout `Hello world!\n`;
</syntaxhighlight>
</lang>

=={{header|Craft Basic}}==
<syntaxhighlight lang="basic">print "Hello world!"</syntaxhighlight>


=={{header|Creative Basic}}==
=={{header|Creative Basic}}==
<syntaxhighlight lang="creative basic">
<lang Creative Basic>
OPENCONSOLE
OPENCONSOLE


Line 872: Line 1,335:


END
END
</syntaxhighlight>
</lang>


=={{header|Crystal}}==
=={{header|Crystal}}==
<lang ruby>puts "Hello world!"</lang>
<syntaxhighlight lang="ruby">puts "Hello world!"</syntaxhighlight>

=={{header|Curto}}==
<syntaxhighlight lang="curto">." Hola, mundo!"</syntaxhighlight>


=={{header|D}}==
=={{header|D}}==
{{works with|D|2.0}}
{{works with|D|2.0}}
<lang D>import std.stdio;
<syntaxhighlight lang="d">import std.stdio;


void main() {
void main() {
writeln("Hello world!");
writeln("Hello world!");
}</lang>
}</syntaxhighlight>


=={{header|Dafny}}==
=={{header|Dafny}}==
<lang dafny>
<syntaxhighlight lang="dafny">
method Main() {
method Main() {
print "hello, world!\n";
print "hello, world!\n";
assert 10 < 2;
assert 10 < 2;
}
}
</syntaxhighlight>
</lang>


=={{header|Dao}}==
=={{header|Dao}}==
<lang dao>io.writeln( 'Hello world!' )</lang>
<syntaxhighlight lang="dao">io.writeln( 'Hello world!' )</syntaxhighlight>


=={{header|Dart}}==
=={{header|Dart}}==
<lang dart>main() {
<syntaxhighlight lang="dart">main() {
var bye = 'Hello world!';
var bye = 'Hello world!';
print("$bye");
print("$bye");
}</lang>
}</syntaxhighlight>


=={{header|DataWeave}}==
=={{header|DataWeave}}==
<lang DataWeave>"Hello world!"</lang>
<syntaxhighlight lang="dataweave">"Hello world!"</syntaxhighlight>

=={{header|DBL}}==
<syntaxhighlight lang="dbl">;
; Hello world for DBL version 4 by Dario B.
;
PROC
;------------------------------------------------------------------
XCALL FLAGS (0007000000,1) ;Suppress STOP message

OPEN (1,O,'TT:')
WRITES (1,"Hello world")

DISPLAY (1,"Hello world",10)
DISPLAY (1,$SCR_MOV(-1,12),"again",10) ;move up, right and print

CLOSE 1
END</syntaxhighlight>


=={{header|Dc}}==
=={{header|Dc}}==
<lang dc>[Hello world!]p</lang>
<syntaxhighlight lang="dc">[Hello world!]p</syntaxhighlight>
...or print a numerically represented string.
...or print a numerically represented string.
<lang dc>5735816763073014741799356604682 P</lang>
<syntaxhighlight lang="dc">5735816763073014741799356604682 P</syntaxhighlight>


=={{header|DCL}}==
=={{header|DCL}}==
<lang DCL>$ write sys$output "Hello world!"</lang>
<syntaxhighlight lang="dcl">$ write sys$output "Hello world!"</syntaxhighlight>


=={{header|DDNC}}==
=={{header|DDNC}}==
Line 923: Line 1,406:
The code can be divided into three sections. The first stores the character numbers in order in an array. The second sets up the loop by loading a delay of 500 milliseconds to slot 3, the start address of the character array in memory to slot 2, and the number of times to loop (14) plus one to slot 5. The third section starts the loop of displaying the characters, waiting for the delay time, incrementing the pointer, decrementing the counter, and checking if the counter is negative to know whether to continue the loop.
The code can be divided into three sections. The first stores the character numbers in order in an array. The second sets up the loop by loading a delay of 500 milliseconds to slot 3, the start address of the character array in memory to slot 2, and the number of times to loop (14) plus one to slot 5. The third section starts the loop of displaying the characters, waiting for the delay time, incrementing the pointer, decrementing the counter, and checking if the counter is negative to know whether to continue the loop.


<lang ddnc>
<syntaxhighlight lang="ddnc">
0 111 10
0 111 10
0 15 11
0 15 11
Line 953: Line 1,436:
61 4
61 4
64
64
</syntaxhighlight>
</lang>


=={{header|Delphi}}==
=={{header|Delphi}}==
<lang delphi>
<syntaxhighlight lang="delphi">
program ProjectGoodbye;
program ProjectGoodbye;
{$APPTYPE CONSOLE}
{$APPTYPE CONSOLE}
Line 962: Line 1,445:
WriteLn('Hello world!');
WriteLn('Hello world!');
end.
end.
</syntaxhighlight>
</lang>


=={{header|DeviousYarn}}==
=={{header|DeviousYarn}}==
<lang deviousyarn>o:"Hello world!</lang>
<syntaxhighlight lang="deviousyarn">o:"Hello world!</syntaxhighlight>


=={{header|DIBOL-11}}==
=={{header|DIBOL-11}}==
<syntaxhighlight lang="dibol-11">
<lang DIBOL-11>
START ;Hello World
START ;Hello World


Line 981: Line 1,464:
END
END


</syntaxhighlight>
</lang>

=={{header|Diego}}==
Once the caller has met the computer and its printer...
<syntaxhighlight lang="diego">with_computer(comp1)_printer(lp1)_text(Hello World!);</syntaxhighlight>
If the caller is the computer...
<syntaxhighlight lang="diego">with_me()_printer(lp1)_text(Hello World!);</syntaxhighlight>
...or can be shortened as...
<syntaxhighlight lang="diego">me()_ptr(lp1)_txt(Hello World!);</syntaxhighlight>
If the computer has more than one printer...
<syntaxhighlight lang="diego">me()_printer()_text(Hello World!);</syntaxhighlight>
If there are more than one computer which have zero or more printers...
<syntaxhighlight lang="diego">with_computer()_printer()_text(Hello World!);</syntaxhighlight>
If there are zero or more printers connected to any thing (device)...
<syntaxhighlight lang="diego">with_printer()_text(Hello World!);</syntaxhighlight>


=={{header|DIV Games Studio}}==
=={{header|DIV Games Studio}}==
<lang div>
<syntaxhighlight lang="div">
PROGRAM HELLOWORLD;
PROGRAM HELLOWORLD;


Line 995: Line 1,492:
END
END


</syntaxhighlight>
</lang>


=={{header|DM}}==
=={{header|DM}}==
<syntaxhighlight lang="dm">
<lang DM>
/client/New()
/client/New()
..()
..()
src << "Hello world!"
src << "Hello world!"
</syntaxhighlight>
</lang>

=={{header|Draco}}==
<syntaxhighlight lang="draco">proc nonrec main() void:
writeln("Hello world!")
corp</syntaxhighlight>


=={{header|Dragon}}==
=={{header|Dragon}}==
<lang dragon>
<syntaxhighlight lang="dragon">
showln "Hello world!"
showln "Hello world!"
</syntaxhighlight>
</lang>

=={{header|DreamBerd}}==
<syntaxhighlight lang="text">
print "Hello world!"!
</syntaxhighlight>

=={{header|dt}}==
<syntaxhighlight lang="dt">"Hello world!" pl</syntaxhighlight>


=={{header|DWScript}}==
=={{header|DWScript}}==
<lang delphi>
<syntaxhighlight lang="delphi">
PrintLn('Hello world!');
PrintLn('Hello world!');
</syntaxhighlight>
</lang>


=={{header|Dyalect}}==
=={{header|Dyalect}}==
<lang Dyalect>print("Hello world!")</lang>
<syntaxhighlight lang="dyalect">print("Hello world!")</syntaxhighlight>


=={{header|Dylan}}==
=={{header|Dylan}}==
<syntaxhighlight lang="dylan">
<lang Dylan>
module: hello-world
module: hello-world


format-out("%s\n", "Hello world!");
format-out("%s\n", "Hello world!");
</syntaxhighlight>
</lang>


=={{header|Dylan.NET}}==
=={{header|Dylan.NET}}==
Line 1,032: Line 1,542:
{{works with|.NET|4.5}}
{{works with|.NET|4.5}}
One Line version:
One Line version:
<lang Dylan.NET>Console::WriteLine("Hello world!")</lang>
<syntaxhighlight lang="dylan.net">Console::WriteLine("Hello world!")</syntaxhighlight>


Hello World Program:
Hello World Program:
<syntaxhighlight lang="dylan.net">
<lang Dylan.NET>
//compile using the new dylan.NET v, 11.5.1.2 or later
//compile using the new dylan.NET v, 11.5.1.2 or later
//use mono to run the compiler
//use mono to run the compiler
Line 1,052: Line 1,562:


end class
end class
</syntaxhighlight>
</lang>


=={{header|Déjà Vu}}==
=={{header|Déjà Vu}}==
<lang dejavu>!print "Hello world!"</lang>
<syntaxhighlight lang="dejavu">!print "Hello world!"</syntaxhighlight>


=={{header|E}}==
=={{header|E}}==
<lang e>println("Hello world!")
<syntaxhighlight lang="e">println("Hello world!")


stdout.println("Hello world!")</lang>
stdout.println("Hello world!")</syntaxhighlight>


=={{header|EasyLang}}==
=={{header|EasyLang}}==


<syntaxhighlight lang="text">
<lang>print "Hello world!"</lang>
print "Hello world!"
</syntaxhighlight>


=={{header|eC}}==
=={{header|eC}}==
<lang ec>class GoodByeApp : Application
<syntaxhighlight lang="ec">class GoodByeApp : Application
{
{
void Main()
void Main()
Line 1,073: Line 1,585:
PrintLn("Hello world!");
PrintLn("Hello world!");
}
}
}</lang>
}</syntaxhighlight>


=={{header|EchoLisp}}==
=={{header|EchoLisp}}==
<lang lisp>
<syntaxhighlight lang="lisp">
(display "Hello world!" "color:blue")
(display "Hello world!" "color:blue")
</syntaxhighlight>
</lang>


=={{header|ECL}}==
=={{header|ECL}}==
<syntaxhighlight lang="ecl">
<lang ECL>
OUTPUT('Hello world!');
OUTPUT('Hello world!');
</syntaxhighlight>
</lang>

=={{header|Ecstasy}}==
<syntaxhighlight lang="java">
module HelloWorld {
void run() {
@Inject Console console;
console.print("Hello, World!");
}
}
</syntaxhighlight>


=={{header|EDSAC order code}}==
=={{header|EDSAC order code}}==
The EDSAC did not support lower-case letters. The method used here is to include a separate <code>O</code> order to print each character: for short messages and labels this is quite adequate. A more general (though slightly more involved) solution for printing strings is given at [[Hello world/Line printer#EDSAC order code]].
The EDSAC did not support lower-case letters. The method used here is to include a separate <code>O</code> order to print each character: for short messages and labels this is quite adequate. A more general (though slightly more involved) solution for printing strings is given at [[Hello world/Line printer#EDSAC order code]].
<lang edsac>[ Print HELLO WORLD ]
<syntaxhighlight lang="edsac">[ Print HELLO WORLD ]
[ A program for the EDSAC ]
[ A program for the EDSAC ]
[ Works with Initial Orders 2 ]
[ Works with Initial Orders 2 ]
Line 1,119: Line 1,641:
DF
DF
EZPF [ Start program beginning at
EZPF [ Start program beginning at
the load point ]</lang>
the load point ]</syntaxhighlight>
{{out}}
{{out}}
<pre>HELLO WORLD</pre>
<pre>HELLO WORLD</pre>
Line 1,126: Line 1,648:
short version (without a function)
short version (without a function)


<lang efene>io.format("Hello world!~n")</lang>
<syntaxhighlight lang="efene">io.format("Hello world!~n")</syntaxhighlight>


complete version (put this in a file and compile it)
complete version (put this in a file and compile it)


<lang efene>@public
<syntaxhighlight lang="efene">@public
run = fn () {
run = fn () {
io.format("Hello world!~n")
io.format("Hello world!~n")
}</lang>
}</syntaxhighlight>


=={{header|Egel}}==
=={{header|Egel}}==
<syntaxhighlight lang="egel">
<lang Egel>
def main = "Hello World!"
def main = "Hello World!"
</syntaxhighlight>
</lang>


=={{header|Egison}}==
=={{header|Egison}}==


<lang egison>
<syntaxhighlight lang="egison">
(define $main
(define $main
(lambda [$argv]
(lambda [$argv]
(write-string "Hello world!\n")))
(write-string "Hello world!\n")))
</syntaxhighlight>
</lang>


=={{header|EGL}}==
=={{header|EGL}}==
{{works with|EDT}}
{{works with|EDT}}
{{works with|RBD}}
{{works with|RBD}}
<syntaxhighlight lang="egl">
<lang EGL>
program HelloWorld
program HelloWorld
function main()
function main()
Line 1,157: Line 1,679:
end
end
end
end
</syntaxhighlight>
</lang>


=={{header|Eiffel}}==
=={{header|Eiffel}}==
{{wikipedia|Eiffel (programming language)}}
{{wikipedia|Eiffel (programming language)}}
<lang eiffel>class
<syntaxhighlight lang="eiffel">class
HELLO_WORLD
HELLO_WORLD
create
create
Line 1,170: Line 1,692:
print ("Hello world!%N")
print ("Hello world!%N")
end
end
end</lang>
end</syntaxhighlight>


=={{header|Ela}}==
=={{header|Ela}}==
<lang ela>open monad io
<syntaxhighlight lang="ela">open monad io
do putStrLn "Hello world!" ::: IO</lang>
do putStrLn "Hello world!" ::: IO</syntaxhighlight>

=={{header|Elan}}==
<syntaxhighlight lang="elan">putline ("Hello, world!");</syntaxhighlight>


=={{header|elastiC}}==
=={{header|elastiC}}==
From the [http://www.elasticworld.org/man/elastic.html elastiC Manual].
From the [http://www.elasticworld.org/man/elastic.html elastiC Manual].


<lang elastic>package hello;
<syntaxhighlight lang="elastic">package hello;


// Import the `basic' package
// Import the `basic' package
Line 1,196: Line 1,721:


// Invoke the `hello' function
// Invoke the `hello' function
hello();</lang>
hello();</syntaxhighlight>


=={{header|Elena}}==
=={{header|Elena}}==
ELENA 4.x:
ELENA 6.x:
<lang elena>public program()
<syntaxhighlight lang="elena">public program()
{
{
console.writeLine:"Hello world!"
console.writeLine("Hello world!")
}</lang>
}</syntaxhighlight>


=={{header|Elisa}}==
=={{header|Elisa}}==
<lang elisa> "Hello world!"? </lang>
<syntaxhighlight lang="elisa"> "Hello world!"? </syntaxhighlight>


=={{header|Elixir}}==
=={{header|Elixir}}==
<lang elixir>
<syntaxhighlight lang="elixir">
IO.puts "Hello world!"
IO.puts "Hello world!"
</syntaxhighlight>
</lang>


=={{header|Elm}}==
=={{header|Elm}}==
<lang haskell>main = text "Goodbye World!"</lang>
<syntaxhighlight lang="haskell">main = text "Goodbye World!"</syntaxhighlight>


=={{header|Emacs Lisp}}==
=={{header|Emacs Lisp}}==

<lang lisp>(insert "Hello world!")</lang>
<syntaxhighlight lang="lisp">(message "Hello world!")</syntaxhighlight>

Alternatively, <code>princ</code> can be used:

<syntaxhighlight lang="lisp">(princ "Hello world!\n")</syntaxhighlight>

=={{header|EMal}}==
<syntaxhighlight lang="emal">writeLine("Hello world!")</syntaxhighlight>


=={{header|Emojicode}}==
=={{header|Emojicode}}==
<lang emojicode>🏁 🍇
<syntaxhighlight lang="emojicode">🏁 🍇
😀 🔤Hello world!🔤
😀 🔤Hello world!🔤
🍉</lang>
🍉</syntaxhighlight>

=={{header|Enguage}}==
This shows "hello world", and shows how Enguage can generate this program on-the-fly.
<pre>
On "say hello world", reply "hello world".

## This can be tested:
#] say hello world: hello world.

## This can also be created within Enguage:
#] to the phrase hello reply hello to you too: ok.
#] hello: hello to you too.
</pre>

Output:
<pre>
TEST: hello
===========

user> say hello world.
enguage> hello world.

user> to the phrase hello reply hello to you too.
enguage> ok.

user> hello.
enguage> hello to you too.
1 test group(s) found
+++ PASSED 3 tests in 53ms +++
</pre>


=={{header|Erlang}}==
=={{header|Erlang}}==
<lang erlang>io:format("Hello world!~n").</lang>
<syntaxhighlight lang="erlang">io:format("Hello world!~n").</syntaxhighlight>


=={{header|ERRE}}==
=={{header|ERRE}}==
<syntaxhighlight lang="erre">
<lang ERRE>
! Hello World in ERRE language
! Hello World in ERRE language
PROGRAM HELLO
PROGRAM HELLO
Line 1,234: Line 1,797:
PRINT("Hello world!")
PRINT("Hello world!")
END PROGRAM
END PROGRAM
</syntaxhighlight>
</lang>


=={{header|Euler Math Toolbox}}==
=={{header|Euler Math Toolbox}}==
Line 1,244: Line 1,807:
=={{header|Extended BrainF***}}==
=={{header|Extended BrainF***}}==


<lang bf>[.>]@Hello world!</lang>
<syntaxhighlight lang="bf">[.>]@Hello world!</syntaxhighlight>


=={{header|Ezhil}}==
=={{header|Ezhil}}==
Line 1,254: Line 1,817:


=={{header|F_Sharp|F#}}==
=={{header|F_Sharp|F#}}==
<lang fsharp>printfn "%s" "Hello world!"</lang>
<syntaxhighlight lang="fsharp">printfn "%s" "Hello world!"</syntaxhighlight>
or using .Net classes directly
or using .Net classes directly
<lang fsharp>System.Console.WriteLine("Hello world!")</lang>
<syntaxhighlight lang="fsharp">System.Console.WriteLine("Hello world!")</syntaxhighlight>


=={{header|Factor}}==
=={{header|Factor}}==
<lang factor>"Hello world!" print</lang>
<syntaxhighlight lang="factor">"Hello world!" print</syntaxhighlight>


=={{header|Falcon}}==
=={{header|Falcon}}==
With the printl() function:
With the printl() function:
<lang falcon>printl("Hello world!")</lang>
<syntaxhighlight lang="falcon">printl("Hello world!")</syntaxhighlight>
Or via "fast print":
Or via "fast print":
<lang falcon>> "Hello world!"</lang>
<syntaxhighlight lang="falcon">> "Hello world!"</syntaxhighlight>


=={{header|FALSE}}==
=={{header|FALSE}}==
<lang false>"Hello world!
<syntaxhighlight lang="false">"Hello world!
"</lang>
"</syntaxhighlight>


=={{header|Fantom}}==
=={{header|Fantom}}==


<lang fantom>
<syntaxhighlight lang="fantom">
class HelloText
class HelloText
{
{
Line 1,281: Line 1,844:
}
}
}
}
</syntaxhighlight>
</lang>

=={{header|Fe}}==
<syntaxhighlight lang="clojure">(print "Hello World")</syntaxhighlight>

=={{header|Fennel}}==
<syntaxhighlight lang="fennel">(print "Hello World")</syntaxhighlight>


=={{header|ferite}}==
=={{header|ferite}}==
word.}}
word.}}
<lang ferite>uses "console";
<syntaxhighlight lang="ferite">uses "console";
Console.println( "Goodby, World!" );</lang>
Console.println( "Goodby, World!" );</syntaxhighlight>

=={{header|Fermat}}==
<syntaxhighlight lang="fermat">!!'Hello, World!';</syntaxhighlight>


=={{header|Fexl}}==
=={{header|Fexl}}==
<lang Fexl>say "Hello world!"</lang>
<syntaxhighlight lang="fexl">say "Hello world!"</syntaxhighlight>

=={{header|Fhidwfe}}==
<syntaxhighlight lang="fhidwfe">puts$ "Hello, world!\n"</syntaxhighlight>


=={{header|Fish}}==
=={{header|Fish}}==
Standard Hello, world example, modified for this task:
Standard Hello, world example, modified for this task:
<lang Fish>!v"Hello world!"r!
<syntaxhighlight lang="fish">!v"Hello world!"r!
>l?!;o</lang>
>l?!;o</syntaxhighlight>
Explanation of the code:<br/>
Explanation of the code:<br/>
<tt>!v"</tt> jumps over the <tt>v</tt> character with the <tt>!</tt> sign, then starts the string mode with <tt>"</tt> .<br/>
<tt>!v"</tt> jumps over the <tt>v</tt> character with the <tt>!</tt> sign, then starts the string mode with <tt>"</tt> .<br/>
Line 1,303: Line 1,878:


=={{header|FOCAL}}==
=={{header|FOCAL}}==
<lang focal>TYPE "Hello, world" !</lang>
<syntaxhighlight lang="focal">TYPE "Hello, world" !</syntaxhighlight>


=={{header|Forth}}==
=={{header|Forth}}==
<lang forth>." Hello world!"</lang>
<syntaxhighlight lang="forth">." Hello world!"</syntaxhighlight>


Or as a whole program:
Or as a whole program:


<lang forth>: goodbye ( -- ) ." Hello world!" CR ;</lang>
<syntaxhighlight lang="forth">: goodbye ( -- ) ." Hello world!" CR ;</syntaxhighlight>


=={{header|Fortran}}==
=={{header|Fortran}}==
Line 1,316: Line 1,891:
Simplest case - display using default formatting:
Simplest case - display using default formatting:


<lang fortran>print *,"Hello world!"</lang>
<syntaxhighlight lang="fortran">print *,"Hello world!"</syntaxhighlight>


Use explicit output format:
Use explicit output format:


<lang fortran>100 format (5X,A,"!")
<syntaxhighlight lang="fortran">100 format (5X,A,"!")
print 100,"Hello world!"</lang>
print 100,"Hello world!"</syntaxhighlight>


Output to channels other than stdout goes like this:
Output to channels other than stdout goes like this:


<lang fortran>write (89,100) "Hello world!"</lang>
<syntaxhighlight lang="fortran">write (89,100) "Hello world!"</syntaxhighlight>


uses the format given at label 100 to output to unit 89. If output unit with this number exists yet (no "<tt>OPEN</tt>" statement or processor-specific external unit setting), a new file will be created and the output sent there. On most UNIX/Linux systems that file will be named "<tt>fort.89</tt>".
uses the format given at label 100 to output to unit 89. If output unit with this number exists yet (no "<tt>OPEN</tt>" statement or processor-specific external unit setting), a new file will be created and the output sent there. On most UNIX/Linux systems that file will be named "<tt>fort.89</tt>".
Line 1,331: Line 1,906:


=={{header|Fortress}}==
=={{header|Fortress}}==
<lang fortress>export Executable
<syntaxhighlight lang="fortress">export Executable
run() = println("Hello world!")</lang>
run() = println("Hello world!")</syntaxhighlight>


=={{header|FreeBASIC}}==
=={{header|FreeBASIC}}==
<lang FreeBASIC>? "Hello world!"
<syntaxhighlight lang="freebasic">? "Hello world!"
sleep</lang>
sleep</syntaxhighlight>


=={{header|Free Pascal}}==
<syntaxhighlight lang="pascal">
PROGRAM HelloWorld ;

{$APPTYPE CONSOLE}

(*)

https://www.freepascal.org/advantage.var

(*)

USES

crt;

BEGIN

WriteLn ( 'Hello world!' ) ;

END.
</syntaxhighlight>


=={{header|Frege}}==
=={{header|Frege}}==
Line 1,343: Line 1,942:
{{Works with|Frege|3.20.113}}
{{Works with|Frege|3.20.113}}


<lang frege>module HelloWorld where
<syntaxhighlight lang="frege">module HelloWorld where
main _ = println "Hello world!"</lang>
main _ = println "Hello world!"</syntaxhighlight>


=={{header|friendly interactive shell}}==
=={{header|friendly interactive shell}}==
Unlike other [[UNIX shell]] languages, fish doesn't support history substitution, so <code>!</code> is safe to use without quoting.
Unlike other [[UNIX shell]] languages, fish doesn't support history substitution, so <code>!</code> is safe to use without quoting.
<lang fishshell>echo Hello world!</lang>
<syntaxhighlight lang="fishshell">echo Hello world!</syntaxhighlight>


=={{header|Frink}}==
=={{header|Frink}}==
<lang frink>
<syntaxhighlight lang="frink">
println["Hello world!"]
println["Hello world!"]
</syntaxhighlight>
</lang>

=={{header|FTCBASIC}}==
<syntaxhighlight lang="basic">print "Hello, world!"
pause
end</syntaxhighlight>


=={{header|FunL}}==
=={{header|FunL}}==
<lang funl>println( 'Hello world!' )</lang>
<syntaxhighlight lang="funl">println( 'Hello world!' )</syntaxhighlight>


=={{header|Furor}}==
<syntaxhighlight lang="furor">."Hello, World!\n"</syntaxhighlight>

=={{header|Peri}}==
<syntaxhighlight lang="peri">
."Hello, World!\n"
</syntaxhighlight>

=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">window 1
print @"Hello world!"

HandleEvents</syntaxhighlight>


=={{header|FUZE BASIC}}==
=={{header|FUZE BASIC}}==
<lang qbasic>PRINT "Hello world!"</lang>
<syntaxhighlight lang="qbasic">PRINT "Hello world!"</syntaxhighlight>


=={{header|Gambas}}==
=={{header|Gambas}}==
'''[https://gambas-playground.proko.eu/?gist=d3a51f670e4eb0f793b513b14329be51 Click this link to run this code]'''
'''[https://gambas-playground.proko.eu/?gist=d3a51f670e4eb0f793b513b14329be51 Click this link to run this code]'''
<lang gambas>Public Sub Main()
<syntaxhighlight lang="gambas">Public Sub Main()


PRINT "Hello world!"
PRINT "Hello world!"
End</lang>
End</syntaxhighlight>


=={{header|GAP}}==
=={{header|GAP}}==
<lang gap># Several ways to do it
<syntaxhighlight lang="gap"># Several ways to do it
"Hello world!";
"Hello world!";


Line 1,379: Line 1,998:
f := OutputTextUser();
f := OutputTextUser();
WriteLine(f, "Hello world!\n");
WriteLine(f, "Hello world!\n");
CloseStream(f);</lang>
CloseStream(f);</syntaxhighlight>


=={{header|GB BASIC}}==
=={{header|GB BASIC}}==
<lang GB BASIC>10 print "Hello world!"</lang>
<syntaxhighlight lang="gb basic">10 print "Hello world!"</syntaxhighlight>


=={{header|gecho}}==
=={{header|gecho}}==
<lang gecho>'Hello, <> 'World! print</lang>
<syntaxhighlight lang="gecho">'Hello, <> 'World! print</syntaxhighlight>


=={{header|Gema}}==
=={{header|Gema}}==
Line 1,391: Line 2,010:
This code will write "Hello world!' no matter what input is given.
This code will write "Hello world!' no matter what input is given.


<lang gema>*= ! ignore off content of input
<syntaxhighlight lang="gema">*= ! ignore off content of input
\B=Hello world!\! ! Start output with this text.</lang>
\B=Hello world!\! ! Start output with this text.</syntaxhighlight>


=={{header|Genie}}==
=={{header|Genie}}==
<syntaxhighlight lang="genie">
<lang Genie>
init
init
print "Hello world!"
print "Hello world!"
</syntaxhighlight>
</lang>


=={{header|Gentee}}==
=={{header|Gentee}}==
<lang gentee>func hello <main>
<syntaxhighlight lang="gentee">func hello <main>
{
{
print("Hello world!")
print("Hello world!")
}</lang>
}</syntaxhighlight>


=={{header|GFA Basic}}==
=={{header|GFA Basic}}==
<lang gfabasic>PRINT "Hello World"</lang>
<syntaxhighlight lang="gfabasic">PRINT "Hello World"</syntaxhighlight>


=={{header|GLBasic}}==
=={{header|GLBasic}}==
<lang GLBasic>STDOUT "Hello world!"</lang>
<syntaxhighlight lang="glbasic">STDOUT "Hello world!"</syntaxhighlight>

=={{header|Gleam}}==
<syntaxhighlight lang="gleam">
import gleam/io

pub fn main() {
io.println("Hello world!")
}
</syntaxhighlight>


=={{header|Glee}}==
=={{header|Glee}}==
<lang glee>"Hello world!"</lang>
<syntaxhighlight lang="glee">"Hello world!"</syntaxhighlight>


or
or


<lang glee>'Hello world!'</lang>
<syntaxhighlight lang="glee">'Hello world!'</syntaxhighlight>


or to display with double quotes
or to display with double quotes


<lang glee> '"Goodbye,World!"'</lang>
<syntaxhighlight lang="glee"> '"Goodbye,World!"'</syntaxhighlight>


or to display with single quotes
or to display with single quotes


<lang glee> "'Goodbye,World!'"</lang>
<syntaxhighlight lang="glee"> "'Goodbye,World!'"</syntaxhighlight>


=={{header|Global Script}}==
=={{header|Global Script}}==


This uses the <code>gsio</code> I/O operations, which are designed to be simple to implement on top of Haskell and simple to use.
This uses the <code>gsio</code> I/O operations, which are designed to be simple to implement on top of Haskell and simple to use.
<lang Global Script>λ _. print qq{Hello world!\n}</lang>
<syntaxhighlight lang="global script">λ _. print qq{Hello world!\n}</syntaxhighlight>


=={{header|GlovePIE}}==
=={{header|GlovePIE}}==
<lang glovepie>debug="Hello world!"</lang>
<syntaxhighlight lang="glovepie">debug="Hello world!"</syntaxhighlight>


=={{header|GML}}==
=={{header|GML}}==
<lang C>show_message("Hello world!"); // displays a pop-up message
<syntaxhighlight lang="c">show_message("Hello world!"); // displays a pop-up message
show_debug_message("Hello world!"); // sends text to the debug log or IDE</lang>
show_debug_message("Hello world!"); // sends text to the debug log or IDE</syntaxhighlight>


=={{header|Go}}==
=={{header|Go}}==


<lang go>package main
<syntaxhighlight lang="go">package main


import "fmt"
import "fmt"


func main() { fmt.Println("Hello world!") }</lang>
func main() { fmt.Println("Hello world!") }</syntaxhighlight>


=={{header|Golfscript}}==
=={{header|Golfscript}}==
<lang golfscript>"Hello world!"</lang>
<syntaxhighlight lang="golfscript">"Hello world!"</syntaxhighlight>


=={{header|Gosu}}==
=={{header|Gosu}}==
<lang gosu>print("Hello world!")</lang>
<syntaxhighlight lang="gosu">print("Hello world!")</syntaxhighlight>

=={{header|Grain}}==
<syntaxhighlight lang="grain">print("Hello world!")</syntaxhighlight>


=={{header|Groovy}}==
=={{header|Groovy}}==
<lang groovy>println "Hello world!"</lang>
<syntaxhighlight lang="groovy">println "Hello world!"</syntaxhighlight>


=={{header|GW-BASIC}}==
=={{header|GW-BASIC}}==
<lang qbasic>10 PRINT "Hello world!"</lang>
<syntaxhighlight lang="qbasic">10 PRINT "Hello world!"</syntaxhighlight>


=={{header|Hack}}==
=={{header|Hack}}==
<lang hack><?hh echo 'Hello world!'; ?></lang>
<syntaxhighlight lang="hack"><?hh echo 'Hello world!'; ?></syntaxhighlight>


=={{header|Halon}}==
=={{header|Halon}}==
If the code in run in the REPL the output will be to stdout otherwise syslog LOG_DEBUG will be used.
If the code in run in the REPL the output will be to stdout otherwise syslog LOG_DEBUG will be used.


<lang halon>echo "Hello world!";</lang>
<syntaxhighlight lang="halon">echo "Hello world!";</syntaxhighlight>


=={{header|Harbour}}==
=={{header|Harbour}}==
<lang visualfoxpro>? "Hello world!"</lang>
<syntaxhighlight lang="visualfoxpro">? "Hello world!"</syntaxhighlight>

=={{header|Hare}}==
<syntaxhighlight lang="hare">use fmt;

export fn main() void = {
fmt::println("Hello, world!")!;
};</syntaxhighlight>


=={{header|Haskell}}==
=={{header|Haskell}}==
<lang haskell>
<syntaxhighlight lang="haskell">
main = putStrLn "Hello world!"
main = putStrLn "Hello world!"
</syntaxhighlight>
</lang>


=={{header|Haxe}}==
=={{header|Haxe}}==
<lang ActionScript>trace("Hello world!");</lang>
<syntaxhighlight lang="actionscript">trace("Hello world!");</syntaxhighlight>


=={{header|hexiscript}}==
=={{header|hexiscript}}==
<lang hexiscript>println "Hello world!"</lang>
<syntaxhighlight lang="hexiscript">println "Hello world!"</syntaxhighlight>


=={{header|HicEst}}==
=={{header|HicEst}}==
<lang hicest>WRITE() 'Hello world!'</lang>
<syntaxhighlight lang="hicest">WRITE() 'Hello world!'</syntaxhighlight>


=={{header|HLA}}==
=={{header|HLA}}==
<lang HLA>program goodbyeWorld;
<syntaxhighlight lang="hla">program goodbyeWorld;
#include("stdlib.hhf")
#include("stdlib.hhf")
begin goodbyeWorld;
begin goodbyeWorld;
Line 1,491: Line 2,129:
stdout.put( "Hello world!" nl );
stdout.put( "Hello world!" nl );


end goodbyeWorld;</lang>
end goodbyeWorld;</syntaxhighlight>


=={{header|HolyC}}==
=={{header|HolyC}}==
<lang holyc>"Hello world!\n";</lang>
<syntaxhighlight lang="holyc">"Hello world!\n";</syntaxhighlight>


=={{header|Hoon}}==
=={{header|Hoon}}==
<lang Hoon>~& "Hello world!" ~</lang>
<syntaxhighlight lang="hoon">~& "Hello world!" ~</syntaxhighlight>

=={{header|Hopper}}==
<syntaxhighlight lang="csharp">program Hello
{
uses "/Source/Library/Boards/PiPico"
Hopper()
{
WriteLn("Hello world!");
loop
{
LED = !LED;
Delay(500);
}
}
}</syntaxhighlight>

{{out}}
In IDE, build hello.hs into hello.hexe, (press F7) and start debug (F5) or hm console monitor.
<pre>!> hello
Hello world!
</pre>
The language and runtime install verification message shows up on the monitor console. In keeping with most MCU introductions, the onboard Light Emitting Diode (LED) will then blink on and off at 1/2 second intervals, forever; ''(until power runs out, or explicit operator intervention)''.


=={{header|HPPPL}}==
=={{header|HPPPL}}==
<lang HPPPL>PRINT("Hello world!");</lang>
<syntaxhighlight lang="hpppl">PRINT("Hello world!");</syntaxhighlight>


=={{header|HQ9+}}==
=={{header|HQ9+}}==
{{incorrect|HQ9+|output isn't consistent with the task's requirements (and is probably incapable of solving the task).}}
{{incorrect|HQ9+|output isn't consistent with the task's requirements (and is probably incapable of solving the task).}}
<lang hq9plus>H</lang>
<syntaxhighlight lang="hq9plus">H</syntaxhighlight>
*Technically, HQ9+ can't print "Hello world!" text because of its specification.
*Technically, HQ9+ can't print "Hello world!" text because of its specification.
- H : Print 'Hello World!'<br>
- H : Print 'Hello World!'<br>
Line 1,512: Line 2,173:


=={{header|Huginn}}==
=={{header|Huginn}}==
<lang huginn>#! /bin/sh
<syntaxhighlight lang="huginn">#! /bin/sh
exec huginn --no-argv -E "${0}" "${@}"
exec huginn --no-argv -E "${0}" "${@}"
#! huginn
#! huginn
Line 1,519: Line 2,180:
print( "Hello World!\n" );
print( "Hello World!\n" );
return ( 0 );
return ( 0 );
}</lang>
}</syntaxhighlight>
=={{header|HTML5}}==
<syntaxhighlight lang="html5">
<!DOCTYPE html>
<html>
<body>
<h1>Hello world!</h1>
</body>
</html>
</syntaxhighlight>


=={{header|Hy}}==
=={{header|Hy}}==
<lang clojure>(print "Hello world!")</lang>
<syntaxhighlight lang="clojure">(print "Hello world!")</syntaxhighlight>


=={{header|i}}==
=={{header|i}}==
<lang i>software {
<syntaxhighlight lang="i">software {
print("Hello world!")
print("Hello world!")
}</lang>
}</syntaxhighlight>


=={{header|Icon}} and {{header|Unicon}}==
=={{header|Icon}} and {{header|Unicon}}==
<lang icon>procedure main()
<syntaxhighlight lang="icon">procedure main()
write( "Hello world!" )
write( "Hello world!" )
end</lang>
end</syntaxhighlight>


=={{header|IDL}}==
=={{header|IDL}}==
<lang idl>print,'Hello world!'</lang>
<syntaxhighlight lang="idl">print,'Hello world!'</syntaxhighlight>

=={{header|Idris}}==
<syntaxhighlight lang="idris">module Main

main : IO ()
main = putStrLn "Hello world!"</syntaxhighlight>


=={{header|Inform 6}}==
=={{header|Inform 6}}==
<lang Inform 6>[Main;
<syntaxhighlight lang="inform 6">[Main;
print "Hello world!^";
print "Hello world!^";
];</lang>
];</syntaxhighlight>

=={{header|Inko}}==
<syntaxhighlight lang="inko">import std::stdio::stdout

stdout.print('Hello, world!')</syntaxhighlight>

=={{header|Insitux}}==
<syntaxhighlight lang="insitux">(print "Hello, world!")</syntaxhighlight>

=={{header|Intercal}}==
<syntaxhighlight lang="intercal">DO ,1 <- #13
PLEASE DO ,1 SUB #1 <- #238
DO ,1 SUB #2 <- #108
DO ,1 SUB #3 <- #112
DO ,1 SUB #4 <- #0
DO ,1 SUB #5 <- #64
DO ,1 SUB #6 <- #194
PLEASE DO ,1 SUB #7 <- #48
DO ,1 SUB #8 <- #26
DO ,1 SUB #9 <- #244
PLEASE DO ,1 SUB #10 <- #168
DO ,1 SUB #11 <- #24
DO ,1 SUB #12 <- #16
DO ,1 SUB #13 <- #162
PLEASE READ OUT ,1
PLEASE GIVE UP</syntaxhighlight>



=={{header|Integer BASIC}}==
=={{header|Integer BASIC}}==
NOTE: Integer BASIC was written (and hand-assembled by Woz himself) for the Apple 1 and original Apple 2. The Apple 1 has NO support for lower-case letters, and it was an expensive (and later) option on the Apple 2. This example accurately represents the only reasonable solution for those target devices, and therefore cannot be "fixed", only deleted.
NOTE: Integer BASIC was written (and hand-assembled by Woz himself) for the Apple 1 and original Apple 2. The Apple 1 has NO support for lower-case letters, and it was an expensive (and later) option on the Apple 2. This example accurately represents the only reasonable solution for those target devices, and therefore cannot be "fixed", only deleted.


<lang Integer BASIC> 10 PRINT "Hello world!"
<syntaxhighlight lang="integer basic"> 10 PRINT "Hello world!"
20 END</lang>
20 END</syntaxhighlight>


=={{header|Io}}==
=={{header|Io}}==
<lang Io>"Hello world!" println</lang>
<syntaxhighlight lang="io">"Hello world!" println</syntaxhighlight>


=={{header|Ioke}}==
=={{header|Ioke}}==
<lang ioke>"Hello world!" println</lang>
<syntaxhighlight lang="ioke">"Hello world!" println</syntaxhighlight>


=={{header|IS-BASIC}}==
=={{header|IS-BASIC}}==
<lang IS-BASIC>PRINT "Hello world!"</lang>
<syntaxhighlight lang="is-basic">PRINT "Hello world!"</syntaxhighlight>

=={{header|Isabelle}}==
<syntaxhighlight lang="isabelle">theory Scratch
imports Main
begin
value ‹''Hello world!''›
end</syntaxhighlight>


=={{header|IWBASIC}}==
=={{header|IWBASIC}}==
<syntaxhighlight lang="iwbasic">
<lang IWBASIC>
OPENCONSOLE
OPENCONSOLE


Line 1,572: Line 2,282:


END
END
</syntaxhighlight>
</lang>


=={{header|J}}==
=={{header|J}}==
<lang j> 'Hello world!'
<syntaxhighlight lang="j"> 'Hello world!'
Hello world!</lang>
Hello world!</syntaxhighlight>


Here are some redundant alternatives:
Here are some redundant alternatives:
<lang J> [data=. 'Hello world!'
<syntaxhighlight lang="j"> [data=. 'Hello world!'
Hello world!
Hello world!
data
data
Line 1,614: Line 2,324:
Hello world!
Hello world!
Hello world!
Hello world!
</syntaxhighlight>
</lang>


=={{header|Jack}}==
=={{header|Jack}}==
<lang jack>class Main {
<syntaxhighlight lang="jack">class Main {
function void main () {
function void main () {
do Output.printString("Hello world!");
do Output.printString("Hello world!");
Line 1,623: Line 2,333:
return;
return;
}
}
}</lang>
}</syntaxhighlight>


=={{header|Jacquard Loom}}==
=={{header|Jacquard Loom}}==
This weaves the string "Hello world!"
This weaves the string "Hello world!"
<lang jacquard>+---------------+
<syntaxhighlight lang="jacquard">+---------------+
| |
| |
| * * |
| * * |
Line 1,713: Line 2,423:
| |
| |
| |
| |
+---------------+</lang>
+---------------+</syntaxhighlight>

=={{header|Jai}}==
<syntaxhighlight lang="jai">
#import "Basic";

main :: () {
print("Hello, World!\n");
}
</syntaxhighlight>

=={{header|Jakt}}==
<syntaxhighlight lang="jakt">
fn main() {
println("Hello world!")
}
</syntaxhighlight>

=={{header|Janet}}==
<syntaxhighlight lang="janet">(print "Hello world!")</syntaxhighlight>


=={{header|Java}}==
=={{header|Java}}==
<lang java>public class HelloWorld
<syntaxhighlight lang="java">public class HelloWorld
{
{
public static void main(String[] args)
public static void main(String[] args)
Line 1,722: Line 2,451:
System.out.println("Hello world!");
System.out.println("Hello world!");
}
}
}</lang>
}</syntaxhighlight>


=={{header|JavaScript}}==
=={{header|JavaScript}}==
<lang javascript>document.write("Hello world!");</lang>
<syntaxhighlight lang="javascript">document.write("Hello world!");</syntaxhighlight>


{{works with|NJS|0.2.5}}
{{works with|NJS|0.2.5}}
{{works with|Rhino}}
{{works with|Rhino}}
{{works with|SpiderMonkey}}
{{works with|SpiderMonkey}}
<lang javascript>print('Hello world!');</lang>
<syntaxhighlight lang="javascript">print('Hello world!');</syntaxhighlight>


{{works with|JScript}}
{{works with|JScript}}
<lang javascript>WScript.Echo("Hello world!");</lang>
<syntaxhighlight lang="javascript">WScript.Echo("Hello world!");</syntaxhighlight>


{{works with|Node.js}}
{{works with|Node.js}}
<lang javascript>console.log("Hello world!")</lang>
<syntaxhighlight lang="javascript">console.log("Hello world!")</syntaxhighlight>


=={{header|JCL}}==
=={{header|JCL}}==
<lang JCL>/*MESSAGE Hello world!</lang>
<syntaxhighlight lang="jcl">/*MESSAGE Hello world!</syntaxhighlight>

=={{header|Jinja}}==
<syntaxhighlight lang="jinja">
from jinja2 import Template
print(Template("Hello World!").render())
</syntaxhighlight>
A bit more convoluted, really using a template:
<syntaxhighlight lang="jinja">
from jinja2 import Template
print(Template("Hello {{ something }}!").render(something="World"))
</syntaxhighlight>


=={{header|Joy}}==
=={{header|Joy}}==
<lang joy>"Hello world!" putchars.</lang>
<syntaxhighlight lang="joy">"Hello world!\n" putchars.</syntaxhighlight>


=={{header|jq}}==
=={{header|jq}}==
<lang jq>"Hello world!"</lang>
<syntaxhighlight lang="jq">"Hello world!"</syntaxhighlight>

=={{header|JSE}}==
<syntaxhighlight lang="jse">Print "Hello world!"</syntaxhighlight>


=={{header|Jsish}}==
=={{header|Jsish}}==
<lang javascript>puts("Hello world!")</lang>
<syntaxhighlight lang="javascript">puts("Hello world!")</syntaxhighlight>


=={{header|Julia}}==
=={{header|Julia}}==
<lang Julia>println("Hello world!")</lang>
<syntaxhighlight lang="julia">println("Hello world!")</syntaxhighlight>


=={{header|K}}==
=={{header|K}}==
<syntaxhighlight lang="k">
<lang K>
"Hello world!"
"Hello world!"
</syntaxhighlight>
</lang>
Some of the other ways this task can be attached are:
Some of the other ways this task can be attached are:
<syntaxhighlight lang="k">
<lang K>
`0: "Hello world!\n"
`0: "Hello world!\n"
</syntaxhighlight>
</lang>
<syntaxhighlight lang="k">
<lang K>
s: "Hello world!"
s: "Hello world!"
s
s
</syntaxhighlight>
</lang>
<syntaxhighlight lang="k">
<lang K>
\echo "Hello world!"
\echo "Hello world!"
</syntaxhighlight>
</lang>


=={{header|Kabap}}==
=={{header|Kabap}}==
<lang Kabap>return = "Hello world!";</lang>
<syntaxhighlight lang="kabap">return = "Hello world!";</syntaxhighlight>


=={{header|Kaya}}==
=={{header|Kaya}}==
<lang kaya>program hello;
<syntaxhighlight lang="kaya">program hello;
Void main() {
Void main() {
// My first program!
// My first program!
putStrLn("Hello world!");
putStrLn("Hello world!");
}</lang>
}</syntaxhighlight>


=={{header|Kdf9 Usercode}}==
=={{header|Kdf9 Usercode}}==
{{incorrect|Kdf9|output isn't consistent with the task's requirements: wording, punctuation.}}
{{incorrect|Kdf9|output isn't consistent with the task's requirements: wording, punctuation.}}
<lang joy>
<syntaxhighlight lang="joy">


V2; W0;
V2; W0;
Line 1,793: Line 2,536:
999; OUT;
999; OUT;
FINISH;
FINISH;
</syntaxhighlight>
</lang>


=={{header|Keg}}==
=={{header|Keg}}==
<lang keg>Hello world\!</lang>
<syntaxhighlight lang="keg">Hello world\!</syntaxhighlight>


=={{header|Kite}}==
=={{header|Kite}}==
simply a single line
simply a single line
<lang Kite>"#!/usr/local/bin/kite
<syntaxhighlight lang="kite">"#!/usr/local/bin/kite


"Hello world!"|print;</lang>
"Hello world!"|print;</syntaxhighlight>


=={{header|Kitten}}==
=={{header|Kitten}}==


<lang Kitten>"Hello world!" say</lang>
<syntaxhighlight lang="kitten">"Hello world!" say</syntaxhighlight>

=={{header|KL1}}==
<syntaxhighlight lang="prolog>
:- module main.

main :-
unix:unix([stdio(normal(S))]),
S = [fwrite("Hello world\n")].
</syntaxhighlight>

=={{header|Koka}}==
<syntaxhighlight lang="koka">fun main() {
println("Hello world!")
}</syntaxhighlight>

Alternatively:

- indentation instead of braces

- uniform function call syntax

- omitted parentheses for function calls with no parameters

<syntaxhighlight lang="koka">fun main()
"Hello world!".println
</syntaxhighlight>


=={{header|KonsolScript}}==
=={{header|KonsolScript}}==
Displays it in a text file or console/terminal.
Displays it in a text file or console/terminal.
<lang KonsolScript>function main() {
<syntaxhighlight lang="konsolscript">function main() {
Konsol:Log("Hello world!")
Konsol:Log("Hello world!")
}</lang>
}</syntaxhighlight>


=={{header|Kotlin}}==
=={{header|Kotlin}}==
<lang Kotlin>fun main() {
<syntaxhighlight lang="kotlin">fun main() {
println("Hello world!")
println("Hello world!")
}</lang>
}</syntaxhighlight>


=={{header|KQL}}==
=={{header|KQL}}==


<lang KQL>print 'Hello world!'</lang>
<syntaxhighlight lang="kql">print 'Hello world!'</syntaxhighlight>

=={{header|KSI}}==

<syntaxhighlight lang="ksi">
`plain
'Hello world!' #echo #
</syntaxhighlight>


=={{header|Lambdatalk}}==
=={{header|Lambdatalk}}==
<lang scheme>
<syntaxhighlight lang="scheme">
Hello world!
Hello world!
{h1 Hello world!}
{h1 Hello world!}
_h1 Hello world!\n
_h1 Hello world!\n
</syntaxhighlight>
</lang>

=={{header|Lang}}==
<syntaxhighlight lang="lang">fn.println(Hello world!)</syntaxhighlight>


=={{header|Lang5}}==
=={{header|Lang5}}==
<lang Lang5>"Hello world!\n" .</lang>
<syntaxhighlight lang="lang5">"Hello world!\n" .</syntaxhighlight>


=={{header|langur}}==
=={{header|langur}}==
<lang langur>writeln "yo, peeps"</lang>
<syntaxhighlight lang="langur">writeln "Hello"</syntaxhighlight>


=={{header|Lasso}}==
=={{header|Lasso}}==
A plain string is output automatically.
A plain string is output automatically.
<lang Lasso>'Hello world!'</lang>
<syntaxhighlight lang="lasso">'Hello world!'</syntaxhighlight>


=={{header|LaTeX}}==
=={{header|LaTeX}}==
<syntaxhighlight lang="latex">\documentclass{minimal}
<lang LaTeX>
\documentclass{scrartcl}

\begin{document}
\begin{document}
Hello World!
Hello World!
\end{document}
\end{document}</syntaxhighlight>
</lang>


=={{header|Latitude}}==
=={{header|Latitude}}==
<lang Latitude>putln "Hello world!".</lang>
<syntaxhighlight lang="latitude">putln "Hello world!".</syntaxhighlight>


=={{header|LC3 Assembly}}==
=={{header|LC3 Assembly}}==


<lang lc3asm>.orig x3000
<syntaxhighlight lang="lc3asm">.orig x3000
LEA R0, hello ; R0 = &hello
LEA R0, hello ; R0 = &hello
TRAP x22 ; PUTS (print char array at addr in R0)
TRAP x22 ; PUTS (print char array at addr in R0)
HALT
HALT
hello .stringz "Hello World!"
hello .stringz "Hello World!"
.end</lang>
.end</syntaxhighlight>
Or (without PUTS)
Or (without PUTS)
<lang lc3asm>.orig x3000
<syntaxhighlight lang="lc3asm">.orig x3000
LEA R1, hello ; R1 = &hello
LEA R1, hello ; R1 = &hello
TOP LDR R0, R1, #0 ; R0 = R1[0]
TOP LDR R0, R1, #0 ; R0 = R1[0]
Line 1,870: Line 2,646:
END HALT
END HALT
hello .stringz "Hello World!"
hello .stringz "Hello World!"
.end</lang>
.end</syntaxhighlight>


=={{header|LDPL}}==
=={{header|LDPL}}==
<syntaxhighlight lang="ldpl">
<lang LDPL>
procedure:
procedure:
display "Hello World!" crlf
display "Hello World!" crlf
</syntaxhighlight>
</lang>

=={{header|Lean}}==
<syntaxhighlight lang="lean">
#eval "Hello world!"
</syntaxhighlight>

Slightly longer version:
<syntaxhighlight lang="lean">
def main : IO Unit :=
IO.println ("Hello world!")

#eval main
</syntaxhighlight>


=={{header|LFE}}==
=={{header|LFE}}==
<lang lisp>
<syntaxhighlight lang="lisp">
(: io format '"Hello world!~n")
(: io format '"Hello world!~n")
</syntaxhighlight>
</lang>


=={{header|Liberty BASIC}}==
=={{header|Liberty BASIC}}==
<lang lb>print "Hello world!"</lang>
<syntaxhighlight lang="lb">print "Hello world!"</syntaxhighlight>


=={{header|LIL}}==
=={{header|LIL}}==
<lang tcl>#
<syntaxhighlight lang="tcl">#
# Hello world in lil
# Hello world in lil
#
#


print "Hello, world!"</lang>
print "Hello, world!"</syntaxhighlight>


=={{header|Lily}}==
=={{header|Lily}}==
There are two ways to do this. First, with the builtin print:
There are two ways to do this. First, with the builtin print:


<lang lily>print("Hello world!")</lang>
<syntaxhighlight lang="lily">print("Hello world!")</syntaxhighlight>


Second, by using stdout directly:
Second, by using stdout directly:


<lang lily>stdout.print("Hello world!\n")</lang>
<syntaxhighlight lang="lily">stdout.print("Hello world!\n")</syntaxhighlight>


=={{header|Lilypond}}==
=={{header|Lilypond}}==
<lang lilypond>\version "2.18.2"
<syntaxhighlight lang="lilypond">\version "2.18.2"
global = {
global = {
\time 4/4
\time 4/4
Line 1,913: Line 2,702:
\addlyrics {
\addlyrics {
Hel -- lo, World!
Hel -- lo, World!
}</lang>
}</syntaxhighlight>


=={{header|Limbo}}==
=={{header|Limbo}}==
<lang limbo>implement Command;
<syntaxhighlight lang="limbo">implement Command;
include "sys.m";
include "sys.m";
Line 1,929: Line 2,718:
sys = load Sys Sys->PATH;
sys = load Sys Sys->PATH;
sys->print("Hello world!\n");
sys->print("Hello world!\n");
}</lang>
}</syntaxhighlight>


=={{header|Lingo}}==
=={{header|Lingo}}==
<lang lingo>put "Hello world!"</lang>
<syntaxhighlight lang="lingo">put "Hello world!"</syntaxhighlight>


or:
or:


<lang lingo>trace("Hello world!")</lang>
<syntaxhighlight lang="lingo">trace("Hello world!")</syntaxhighlight>


=={{header|Lisaac}}==
=={{header|Lisaac}}==
Line 1,942: Line 2,731:
You can print to standard output in Lisaac by calling STRING.print or INTEGER.print:
You can print to standard output in Lisaac by calling STRING.print or INTEGER.print:


<lang lisaac>Section Header // The Header section is required.
<syntaxhighlight lang="lisaac">Section Header // The Header section is required.
+ name := GOODBYE; // Define the name of this object.
+ name := GOODBYE; // Define the name of this object.


Section Public
Section Public
- main <- ("Hello world!\n".print;);</lang>
- main <- ("Hello world!\n".print;);</syntaxhighlight>


However, it may be more straightforward to use IO.print_string instead:
However, it may be more straightforward to use IO.print_string instead:


<lang lisaac>Section Header // The Header section is required.
<syntaxhighlight lang="lisaac">Section Header // The Header section is required.
+ name := GOODBYE2; // Define the name of this object.
+ name := GOODBYE2; // Define the name of this object.


Section Public
Section Public
- main <- (IO.put_string "Hello world!\n";);</lang>
- main <- (IO.put_string "Hello world!\n";);</syntaxhighlight>


=={{header|Little}}==
=={{header|Little}}==
Output to terminal:
Output to terminal:
<lang c>puts("Hello world!");</lang>
<syntaxhighlight lang="c">puts("Hello world!");</syntaxhighlight>


Without the newline terminator:
Without the newline terminator:


<lang c>puts(nonewline: "Hello world!");</lang>
<syntaxhighlight lang="c">puts(nonewline: "Hello world!");</syntaxhighlight>


Output to arbitrary open, writable file, for example the standard error channel:
Output to arbitrary open, writable file, for example the standard error channel:
<lang c>puts(stderr, "Hello world!");</lang>
<syntaxhighlight lang="c">puts(stderr, "Hello world!");</syntaxhighlight>


=={{header|LiveCode}}==
=={{header|LiveCode}}==
Examples using the full LiveCode IDE.
Example on OS X using livecode-server in shell script

<lang LiveCode>#! /usr/local/bin/livecode-server
Text input and output done in the Message palette/window:
<syntaxhighlight lang="livecode">put "Hello World!"</syntaxhighlight>

Present a dialog box to the user
<syntaxhighlight lang="livecode">Answer "Hello World!"</syntaxhighlight>

Example using command-line livecode-server in shell script
<syntaxhighlight lang="livecode">#! /usr/local/bin/livecode-server
set the outputLineEndings to "lf"
set the outputLineEndings to "lf"
put "Hello world!" & return</lang>
put "Hello world!" & return</syntaxhighlight>


Livecode also supports stdout as a device to write to <lang LiveCode>write "Hello world!" & return to stdout</lang>
Livecode also supports stdout as a device to write to
<syntaxhighlight lang="livecode">write "Hello world!" & return to stdout</syntaxhighlight>


=={{header|LLVM}}==
=={{header|LLVM}}==


<lang llvm>
<syntaxhighlight lang="llvm">
; const char str[14] = "Hello World!\00"
; const char str[14] = "Hello World!\00"
@.str = private unnamed_addr constant [14 x i8] c"Hello, world!\00"
@.str = private unnamed_addr constant [14 x i8] c"Hello, world!\00"
Line 1,988: Line 2,786:
call i32 @puts( i8* getelementptr ([14 x i8]* @str, i32 0,i32 0))
call i32 @puts( i8* getelementptr ([14 x i8]* @str, i32 0,i32 0))
ret i32 0
ret i32 0
}</lang>
}</syntaxhighlight>


=={{header|Lobster}}==
=={{header|Lobster}}==
<lang lobster>print "Hello world!"</lang>
<syntaxhighlight lang="lobster">print "Hello world!"</syntaxhighlight>


=={{header|Logo}}==
=={{header|Logo}}==
Print includes a line feed:
Print includes a line feed:
<lang logo>print [Hello world!]</lang>
<syntaxhighlight lang="logo">print [Hello world!]</syntaxhighlight>
Type does not:
Type does not:
<lang logo>type [Hello world!]</lang>
<syntaxhighlight lang="logo">type [Hello world!]</syntaxhighlight>


=={{header|Logtalk}}==
=={{header|Logtalk}}==
<lang logtalk>:- object(hello_world).
<syntaxhighlight lang="logtalk">:- object(hello_world).


% the initialization/1 directive argument is automatically executed
% the initialization/1 directive argument is automatically executed
Line 2,006: Line 2,804:
:- initialization(write('Hello world!\n')).
:- initialization(write('Hello world!\n')).


:- end_object.</lang>
:- end_object.</syntaxhighlight>


=={{header|LOLCODE}}==
=={{header|LOLCODE}}==
<syntaxhighlight lang="lolcode">
<lang LOLCODE>
HAI
HAI
CAN HAS STDIO?
CAN HAS STDIO?
VISIBLE "Hello world!"
VISIBLE "Hello world!"
KTHXBYE
KTHXBYE
</syntaxhighlight>
</lang>


=={{header|LotusScript}}==
=={{header|LotusScript}}==
<lang lotusscript>:- object(hello_world).
<syntaxhighlight lang="lotusscript">:- object(hello_world).
'This will send the output to the status bar at the bottom of the Notes client screen
'This will send the output to the status bar at the bottom of the Notes client screen
print "Hello world!"
print "Hello world!"


:- end_object.</lang>
:- end_object.</syntaxhighlight>

=={{header|LSE}}==
<syntaxhighlight lang="lse">AFFICHER [U, /] 'Hello world!'</syntaxhighlight>


=={{header|LSE64}}==
=={{header|LSE64}}==
<lang lse64>"Hello world!" ,t nl</lang>
<syntaxhighlight lang="lse64">"Hello world!" ,t nl</syntaxhighlight>


=={{header|Lua}}==
=={{header|Lua}}==
Function calls with either a string literal or a table constructor passed as their only argument do not require parentheses.
Function calls with either a string literal or a table constructor passed as their only argument do not require parentheses.
<lang lua>print "Hello world!"</lang>
<syntaxhighlight lang="lua">print "Hello world!"</syntaxhighlight>


Harder way with a table:
Harder way with a table:
<lang lua>
<syntaxhighlight lang="lua">
local chars = {"G","o","o","d","b","y","e",","," ","W","o","r","l","d","!"}
local chars = {"G","o","o","d","b","y","e",","," ","W","o","r","l","d","!"}
for i = 1, #chars do
for i = 1, #chars do
write(chars[i])
io.write(chars[i])
end
end
-- or:
</lang>
print(table.concat(chars))
</syntaxhighlight>


=={{header|Luna}}==
=={{header|Luna}}==
<lang luna>def main:
<syntaxhighlight lang="luna">def main:
hello = "Hello, World!"
hello = "Hello, World!"
print hello</lang>
print hello</syntaxhighlight>


=={{header|M2000 Interpreter}}==
=={{header|M2000 Interpreter}}==
<syntaxhighlight lang="m2000 interpreter">
<lang M2000 Interpreter>
Print "Hello World!" \\ printing on columns, in various ways defined by last $() for specific layer
Print "Hello World!" \\ printing on columns, in various ways defined by last $() for specific layer
Print $(4),"Hello World!" \\ proportional printing using columns, expanded to a number of columns as the length of string indicates.
Print $(4),"Hello World!" \\ proportional printing using columns, expanded to a number of columns as the length of string indicates.
Report "Hello World!" \\ proportional printing with word wrap, for text, can apply justification and rendering a range of text lines
Report "Hello World!" \\ proportional printing with word wrap, for text, can apply justification and rendering a range of text lines
</syntaxhighlight>
</lang>


=={{header|M4}}==
=={{header|M4}}==
For the particular nature of m4, this is simply:
For the particular nature of m4, this is simply:
<lang m4>`Hello world!'</lang>
<syntaxhighlight lang="m4">`Hello world!'</syntaxhighlight>

=={{header|MACRO-10}}==
<syntaxhighlight lang="macro-10">

TITLE HELLO

COMMENT !
Hello-World program, PDP-10 assembly language, written by kjx, 2022.
Assembler: MACRO-10 Operating system: TOPS-20
!

SEARCH MONSYM ;Get symbolic names for system-calls.

GO:: RESET% ;System call: Initialize process.

HRROI 1,[ASCIZ /Hello World!/] ;Put pointer to string into register 1.
PSOUT% ;System call: Print string.
HALTF% ;System call: Halt program.

JRST GO ;Unconditional jump to GO (in case the
;user uses the CONTINUE-command while this
;program is still loaded).

END GO

</syntaxhighlight>

=={{header|MACRO-11}}==
<syntaxhighlight lang="macro-11">
;
; TEXT BASED HELLO WORLD
; WRITTEN BY: BILL GUNSHANNON
;
.MCALL .PRINT .EXIT
.RADIX 10
MESG1: .ASCII " "
.ASCII " HELLO WORLD "
.EVEN
START:
.PRINT #MESG1
DONE:
; CLEAN UP AND GO BACK TO KMON
.EXIT
.END START
</syntaxhighlight>



=={{header|Maclisp}}==
=={{header|Maclisp}}==
<lang lisp>(format t "Hello world!~%")</lang>
<syntaxhighlight lang="lisp">(format t "Hello world!~%")</syntaxhighlight>
Or
Or
<lang lisp>(print "Hello world!")</lang>
<syntaxhighlight lang="lisp">(print "Hello world!")</syntaxhighlight>

=={{header|MAD}}==

<syntaxhighlight lang="mad"> VECTOR VALUES HELLO = $11HHELLO WORLD*$
PRINT FORMAT HELLO
END OF PROGRAM</syntaxhighlight>


=={{header|make}}==
=={{header|make}}==
Makefile contents:
Makefile contents:
<lang make>
<syntaxhighlight lang="make">
all:
all:
$(info Hello world!)
$(info Hello world!)
</syntaxhighlight>
</lang>
Running make produces:
Running make produces:


Line 2,071: Line 2,936:


=={{header|Malbolge}}==
=={{header|Malbolge}}==

'''Long version:'''
'''Long version:'''
<lang malbolge>('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"
<syntaxhighlight lang="malbolge">('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"
`CB]V?Tx<uVtT`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${z@></lang>
`CB]V?Tx<uVtT`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${z@></syntaxhighlight>


'''Short version:'''
'''Short version:'''
<lang malbolge>(=<`#9]~6ZY32Vx/4Rs+0No-&Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8dc</lang>
<syntaxhighlight lang="malbolge">(=<`#9]~6ZY32Vx/4Rs+0No-&Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8dc</syntaxhighlight>


{{Out}}
{{Out}}
Line 2,085: Line 2,949:
=={{header|MANOOL}}==
=={{header|MANOOL}}==
In &ldquo;applicative&rdquo; notation:
In &ldquo;applicative&rdquo; notation:
<lang MANOOL>{{extern "manool.org.18/std/0.3/all"} in WriteLine[Out; "Hello world!"]}</lang>
<syntaxhighlight lang="manool">{{extern "manool.org.18/std/0.3/all"} in WriteLine[Out; "Hello world!"]}</syntaxhighlight>
OOPish notation (equivalent to the above, up to Abstract Syntax Tree):
OOPish notation (equivalent to the above, up to Abstract Syntax Tree):
<lang MANOOL>{{extern "manool.org.18/std/0.3/all"} in Out.WriteLine["Hello world!"]}</lang>
<syntaxhighlight lang="manool">{{extern "manool.org.18/std/0.3/all"} in Out.WriteLine["Hello world!"]}</syntaxhighlight>
LISPish notation (ditto):
LISPish notation (ditto):
<lang MANOOL>{{extern "manool.org.18/std/0.3/all"} in {WriteLine Out "Hello world!"}}</lang>
<syntaxhighlight lang="manool">{{extern "manool.org.18/std/0.3/all"} in {WriteLine Out "Hello world!"}}</syntaxhighlight>
Using a colon punctuator (ditto):
Using a colon punctuator (ditto):
<lang MANOOL>{{extern "manool.org.18/std/0.3/all"} in: WriteLine Out "Hello world!"}</lang>
<syntaxhighlight lang="manool">{{extern "manool.org.18/std/0.3/all"} in: WriteLine Out "Hello world!"}</syntaxhighlight>
Note that all semicolons, wherever allowed, are optional. The above example with all possible semicolons:
Note that all semicolons, wherever allowed, are optional. The above example with all possible semicolons:
<lang MANOOL>{{extern; "manool.org.18/std/0.3/all"} in: WriteLine; Out; "Hello world!"}</lang>
<syntaxhighlight lang="manool">{{extern; "manool.org.18/std/0.3/all"} in: WriteLine; Out; "Hello world!"}</syntaxhighlight>


=={{header|Maple}}==
=={{header|Maple}}==
<syntaxhighlight lang="maple">
<lang Maple>
> printf( "Hello world!\n" ): # print without quotes
> printf( "Hello world!\n" ): # print without quotes
Hello world!
Hello world!
</syntaxhighlight>
</lang>

=={{header|Mastermind}}==
<syntaxhighlight lang="mastermind">output "Hello world!\n";</syntaxhighlight>

=={{header|Mathcad}}==
Simply type the following directly onto a Mathcad worksheet (''A worksheet is Mathcad's combined source code file & console'').
<syntaxhighlight lang="ayrch">"Hello, World!"</syntaxhighlight>
Applies to Mathcad Prime, Mathcad Prime Express and Mathcad 15 (''and earlier'')


=={{header|Mathematica}} / {{header|Wolfram Language}}==
=={{header|Mathematica}} / {{header|Wolfram Language}}==
<lang mathematica>Print["Hello world!"]</lang>
<syntaxhighlight lang="mathematica">Print["Hello world!"]</syntaxhighlight>


=={{header|MATLAB}}==
=={{header|MATLAB}}==
<lang MATLAB>>> disp('Hello world!')</lang>
<syntaxhighlight lang="matlab">>> disp('Hello world!')</syntaxhighlight>



=={{header|Maude}}==
=={{header|Maude}}==
<syntaxhighlight lang="maude">
<lang Maude>
fmod BYE-WORLD is
fmod BYE-WORLD is


Line 2,120: Line 2,993:


red sayBye .
red sayBye .
</syntaxhighlight>
</lang>


=={{header|Maxima}}==
=={{header|Maxima}}==
<lang maxima>print("Hello world!");</lang>
<syntaxhighlight lang="maxima">print("Hello world!");</syntaxhighlight>


=={{header|MAXScript}}==
=={{header|MAXScript}}==
<lang maxscript>print "Hello world!"</lang>
<syntaxhighlight lang="maxscript">print "Hello world!"</syntaxhighlight>
or:
or:
<lang maxscript>format "%" "Hello world!"</lang>
<syntaxhighlight lang="maxscript">format "%" "Hello world!"</syntaxhighlight>


=={{header|MDL}}==
=={{header|MDL}}==
<lang mdl><PRINC "Hello world!">
<syntaxhighlight lang="mdl"><PRINC "Hello world!">
<CRLF></lang>
<CRLF></syntaxhighlight>

=={{header|MEL}}==
<syntaxhighlight lang="mel">proc helloWorld () {
print "Hello, world!\n";
} </syntaxhighlight>

=={{header|MelonBasic}}==
<syntaxhighlight lang="melonbasic">Say:Hello world!

helloWorld; </syntaxhighlight>


=={{header|Mercury}}==
=={{header|Mercury}}==
<lang mecury>:- module hello.
<syntaxhighlight lang="mecury">:- module hello.
:- interface.
:- interface.
:- import_module io.
:- import_module io.
Line 2,142: Line 3,025:
:- implementation.
:- implementation.
main(!IO) :-
main(!IO) :-
io.write_string("Hello world!\n", !IO).</lang>
io.write_string("Hello world!\n", !IO).</syntaxhighlight>


=={{header|Metafont}}==
=={{header|Metafont}}==
<lang metafont>message "Hello world!"; end</lang>
<syntaxhighlight lang="metafont">message "Hello world!"; end</syntaxhighlight>

=={{header|Microsoft Small Basic}}==
<syntaxhighlight lang="smallbasic">TextWindow.WriteLine("Hello world!")</syntaxhighlight>


=={{header|min}}==
=={{header|min}}==
<lang min>"Hello world!" puts</lang>
<syntaxhighlight lang="min">"Hello world!" puts</syntaxhighlight>

=={{header|Minimal BASIC}}==
<syntaxhighlight lang="qbasic">10 PRINT "Hello world!"
20 END</syntaxhighlight>


=={{header|MiniScript}}==
=={{header|MiniScript}}==
<lang MiniScript>print "Hello world!"</lang>
<syntaxhighlight lang="miniscript">print "Hello world!"</syntaxhighlight>


=={{header|MiniZinc}}==
=={{header|MiniZinc}}==
<syntaxhighlight lang="minizinc">
<lang MiniZinc>
output ["Hello World"];
output ["Hello World"];
</syntaxhighlight>
</lang>
{{out}}
{{out}}
<pre>
<pre>Hello World
----------</pre>
Hello World
----------
</pre>


=={{header|MIPS Assembly}}==
=={{header|MIPS Assembly}}==
{{works with|MARS}} and {{works with|SPIM}}
{{works with|MARS}} and {{works with|SPIM}}
<lang mips> .data #section for declaring variables
<syntaxhighlight lang="mips"> .data #section for declaring variables
hello: .asciiz "Hello world!" #asciiz automatically adds the null terminator. If it's .ascii it doesn't have it.
hello: .asciiz "Hello world!" #asciiz automatically adds the null terminator. If it's .ascii it doesn't have it.


Line 2,175: Line 3,063:


li $v0, 10 # set the syscall to exit
li $v0, 10 # set the syscall to exit
syscall # make the system call</lang>
syscall # make the system call</syntaxhighlight>

=={{header|Miranda}}==
<syntaxhighlight lang="miranda">main :: [sys_message]
main = [Stdout "Hello, world!\n"]</syntaxhighlight>


=={{header|mIRC Scripting Language}}==
=={{header|mIRC Scripting Language}}==
<lang mirc>echo -ag Hello world!</lang>
<syntaxhighlight lang="mirc">echo -ag Hello world!</syntaxhighlight>


=={{header|ML/I}}==
=={{header|ML/I}}==
<lang ML/I>Hello world!</lang>
<syntaxhighlight lang="ml/i">Hello world!</syntaxhighlight>


=={{header|Modula-2}}==
=={{header|Modula-2}}==
<lang modula2>MODULE Hello;
<syntaxhighlight lang="modula2">MODULE Hello;
IMPORT InOut;
IMPORT InOut;


Line 2,190: Line 3,082:
InOut.WriteString('Hello world!');
InOut.WriteString('Hello world!');
InOut.WriteLn
InOut.WriteLn
END Hello.</lang>
END Hello.</syntaxhighlight>
==={{header|TopSpeed Modula-2}}===
{{works with|TopSpeed (JPI) Modula-2 under DOSBox-X}}
Modula-2 does not have built-in procedures for I/O. Instead, I/O is done via library modules. The names and contents of these modules vary between implementations of Modula-2. The solution below shows that the console I/O module supplied with TopSpeed Modula-2 has a different name and different procedures from the implementation in the previous solution.
<syntaxhighlight lang="modula2">
MODULE Hello;
IMPORT IO;

BEGIN
IO.WrStr('Hello world!'); IO.WrLn;

(* Another way, showing some features of Modula-2 *)
IO.WrStr("Hello"); (* either single or double quotes can be used *)
IO.WrChar(40C); (* character whose ASCII code is 40 octal *)
IO.WrStr('world!');
IO.WrLn(); (* procedure with no arguments: () is optional *)
END Hello.
</syntaxhighlight>


=={{header|Modula-3}}==
=={{header|Modula-3}}==
<lang modula3>MODULE Goodbye EXPORTS Main;
<syntaxhighlight lang="modula3">MODULE Goodbye EXPORTS Main;


IMPORT IO;
IMPORT IO;
Line 2,199: Line 3,108:
BEGIN
BEGIN
IO.Put("Hello world!\n");
IO.Put("Hello world!\n");
END Goodbye.</lang>
END Goodbye.</syntaxhighlight>


=={{header|MontiLang}}==
=={{header|MontiLang}}==
<lang MontiLang>|Hello, World!| PRINT .</lang>
<syntaxhighlight lang="montilang">|Hello, World!| PRINT .</syntaxhighlight>


=={{header|Morfa}}==
=={{header|Morfa}}==
<lang morfa>
<syntaxhighlight lang="morfa">
import morfa.io.print;
import morfa.io.print;
func main(): void
func main(): void
Line 2,211: Line 3,120:
println("Hello world!");
println("Hello world!");
}
}
</syntaxhighlight>
</lang>


=={{header|Mosaic}}==
=={{header|Mosaic}}==
<lang mosaic>proc start =
<syntaxhighlight lang="mosaic">proc main =
println "Hello, world"
println "Hello, world"
end</lang>
end</syntaxhighlight>

Or just:
<syntaxhighlight lang="mosaic">
println "Hello, world"</syntaxhighlight>

=={{header|MSX Basic}}==
<syntaxhighlight lang="qbasic">10 PRINT "Hello world!"</syntaxhighlight>


=={{header|MUF}}==
=={{header|MUF}}==
<lang muf>: main[ -- ]
<syntaxhighlight lang="muf">: main[ -- ]
me @ "Hello world!" notify
me @ "Hello world!" notify
exit
exit
;</lang>
;</syntaxhighlight>


=={{header|MUMPS}}==
=={{header|MUMPS}}==
<lang MUMPS>Write "Hello world!",!</lang>
<syntaxhighlight lang="mumps">Write "Hello world!",!</syntaxhighlight>


=={{header|MyDef}}==
=={{header|MyDef}}==
Run with: <pre>mydef_run hello.def</pre>
Run with: <pre>mydef_run hello.def</pre>
Perl:
Perl:
<lang MyDef>$print Hello world</lang>
<syntaxhighlight lang="mydef">$print Hello world</syntaxhighlight>


C:
C:
<syntaxhighlight lang="mydef">
<lang MyDef>
module: c
module: c
$print Hello world
$print Hello world
</syntaxhighlight>
</lang>


python:
python:
<syntaxhighlight lang="mydef">
<lang MyDef>
module: python
module: python
$print Hello world
$print Hello world
</syntaxhighlight>
</lang>


JavaScript
JavaScript
<syntaxhighlight lang="mydef">
<lang MyDef>
module: js
module: js
$print "Hello world"
$print "Hello world"
</syntaxhighlight>
</lang>


go:
go:
<syntaxhighlight lang="mydef">
<lang MyDef>
module: go
module: go
$print Hello world
$print Hello world
</syntaxhighlight>
</lang>


=={{header|MyrtleScript}}==
=={{header|MyrtleScript}}==
<lang MyrtleScript>script HelloWorld {
<syntaxhighlight lang="myrtlescript">script HelloWorld {
func main returns: int {
func main returns: int {
print("Hello World!")
print("Hello World!")
}
}
}
}
</syntaxhighlight>
</lang>


=={{header|MySQL}}==
=={{header|MySQL}}==


<lang MySQL>SELECT 'Hello world!';</lang>
<syntaxhighlight lang="mysql">SELECT 'Hello world!';</syntaxhighlight>


=={{header|Mythryl}}==
=={{header|Mythryl}}==


<lang Mythryl>print "Hello world!";</lang>
<syntaxhighlight lang="mythryl">print "Hello world!";</syntaxhighlight>


=={{header|N/t/roff}}==
=={{header|N/t/roff}}==
Line 2,278: Line 3,194:
Because /.ROFF/ is a document formatting language, the majority of input is expected to be text to output onto a medium. Therefore, there are no routines to explicitly call to print text.
Because /.ROFF/ is a document formatting language, the majority of input is expected to be text to output onto a medium. Therefore, there are no routines to explicitly call to print text.


<lang N/t/roff>Hello world!</lang>
<syntaxhighlight lang="n/t/roff">Hello world!</syntaxhighlight>


=={{header|Nanoquery}}==
=={{header|Nanoquery}}==
<lang nanoquery>println "Hello world!"</lang>
<syntaxhighlight lang="nanoquery">println "Hello world!"</syntaxhighlight>


=={{header|Neat}}==
=={{header|Neat}}==


<lang Neat>void main() writeln "Hello world!";</lang>
<syntaxhighlight lang="neat">void main() writeln "Hello world!";</syntaxhighlight>


=={{header|Neko}}==
=={{header|Neko}}==
<lang neko>$print("Hello world!");</lang>
<syntaxhighlight lang="neko">$print("Hello world!");</syntaxhighlight>


=={{header|Nemerle}}==
=={{header|Nemerle}}==
<syntaxhighlight lang="nemerle">
<lang Nemerle>
class Hello
class Hello
{
{
Line 2,299: Line 3,215:
}
}
}
}
</syntaxhighlight>
</lang>
Easier method:
Easier method:
<syntaxhighlight lang="nemerle">
<lang Nemerle>
System.Console.WriteLine("Hello world!");
System.Console.WriteLine("Hello world!");
</syntaxhighlight>
</lang>


=={{header|NetRexx}}==
=={{header|NetRexx}}==
<lang NetRexx>say 'Hello world!'</lang>
<syntaxhighlight lang="netrexx">say 'Hello world!'</syntaxhighlight>


=={{header|Never}}==
=={{header|Never}}==
<lang fsharp>func main() -> int {
<syntaxhighlight lang="fsharp">func main() -> int {
prints("Hello world!\n");
prints("Hello world!\n");
0
0
}</lang>
}</syntaxhighlight>


{{out}}
{{out}}
Line 2,320: Line 3,236:
=={{header|newLISP}}==
=={{header|newLISP}}==
{{works with|newLisp|6.1 and after}}
{{works with|newLisp|6.1 and after}}
<lang lisp>(println "Hello world!")</lang>
<syntaxhighlight lang="lisp">(println "Hello world!")</syntaxhighlight>


=={{header|Nickle}}==
=={{header|Nickle}}==
<lang c>printf("Hello world!\n")</lang>
<syntaxhighlight lang="c">printf("Hello world!\n")</syntaxhighlight>


=={{header|Nim}}==
=={{header|Nim}}==
<lang python>echo("Hello world!")</lang>
<syntaxhighlight lang="nim">echo("Hello world!")</syntaxhighlight>
using <code>stdout</code>
<syntaxhighlight lang="nim">stdout.writeLine("Hello World!")</syntaxhighlight>


=={{header|Nit}}==
=={{header|Nit}}==
<lang nit>print "Hello world!"</lang>
<syntaxhighlight lang="nit">print "Hello world!"</syntaxhighlight>
=={{header|Nix}}==
<syntaxhighlight lang="nix">"Hello world!"</syntaxhighlight>

=={{header|NLP++}}==
<syntaxhighlight lang="nlp++">
@CODE
"output.txt" << "Hello world!";
@@CODE
</syntaxhighlight>


=={{header|NS-HUBASIC}}==
=={{header|NS-HUBASIC}}==
<p>As lowercase characters are not offered in NS-HUBASIC, perhaps some flexibility in the task specification could be offered.</p>
<p>As lowercase characters are not offered in NS-HUBASIC, perhaps some flexibility in the task specification could be offered.</p>
Using <code>?</code>:
Using <code>?</code>:
<lang NS-HUBASIC>10 ? "HELLO WORLD!"</lang>
<syntaxhighlight lang="ns-hubasic">10 ? "HELLO WORLD!"</syntaxhighlight>


Using <code>PRINT</code>:
Using <code>PRINT</code>:
<lang NS-HUBASIC>10 PRINT "HELLO WORLD!"</lang>
<syntaxhighlight lang="ns-hubasic">10 PRINT "HELLO WORLD!"</syntaxhighlight>

=={{header|Nu}}==
<syntaxhighlight lang="nu">
print "Hello world!"
</syntaxhighlight>

=={{header|Nutt}}==
<syntaxhighlight lang="Nutt">
module hello_world
imports native.io.output.say

say("Hello, world!")

end
</syntaxhighlight>


=={{header|Nyquist}}==
=={{header|Nyquist}}==
Line 2,343: Line 3,285:
[[Category:Nyquist Version 3.15]]
[[Category:Nyquist Version 3.15]]
===LISP syntax===
===LISP syntax===
<lang lisp>(format t "Hello world!")</lang>
<syntaxhighlight lang="lisp">(format t "Hello world!")</syntaxhighlight>


Or
Or


<lang lisp>(print "Hello world!")</lang>
<syntaxhighlight lang="lisp">(print "Hello world!")</syntaxhighlight>


===SAL syntax===
===SAL syntax===
<lang SAL>print "Hello World!"</lang>
<syntaxhighlight lang="sal">print "Hello World!"</syntaxhighlight>


Or
Or


<lang SAL>exec format(t, "Hello World!")</lang>
<syntaxhighlight lang="sal">exec format(t, "Hello World!")</syntaxhighlight>


=={{header|Oberon-2}}==
=={{header|Oberon-2}}==
<lang oberon2>
<syntaxhighlight lang="oberon2">
MODULE Goodbye;
MODULE Goodbye;
IMPORT Out;
IMPORT Out;
Line 2,367: Line 3,309:
World;
World;
END Goodbye.
END Goodbye.
</syntaxhighlight>
</lang>


=={{header|Objeck}}==
=={{header|Objeck}}==
<lang objeck>
<syntaxhighlight lang="objeck">
class Hello {
class Hello {
function : Main(args : String[]) ~ Nil {
function : Main(args : String[]) ~ Nil {
"Hello world!"->PrintLine();
"Hello world!"->PrintLine();
}
}
}</lang>
}</syntaxhighlight>

=={{header|ObjectIcon}}==
<syntaxhighlight lang="objecticon">
import io

procedure main ()
io.write ("Hello world!")
end
</syntaxhighlight>

{{out}}
<pre>$ oiscript hello-OI.icn
Hello world!</pre>


=={{header|Objective-C}}==
=={{header|Objective-C}}==
Line 2,382: Line 3,337:
The de facto Objective-C "Hello, World!" program is most commonly illustrated as the following, using the NSLog() function:
The de facto Objective-C "Hello, World!" program is most commonly illustrated as the following, using the NSLog() function:


<lang objc>
<syntaxhighlight lang="objc">
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>


Line 2,390: Line 3,345:
}
}
}
}
</syntaxhighlight>
</lang>


However the purpose of the NSLog() function is to print a message to standard error prefixed with a timestamp, which does not meet the most common criteria of a "Hello, World!" program of displaying only the requested message to standard output.
However the purpose of the NSLog() function is to print a message to standard error prefixed with a timestamp, which does not meet the most common criteria of a "Hello, World!" program of displaying only the requested message to standard output.
Line 2,396: Line 3,351:
The following code prints the message to standard output without a timestamp using exclusively Objective-C messages:
The following code prints the message to standard output without a timestamp using exclusively Objective-C messages:


<lang objc>
<syntaxhighlight lang="objc">
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>


Line 2,406: Line 3,361:
}
}
}
}
</syntaxhighlight>
</lang>


Objective-C also supports functions contained within the C standard library. However, Objective-C's NSString objects must be converted into a UTF-8 string in order to be supported by the C language's I/O functions.
Objective-C also supports functions contained within the C standard library. However, Objective-C's NSString objects must be converted into a UTF-8 string in order to be supported by the C language's I/O functions.


<lang objc>
<syntaxhighlight lang="objc">
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>


Line 2,419: Line 3,374:
}
}
}
}
</syntaxhighlight>
</lang>


=={{header|OCaml}}==
=={{header|OCaml}}==
<lang ocaml>print_endline "Hello world!"</lang>
<syntaxhighlight lang="ocaml">print_endline "Hello world!"</syntaxhighlight>


=={{header|Occam}}==
=={{header|Occam}}==
{{works with|kroc}}
{{works with|kroc}}
<lang occam>#USE "course.lib"
<syntaxhighlight lang="occam">#USE "course.lib"
PROC main (CHAN BYTE screen!)
PROC main (CHAN BYTE screen!)
out.string("Hello world!*c*n", 0, screen)
out.string("Hello world!*c*n", 0, screen)
:</lang>
:</syntaxhighlight>


=={{header|Octave}}==
=={{header|Octave}}==
<lang octave>disp("Hello world!");</lang>
<syntaxhighlight lang="octave">disp("Hello world!");</syntaxhighlight>


Or, using C-style function printf:
Or, using C-style function printf:


<lang octave>printf("Hello world!");</lang>
<syntaxhighlight lang="octave">printf("Hello world!");</syntaxhighlight>

=={{header|Odin}}==
<syntaxhighlight lang="odin">package main
import "core:fmt"

main :: proc() {
fmt.println("Hellope!");
}</syntaxhighlight>


=={{header|Oforth}}==
=={{header|Oforth}}==
<lang Oforth>"Hello world!" .</lang>
<syntaxhighlight lang="oforth">"Hello world!" .</syntaxhighlight>


=={{header|Ol}}==
=={{header|Ol}}==
<lang scheme>(print "Hello world!")</lang>
<syntaxhighlight lang="scheme">(print "Hello world!")</syntaxhighlight>


=={{header|Onyx}}==
=={{header|Onyx}}==
<lang onyx>`Hello world!\n' print flush</lang>
<syntaxhighlight lang="onyx">`Hello world!\n' print flush</syntaxhighlight>

=={{header|Onyx (wasm)}}==
<syntaxhighlight lang="TS">
use core {printf}
main :: () {
printf("Hello world!");
}
</syntaxhighlight>
{{out}}
<pre>
Hello world!
</pre>


=={{header|OOC}}==
=={{header|OOC}}==
To print a String, either call its println() method:
To print a String, either call its println() method:
<lang ooc>main: func {
<syntaxhighlight lang="ooc">main: func {
"Hello world!" println()
"Hello world!" println()
}</lang>
}</syntaxhighlight>
Or call the free println() function with the String as the argument.
Or call the free println() function with the String as the argument.
<lang ooc>main: func {
<syntaxhighlight lang="ooc">main: func {
println("Hello world!")
println("Hello world!")
}</lang>
}</syntaxhighlight>


=={{header|ooRexx}}==
=={{header|ooRexx}}==
Refer also to the [[#REXX|Rexx]] and [[#NetRexx|NetRexx]] solutions. Simple output is common to most Rexx dialects.
Refer also to the [[#REXX|Rexx]] and [[#NetRexx|NetRexx]] solutions. Simple output is common to most Rexx dialects.
<lang ooRexx>/* Rexx */
<syntaxhighlight lang="oorexx">/* Rexx */
say 'Hello world!'
say 'Hello world!'
</syntaxhighlight>
</lang>


=={{header|OpenLisp}}==
=={{header|OpenLisp}}==
We can use the same code as the Common Lisp example, but as a shell script.
We can use the same code as the Common Lisp example, but as a shell script.
<lang openlisp>
<syntaxhighlight lang="openlisp">
#!/openlisp/uxlisp -shell
#!/openlisp/uxlisp -shell
(format t "Hello world!~%")
(format t "Hello world!~%")
(print "Hello world!")
(print "Hello world!")
</syntaxhighlight>
</lang>


Output:
Output:
Line 2,476: Line 3,451:


=={{header|Openscad}}==
=={{header|Openscad}}==
<lang openscad>
<syntaxhighlight lang="openscad">
echo("Hello world!"); // writes to the console
echo("Hello world!"); // writes to the console
text("Hello world!"); // creates 2D text in the object space
text("Hello world!"); // creates 2D text in the object space
linear_extrude(height=10) text("Hello world!"); // creates 3D text in the object space
linear_extrude(height=10) text("Hello world!"); // creates 3D text in the object space
</syntaxhighlight>
</lang>

=={{header|Owl Lisp}}==
<syntaxhighlight lang="scheme">
(print "Hello world!")
</syntaxhighlight>

{{out}}
<pre>$ ol hello-Owl.scm
Hello world!</pre>



=={{header|Oxygene}}==
=={{header|Oxygene}}==
From [[wp:Oxygene (programming language)]]
From [[wp:Oxygene (programming language)]]
<syntaxhighlight lang="pascal">
<lang oxygene>
namespace HelloWorld;
namespace HelloWorld;
Line 2,499: Line 3,484:
class method HelloClass.Main;
class method HelloClass.Main;
begin
begin
System.Console.WriteLine('Hello world!');
writeLn('Hello world!');
end;
end;
end.
end.
</syntaxhighlight>
</lang>
{{out}}
<pre>
<pre>
>HelloWorld.exe
Hello world!
Hello world!
</pre>
</pre>


=={{header|Oz}}==
=={{header|Oz}}==
<lang oz>{Show "Hello world!"}</lang>
<syntaxhighlight lang="oz">{Show "Hello world!"}</syntaxhighlight>


=={{header|PARI/GP}}==
=={{header|PARI/GP}}==


<lang parigp>print("Hello world!")</lang>
<syntaxhighlight lang="parigp">print("Hello world!")</syntaxhighlight>


=={{header|Pascal}}==
=={{header|Pascal}}==
{{works with|Free Pascal}}
{{works with|Free Pascal}}
<lang pascal>program byeworld;
<syntaxhighlight lang="pascal">program byeworld;
begin
begin
writeln('Hello world!');
writeln('Hello world!');
end.</lang>
end.</syntaxhighlight>


=={{header|PascalABC.NET}}==
<syntaxhighlight lang="pascal">
// Hello world/Text. Nigel Galloway: January 25th., 2023
begin
System.Console.WriteLine('Hello World!');
end.
</syntaxhighlight>
{{out}}
<pre>
Hello World!
</pre>
=={{header|PASM}}==
=={{header|PASM}}==
<lang pasm>print "Hello world!\n"
<syntaxhighlight lang="pasm">print "Hello world!\n"
end</lang>
end</syntaxhighlight>


=={{header|PDP-1 Assembly}}==
=={{header|PDP-1 Assembly}}==
This can be assembled with macro1.c distributed with SIMH and then run on the SIMH PDP-1 simulator.
This can be assembled with macro1.c distributed with SIMH and then run on the SIMH PDP-1 simulator.
<lang assembly>
<syntaxhighlight lang="assembly">
hello
hello
/ above: title line - was punched in human readable letters on paper tape
/ above: title line - was punched in human readable letters on paper tape
Line 2,549: Line 3,545:
end, . / sentinel for end of message
end, . / sentinel for end of message
start 100 / tells assembler where program starts
start 100 / tells assembler where program starts
</syntaxhighlight>
</lang>


=={{header|PDP-11 Assembly}}==
=={{header|PDP-11 Assembly}}==
This is Dennis Ritchie's Unix Assembly ("as"). Other PDP-11 assembly languages include PAL-11R, PAL-11S and MACRO-11.
This is Dennis Ritchie's Unix Assembler ("as"). Other PDP-11 assemblers include PAL-11R, PAL-11S and MACRO-11.


{{works with|UNIX|6}}
{{works with|UNIX|1}} to {{works with|UNIX|7}}
{{works with|UNIX|7}}


<lang assembly>.globl start
<syntaxhighlight lang="assembly">.globl start
.text
.text
start:
start:
mov $1,r0
mov $1,r0 / r0=stream, STDOUT=$1
sys 4; outtext; outlen
sys 4; outtext; outlen / sys 4 is write
sys 1 / sys 1 is exit
sys 1
rts pc / in case exit returns
rts pc


.data
.data
outtext: <Hello world!\n>
outtext: <Hello world!\n>
outlen = . - outtext</lang>
outlen = . - outtext</syntaxhighlight>

=={{header|Pebble}}==
<syntaxhighlight lang="pebble">;Hello world example program
;for x86 DOS
;compile with Pebble

;compiled com program is 51 bytes

program examples\hello

begin

echo "Hello, world!"
pause
kill

end</syntaxhighlight>

=={{header|PepsiScript}}==
The letters are only outputted in uppercase in the running program. However, lowercase characters can be used in the code instead.

For typing:
<syntaxhighlight lang="pepsiscript">#include default-libraries

#author Childishbeat

class Hello world/Text:
function Hello world/Text:

print "Hello world!"

end</syntaxhighlight>
For importing:

•dl◘Childishbeat◙♦Hello world/Text♪♣Hello_world!♠


=={{header|Perl}}==
=={{header|Perl}}==
{{works with|Perl|5.8.8}}
{{works with|Perl|5.8.8}}
<lang perl>print "Hello world!\n";</lang>
<syntaxhighlight lang="perl">print "Hello world!\n";</syntaxhighlight>


{{works with|Perl|5.10.x}}
{{works with|Perl|5.10.x}}
Backported from Raku:
Backported from Raku:
<lang perl>use feature 'say';
<syntaxhighlight lang="perl">use feature 'say';
say 'Hello world!';</lang>
say 'Hello world!';</syntaxhighlight>


or:
or:
<lang perl>use 5.010;
<syntaxhighlight lang="perl">use 5.010;
say 'Hello world!';</lang>
say 'Hello world!';</syntaxhighlight>

=={{header|Peylang}}==
<syntaxhighlight lang="peylang">chaap 'Hello world!';</syntaxhighlight>
{{out}}
<pre>
$ peyman hello.pey
Hello world!
</pre>

=={{header|Pharo}}==
<syntaxhighlight lang="pharo">"Comments are in double quotes"
"Sending message printString to 'Hello World' string"

'Hello World' printString</syntaxhighlight>


=={{header|Phix}}==
=={{header|Phix}}==
{{libheader|Phix/basics}}
<lang phix>puts(1,"Hello world!")</lang>
<!--<syntaxhighlight lang="phix">-->
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"Hello world!"</span><span style="color: #0000FF;">)</span>
<!--</syntaxhighlight>-->


=={{header|PHL}}==
=={{header|PHL}}==
<lang phl>module helloworld;
<syntaxhighlight lang="phl">module helloworld;
extern printf;
extern printf;


Line 2,592: Line 3,639:
printf("Hello world!");
printf("Hello world!");
return 0;
return 0;
]</lang>
]</syntaxhighlight>


=={{header|PHP}}==
=={{header|PHP}}==
<lang php><?php
<syntaxhighlight lang="php"><?php
echo "Hello world!\n";
echo "Hello world!\n";
?></lang>
?></syntaxhighlight>
Alternatively, any text outside of the <code><?php ?></code> tags will be automatically echoed:
Alternatively, any text outside of the <code><?php ?></code> tags will be automatically echoed:
<lang php>Hello world!</lang>
<syntaxhighlight lang="php">Hello world!</syntaxhighlight>

=={{header|Picat}}==
<syntaxhighlight lang="picat">println("Hello, world!")</syntaxhighlight>


=={{header|PicoLisp}}==
=={{header|PicoLisp}}==
<lang PicoLisp>(prinl "Hello world!")</lang>
<syntaxhighlight lang="picolisp">(prinl "Hello world!")</syntaxhighlight>


=={{header|Pict}}==
=={{header|Pict}}==
Using the syntax sugared version:
Using the syntax sugared version:
<lang pict>(prNL "Hello World!");</lang>
<syntaxhighlight lang="pict">(prNL "Hello World!");</syntaxhighlight>
Using the channel syntax:
Using the channel syntax:
<lang pict>new done: ^[]
<syntaxhighlight lang="pict">new done: ^[]
run ( prNL!["Hello World!" (rchan done)]
run ( prNL!["Hello World!" (rchan done)]
| done?_ = () )</lang>
| done?_ = () )</syntaxhighlight>


=={{header|Pikachu}}==
=={{header|Pikachu}}==
<lang pict>pikachu pika pikachu pika pika pi pi pika pikachu pika pikachu pi pikachu pi pikachu pi pika pi pikachu pikachu pi pi pika pika pikachu pika pikachu pikachu pi pika pi pika pika pi pikachu pikachu pi pikachu pi pika pikachu pi pikachu pika pikachu pi pikachu pikachu pi pikachu pika pika pikachu pi pikachu pi pi pikachu pikachu pika pikachu pi pika pi pi pika pika pikachu pikachu pi pi pikachu pi pikachu
<syntaxhighlight lang="pict">pikachu pika pikachu pika pika pi pi pika pikachu pika pikachu pi pikachu pi pikachu pi pika pi pikachu pikachu pi pi pika pika pikachu pika pikachu pikachu pi pika pi pika pika pi pikachu pikachu pi pikachu pi pika pikachu pi pikachu pika pikachu pi pikachu pikachu pi pikachu pika pika pikachu pi pikachu pi pi pikachu pikachu pika pikachu pi pika pi pi pika pika pikachu pikachu pi pi pikachu pi pikachu
pikachu pikachu pi pikachu
pikachu pikachu pi pikachu
pikachu pika pika pikachu pika pikachu pikachu pika pika pikachu pikachu pi pi pikachu pika pikachu pika pika pi pika pikachu pikachu pi pika pika pikachu pi pika pi pika pi pikachu pi pikachu pika pika pi pi pika pi pika pika pikachu pikachu pika pikachu pikachu pika pi pikachu pika pi pikachu pi pika pika pi pikachu pika pi pika pikachu pi pi pikachu pika pika pi pika pi pikachu
pikachu pika pika pikachu pika pikachu pikachu pika pika pikachu pikachu pi pi pikachu pika pikachu pika pika pi pika pikachu pikachu pi pika pika pikachu pi pika pi pika pi pikachu pi pikachu pika pika pi pi pika pi pika pika pikachu pikachu pika pikachu pikachu pika pi pikachu pika pi pikachu pi pika pika pi pikachu pika pi pika pikachu pi pi pikachu pika pika pi pika pi pikachu
Line 2,635: Line 3,685:
pikachu pi pi pika pi pi pikachu pika pikachu pikachu pika pika pi pi pika pikachu pi pikachu pi pi pika pi pika pi pi pika pikachu pi pika pi pikachu pika pikachu pika pi pi pika pi pi pikachu pi pikachu pikachu pika pi pikachu pi pi pika pi pikachu pi pi pika pi pi pikachu pika pikachu pika pikachu pika pi pikachu pikachu pi pi pika pika pikachu
pikachu pi pi pika pi pi pikachu pika pikachu pikachu pika pika pi pi pika pikachu pi pikachu pi pi pika pi pika pi pi pika pikachu pi pika pi pikachu pika pikachu pika pi pi pika pi pi pikachu pi pikachu pikachu pika pi pikachu pi pi pika pi pikachu pi pi pika pi pi pikachu pika pikachu pika pikachu pika pi pikachu pikachu pi pi pika pika pikachu
pikachu pikachu pi pikachu
pikachu pikachu pi pikachu
pikachu pikachu pika pikachu</lang>
pikachu pikachu pika pikachu</syntaxhighlight>


=={{header|Pike}}==
=={{header|Pike}}==
<lang pike>int main(){
<syntaxhighlight lang="pike">int main(){
write("Hello world!\n");
write("Hello world!\n");
}</lang>
}</syntaxhighlight>


=={{header|PILOT}}==
=={{header|PILOT}}==
<lang pilot>T:Hello world!</lang>
<syntaxhighlight lang="pilot">T:Hello world!</syntaxhighlight>


=={{header|PIR}}==
=={{header|PIR}}==
<lang pir>.sub hello_world_text :main
<syntaxhighlight lang="pir">.sub hello_world_text :main
print "Hello world!\n"
print "Hello world!\n"
.end</lang>
.end</syntaxhighlight>

=={{header|Pixilang}}==
<syntaxhighlight lang="pixilang">fputs("Hello world!\n")</syntaxhighlight>


=={{header|PL/I}}==
=={{header|PL/I}}==
<lang pli>goodbye:proc options(main);
<syntaxhighlight lang="pli">goodbye:proc options(main);
put list('Hello world!');
put list('Hello world!');
end goodbye;</lang>
end goodbye;</syntaxhighlight>


=={{header|PL/M}}==
=={{header|PL/M}}==
The original PL/M compiler does not recognise lower-case letters, hence the Hello, World! string must specify the ASCII codes for the lower-case letters.
Assuming the existence of a WRITE$STRING library routine.
<syntaxhighlight lang="pli">100H:
<lang plm>HELLO_WORLD: DO;
/* external I/O routines */
/* CP/M BDOS SYSTEM CALL */
WRITE$STRING: PROCEDURE( S ) EXTERNAL; DECLARE S POINTER; END WRITE$STRING;
BDOS: PROCEDURE( FN, ARG ); DECLARE FN BYTE, ARG ADDRESS; GOTO 5; END;
/* end external routines */
/* PRINT A $ TERMINATED STRING */
PRINT$STRING: PROCEDURE( S ); DECLARE S ADDRESS; CALL BDOS( 9, S ); END;
MAIN: PROCEDURE;
/* HELLO, WORLD! IN MIXED CASE */
CALL WRITE$STRING( @( 'Hello world!', 0AH, 0 ) );
DECLARE HELLO$WORLD ( 14 ) BYTE
END MAIN;
INITIAL( 'H', 65H, 6CH, 6CH, 6FH, ',', ' '
END HELLO_WORLD;
, 'W', 6FH, 72H, 6CH, 64H, 21H, '$'
</lang>
);
CALL PRINT$STRING( .HELLO$WORLD );
EOF</syntaxhighlight>


=={{header|PL/SQL}}==
=={{header|PL/SQL}}==
{{works with|Oracle}}
{{works with|Oracle}}
<lang plsql>
<syntaxhighlight lang="plsql">
set serveroutput on
set serveroutput on


Line 2,676: Line 3,732:
END;
END;
/
/
</syntaxhighlight>
</lang>


<pre>
<pre>
Line 2,689: Line 3,745:
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
</pre>
</pre>

=={{header|Plain English}}==
<syntaxhighlight lang="plainenglish">\This prints Hello World within the CAL-4700 IDE.
\...and backslashes are comments!
To run:
Start up.
Write "Hello World!" to the console.
Wait for the escape key.
Shut down.</syntaxhighlight>

=={{header|Plan}}==
This prints HELLO WORLD on operator's console.

<syntaxhighlight lang="plan">#STEER LIST,BINARY
#PROGRAM HLWD
#LOWER
MSG1A 11HHELLO WORLD
MSG1B 11/MSG1A
#PROGRAM
#ENTRY 0
DISTY MSG1B
SUSWT 2HHH
#END
#FINISH
#STOP</syntaxhighlight>

=={{header|Pointless}}==
<syntaxhighlight lang="pointless">
output = println("Hello world!")
</syntaxhighlight>


=={{header|Pony}}==
=={{header|Pony}}==
<lang pony>actor Main
<syntaxhighlight lang="pony">actor Main
new create(env: Env) =>
new create(env: Env) =>
env.out.print("Hello world!")</lang>
env.out.print("Hello world!")</syntaxhighlight>


=={{header|Pop11}}==
=={{header|Pop11}}==
<lang pop11>printf('Hello world!\n');</lang>
<syntaxhighlight lang="pop11">printf('Hello world!\n');</syntaxhighlight>

=={{header|Portugol}}==
Portugol keywords are Portuguese words.
<syntaxhighlight lang="portugol">
programa {
// funcao defines a new function
// inicio is the entry point of the program, like main in C
funcao inicio() {
// escreva is used to print stuff to the screen
escreva("Hello, world!\n") // no ';' needed
}
}
</syntaxhighlight>


=={{header|PostScript}}==
=={{header|PostScript}}==
Line 2,702: Line 3,801:
To generate a document that shows the text "Hello world!":
To generate a document that shows the text "Hello world!":


<lang postscript>%!PS
<syntaxhighlight lang="postscript">%!PS
/Helvetica 20 selectfont
/Helvetica 20 selectfont
70 700 moveto
70 700 moveto
(Hello world!) show
(Hello world!) show
showpage</lang>
showpage</syntaxhighlight>


If the viewer has a console, then there are the following ways to display the topmost element of the stack:
If the viewer has a console, then there are the following ways to display the topmost element of the stack:


<lang postscript>(Hello world!) ==</lang>
<syntaxhighlight lang="postscript">(Hello world!) ==</syntaxhighlight>


will display the <i>string</i> "(Hello world!)";
will display the <i>string</i> "(Hello world!)";


<lang postscript>(Hello world!) =</lang>
<syntaxhighlight lang="postscript">(Hello world!) =</syntaxhighlight>


will display the <i>content</i> of the string "(Hello world!)"; that is, "Hello world!";
will display the <i>content</i> of the string "(Hello world!)"; that is, "Hello world!";


<lang postscript>(Hello world!) print</lang>
<syntaxhighlight lang="postscript">(Hello world!) print</syntaxhighlight>


will do the same, without printing a newline. It may be necessary to provoke an error message to make the console pop up. The following program combines all four above variants:
will do the same, without printing a newline. It may be necessary to provoke an error message to make the console pop up. The following program combines all four above variants:


<lang postscript>%!PS
<syntaxhighlight lang="postscript">%!PS
/Helvetica 20 selectfont
/Helvetica 20 selectfont
70 700 moveto
70 700 moveto
Line 2,729: Line 3,828:
show % prints to document
show % prints to document
1 0 div % provokes error message
1 0 div % provokes error message
showpage</lang>
showpage</syntaxhighlight>


=={{header|Potion}}==
=={{header|Potion}}==
<lang potion>"Hello world!\n" print</lang>
<syntaxhighlight lang="potion">"Hello world!\n" print</syntaxhighlight>


=={{header|PowerBASIC}}==
=={{header|PowerBASIC}}==
<lang powerbasic>#COMPILE EXE
<syntaxhighlight lang="powerbasic">#COMPILE EXE
#COMPILER PBCC 6
#COMPILER PBCC 6


Line 2,741: Line 3,840:
CON.PRINT "Hello world!"
CON.PRINT "Hello world!"
CON.WAITKEY$
CON.WAITKEY$
END FUNCTION</lang>
END FUNCTION</syntaxhighlight>


=={{header|PowerShell}}==
=={{header|PowerShell}}==
Line 2,747: Line 3,846:


See http://www.jsnover.com/blog/2013/12/07/write-host-considered-harmful/ (Jeffrey Snover is one of the creators of PowerShell).
See http://www.jsnover.com/blog/2013/12/07/write-host-considered-harmful/ (Jeffrey Snover is one of the creators of PowerShell).
<lang powershell>'Hello world!'</lang>
<syntaxhighlight lang="powershell">'Hello world!'</syntaxhighlight>


=={{header|Processing}}==
=={{header|Processing}}==
<lang processing>println("Hello world!");</lang>
<syntaxhighlight lang="processing">println("Hello world!");</syntaxhighlight>


=={{header|ProDOS}}==
=={{header|ProDOS}}==
<lang ProDOS>printline Hello world!</lang>
<syntaxhighlight lang="prodos">printline Hello world!</syntaxhighlight>

=={{header|Programming Language}}==
For typing:
<syntaxhighlight lang="programming language">print(Hello world!)</syntaxhighlight>
For importing:

[print(Hello world!)]


=={{header|Prolog}}==
=={{header|Prolog}}==
<lang prolog>:- write('Hello world!'), nl.</lang>
<syntaxhighlight lang="prolog">:- write('Hello world!'), nl.</syntaxhighlight>

=={{header|PROMAL}}==
<syntaxhighlight lang="promal">
program hello
include library
begin
output "Hello world!"
end
</syntaxhighlight>


=={{header|PSQL}}==
=={{header|PSQL}}==
Line 2,768: Line 3,883:


=={{header|Pure}}==
=={{header|Pure}}==
<lang pure>
<syntaxhighlight lang="pure">
using system;
using system;


puts "Hello world!\n" ;
puts "Hello world!\n" ;
</syntaxhighlight>
</lang>


=={{header|PureBasic}}==
=={{header|PureBasic}}==
<lang PureBasic>OpenConsole()
<syntaxhighlight lang="purebasic">OpenConsole()
PrintN("Hello world!")
PrintN("Hello world!")
Input() ; Wait for enter</lang>
Input() ; Wait for enter</syntaxhighlight>
using <code>Debug</code>

<syntaxhighlight lang="purebasic">Debug("Hello world!")</syntaxhighlight>
=={{header|QB64}}==
<lang qbasic>PRINT "Hello world!"</lang>


=={{header|Python}}==
=={{header|Python}}==
{{works with|Python|2.4}}
{{works with|Python|2.4}}
<lang python>print "Hello world!"</lang>
<syntaxhighlight lang="python">print "Hello world!"</syntaxhighlight>


The same using sys.stdout
The same using sys.stdout
<lang python>import sys
<syntaxhighlight lang="python">import sys
sys.stdout.write("Hello world!\n")</lang>
sys.stdout.write("Hello world!\n")</syntaxhighlight>


In Python 3.0, print is changed from a statement to a function.
In Python 3.0, print is changed from a statement to a function.


{{works with|Python|3.0}} (And version 2.X too).
{{works with|Python|3.0}} (And version 2.X too).
<lang python>print("Hello world!")</lang>
<syntaxhighlight lang="python">print("Hello world!")</syntaxhighlight>


'''An easter egg'''
'''An easter egg'''
The first two examples print <code>Hello, world!</code> once, and the last one prints it twice.
<lang python>import __hello__</lang>
<syntaxhighlight lang="python">import __hello__</syntaxhighlight>


<lang python>import __phello__</lang>
<syntaxhighlight lang="python">import __phello__</syntaxhighlight>


<lang python>import __phello__.spam</lang>
<syntaxhighlight lang="python">import __phello__.spam</syntaxhighlight>

=={{header|QB64}}==
<syntaxhighlight lang="qbasic">PRINT "Hello world!"</syntaxhighlight>

=={{header|Quackery}}==
<syntaxhighlight lang="quackery">say "Hello world!"</syntaxhighlight>


=={{header|Quill}}==
=={{header|Quill}}==
<lang quill>"Hello world!" print</lang>
<syntaxhighlight lang="quill">"Hello world!" print</syntaxhighlight>


=={{header|Quite BASIC}}==
=={{header|Quite BASIC}}==
<lang Quite BASIC>10 print "Hello world!"</lang>
<syntaxhighlight lang="quite basic">10 print "Hello world!"</syntaxhighlight>


=={{header|R}}==
=={{header|R}}==
<lang R> cat("Hello world!\n")</lang>
<syntaxhighlight lang="r"> cat("Hello world!\n")</syntaxhighlight>
or
or
<lang R> message("Hello world!")</lang>
<syntaxhighlight lang="r"> message("Hello world!")</syntaxhighlight>
or
or
<lang R> print("Hello world!")</lang>
<syntaxhighlight lang="r"> print("Hello world!")</syntaxhighlight>


=={{header|Ra}}==
=={{header|Ra}}==
<syntaxhighlight lang="ra">
<lang Ra>
class HelloWorld
class HelloWorld
**Prints "Hello world!"**
**Prints "Hello world!"**
Line 2,823: Line 3,944:


print "Hello world!"
print "Hello world!"
</syntaxhighlight>
</lang>


=={{header|Racket}}==
=={{header|Racket}}==
<syntaxhighlight lang="racket">
<lang Racket>
(printf "Hello world!\n")
(printf "Hello world!\n")
</syntaxhighlight>
</lang>


=={{header|Raku}}==
=={{header|Raku}}==
(formerly Perl 6)
(formerly Perl 6)
<lang perl6>say 'Hello world!';</lang>
<syntaxhighlight lang="raku" line>say 'Hello world!';</syntaxhighlight>
In an object-oriented approach, the string is treated as an object calling its '''say()''' method:
In an object-oriented approach, the string is treated as an object calling its '''say()''' method:
<lang perl6>"Hello, World!".say();</lang>
<syntaxhighlight lang="raku" line>"Hello, World!".say();</syntaxhighlight>


=={{header|Raven}}==
=={{header|Raven}}==
<lang raven>'Hello world!' print</lang>
<syntaxhighlight lang="raven">'Hello world!' print</syntaxhighlight>

=={{header|RATFOR}}==
<syntaxhighlight lang="ratfor">

program hello

write(*,101)"Hello World"
101 format(A)

end

</syntaxhighlight>


=={{header|RASEL}}==
<syntaxhighlight lang="text">A"!dlroW ,olleH">:?@,Hj</syntaxhighlight>


=={{header|REALbasic}}==
=={{header|REALbasic}}==
Line 2,843: Line 3,980:
This requires a console application.
This requires a console application.


<lang realbasic>Function Run(args() as String) As Integer
<syntaxhighlight lang="realbasic">Function Run(args() as String) As Integer
Print "Hello world!"
Print "Hello world!"
Quit
Quit
End Function</lang>
End Function</syntaxhighlight>


=={{header|REBOL}}==
=={{header|REBOL}}==
<lang REBOL>print "Hello world!"</lang>
<syntaxhighlight lang="rebol">print "Hello world!"</syntaxhighlight>


=={{header|RED}}==
=={{header|RED}}==
<lang RED>print "Hello world!"</lang>
<syntaxhighlight lang="red">print "Hello world!"</syntaxhighlight>

=={{header|Refal}}==
<syntaxhighlight lang="refal">$ENTRY Go {
= <Prout 'Hello, world!'>;
};</syntaxhighlight>

=={{header|Relation}}==

<syntaxhighlight lang="relation">
' Hello world!
</syntaxhighlight>

=={{header|ReScript}}==

<syntaxhighlight lang="rescript">Js.log("Hello world!")</syntaxhighlight>
{{out}}
<pre>
$ bsc hello.res > hello.bs.js
$ node hello.bs.js
Hello world!
</pre>


=={{header|Retro}}==
=={{header|Retro}}==


<syntaxhighlight lang="retro">
<lang Retro>
'Hello_world! s:put
'Hello_world! s:put
</syntaxhighlight>
</lang>


=={{header|REXX}}==
=={{header|REXX}}==
===using SAY===
===using SAY===
<lang rexx>/*REXX program to show a line of text. */
<syntaxhighlight lang="rexx">/*REXX program to show a line of text. */
say 'Hello world!'</lang>
say 'Hello world!'</syntaxhighlight>


===using SAY variable===
===using SAY variable===
<lang rexx>/*REXX program to show a line of text. */
<syntaxhighlight lang="rexx">/*REXX program to show a line of text. */
yyy = 'Hello world!'
yyy = 'Hello world!'
say yyy</lang>
say yyy</syntaxhighlight>


===using LINEOUT===
===using LINEOUT===
<lang rexx>/*REXX program to show a line of text. */
<syntaxhighlight lang="rexx">/*REXX program to show a line of text. */


call lineout ,"Hello world!"</lang>
call lineout ,"Hello world!"</syntaxhighlight>

=={{header|Rhovas}}==

<syntaxhighlight lang="360 assembly">
print("Hello world!");
</syntaxhighlight>


=={{header|Ring}}==
=={{header|Ring}}==
<lang ring>See "Hello world!"</lang>
<syntaxhighlight lang="ring">See "Hello world!"</syntaxhighlight>


=={{header|Risc-V}}==
=={{header|RISC-V Assembly}}==
<lang Risc-V>.data
<syntaxhighlight lang="risc-v">.data
hello:
hello:
.string "Hello World!\n\0"
.string "Hello World!\n\0"
Line 2,889: Line 4,053:
li a7, 10
li a7, 10
ecall
ecall
</syntaxhighlight>
</lang>

=={{header|Roc}}==
<syntaxhighlight lang="roc">app "hello"
packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.1.1/zAoiC9xtQPHywYk350_b7ust04BmWLW00sjb9ZPtSQk.tar.br" }
imports [pf.Stdout]
provides [main] to pf

main =
Stdout.line "I'm a Roc application!"
</syntaxhighlight>

=={{header|Rockstar}}==
<syntaxhighlight lang="rockstar">Shout "Hello world!"</syntaxhighlight>

=={{header|RPG}}==
<nowiki>**</nowiki>free<br>
dsply 'Hello World!';

=={{header|RPL}}==
≪ "Hello world!" 1 DISP
1 FREEZE <span style="color:grey">@ remove this line on HP-28 models</span>
≫ '<span style="color:blue">TASK</span>' STO


=={{header|RTL/2}}==
=={{header|RTL/2}}==
<lang RTL/2>TITLE Goodbye World;
<syntaxhighlight lang="rtl/2">TITLE Goodbye World;


LET NL=10;
LET NL=10;
Line 2,903: Line 4,089:
RETURN(1);
RETURN(1);


ENDPROC;</lang>
ENDPROC;</syntaxhighlight>


=={{header|Ruby}}==
=={{header|Ruby}}==
{{works with|Ruby|1.8.4}}
{{works with|Ruby|1.8.4}}
<lang ruby>puts "Hello world!"</lang>
<syntaxhighlight lang="ruby">puts "Hello world!"</syntaxhighlight>
or
or
<lang ruby>$stdout.puts "Hello world!"</lang>
<syntaxhighlight lang="ruby">$stdout.puts "Hello world!"</syntaxhighlight>
or even
or even
<lang ruby> STDOUT.write "Hello world!\n"</lang>
<syntaxhighlight lang="ruby"> STDOUT.write "Hello world!\n"</syntaxhighlight>




'''Using the > global'''
'''Using the > global'''
<lang ruby>$>.puts "Hello world!"</lang>
<syntaxhighlight lang="ruby">$>.puts "Hello world!"</syntaxhighlight>
<lang ruby>$>.write "Hello world!\n"</lang>
<syntaxhighlight lang="ruby">$>.write "Hello world!\n"</syntaxhighlight>


=={{header|Run BASIC}}==
=={{header|Run BASIC}}==
<lang Runbasic>print "Hello world!"</lang>
<syntaxhighlight lang="runbasic">print "Hello world!"</syntaxhighlight>


=={{header|Rust}}==
=={{header|Rust}}==
<lang rust>
<syntaxhighlight lang="rust">
fn main() {
fn main() {
print!("Hello world!");
print!("Hello world!");
}
}
</syntaxhighlight>
</lang>


or
or


<lang rust>
<syntaxhighlight lang="rust">
fn main() {
fn main() {
println!("Hello world!");
println!("Hello world!");
}
}
</syntaxhighlight>
</lang>


=={{header|Salmon}}==
=={{header|Salmon}}==
<lang Salmon>"Hello world!"!</lang>
<syntaxhighlight lang="salmon">"Hello world!"!</syntaxhighlight>


or
or


<lang Salmon>print("Hello world!\n");</lang>
<syntaxhighlight lang="salmon">print("Hello world!\n");</syntaxhighlight>


or
or


<lang Salmon>standard_output.print("Hello world!\n");</lang>
<syntaxhighlight lang="salmon">standard_output.print("Hello world!\n");</syntaxhighlight>


=={{header|SAS}}==
=={{header|SAS}}==
<lang sas>/* Using a data step. Will print the string in the log window */
<syntaxhighlight lang="sas">/* Using a data step. Will print the string in the log window */
data _null_;
data _null_;
put "Hello world!";
put "Hello world!";
run;</lang>
run;</syntaxhighlight>


=={{header|SASL}}==
=={{header|SASL}}==
Note that a string starts with a single and ends with a double quote
Note that a string starts with a single and ends with a double quote
<syntaxhighlight lang="sasl">
<lang SASL>
'Hello World!",nl
'Hello World!",nl
</syntaxhighlight>
</lang>


=={{header|Sather}}==
=={{header|Sather}}==
<lang sather>class GOODBYE_WORLD is
<syntaxhighlight lang="sather">class GOODBYE_WORLD is
main is
main is
#OUT+"Hello world!\n";
#OUT+"Hello world!\n";
end;
end;
end;</lang>
end;</syntaxhighlight>


=={{header|Scala}}==
=={{header|Scala}}==
Line 2,970: Line 4,156:
===Ad hoc REPL solution===
===Ad hoc REPL solution===
Ad hoc solution as [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] script. Type this in a REPL session:
Ad hoc solution as [http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop REPL] script. Type this in a REPL session:
<lang Scala>println("Hello world!")</lang>
<syntaxhighlight lang="scala">println("Hello world!")</syntaxhighlight>
===Via Java runtime===
===Via Java runtime===
This is a call to the Java run-time library. '''Not recommended'''.
This is a call to the Java run-time library. '''Not recommended'''.
<lang Scala>System.out.println("Hello world!")</lang>
<syntaxhighlight lang="scala">System.out.println("Hello world!")</syntaxhighlight>


===Via Scala Console API===
===Via Scala Console API===
This is a call to the Scala run-time library. '''Recommended'''.
This is a call to the Scala run-time library. '''Recommended'''.
<lang Scala>println("Hello world!")</lang>
<syntaxhighlight lang="scala">println("Hello world!")</syntaxhighlight>


===Short term deviation to out===
===Short term deviation to out===
<lang Scala>Console.withErr(Console.out) { Console.err.println("This goes to default _out_") }</lang>
<syntaxhighlight lang="scala">Console.withErr(Console.out) { Console.err.println("This goes to default _out_") }</syntaxhighlight>
===Long term deviation to out===
===Long term deviation to out===
<lang Scala> Console.err.println ("Err not deviated")
<syntaxhighlight lang="scala"> Console.err.println ("Err not deviated")
Console.setErr(Console.out)
Console.setErr(Console.out)
Console.err.println ("Err deviated")
Console.err.println ("Err deviated")
Console.setErr(Console.err) // Reset to normal</lang>
Console.setErr(Console.err) // Reset to normal</syntaxhighlight>


=={{header|Scheme}}==
=={{header|Scheme}}==
All Scheme implementations display the value of the last evaluated expression before the program terminates.
{{works with|Gauche}}
<syntaxhighlight lang="scheme">"Hello world!"</syntaxhighlight>
{{works with|Guile}}
{{works with|Chicken Scheme}}
<lang scheme>(display "Hello world!")
(newline)</lang>
{{works with|Gauche}}
{{works with|Chicken Scheme}}
<lang scheme>(print "Hello world!")</lang>
or just:
<lang scheme>"Hello world!"</lang>
(should work on any scheme)


The <tt>display</tt> and <tt>newline</tt> procedures are found in specific modules of the standard library in R6RS and R7RS.
=== R7RS Scheme ===
The previous standards have no concept of modules and the entirety of the standard library is loaded by default.
<lang scheme>(import (scheme base)

===R5RS===
<syntaxhighlight lang="scheme">(display "Hello world!")
(newline)</syntaxhighlight>

===R6RS===
<syntaxhighlight lang="scheme">(import (rnrs base (6))
(rnrs io simple (6)))
(display "Hello world!")
(newline)</syntaxhighlight>

===R7RS===
<syntaxhighlight lang="scheme">(import (scheme base)
(scheme write))
(scheme write))
(display "Hello world!")
(display "Hello world!")
(newline)</lang>
(newline)</syntaxhighlight>


=={{header|Scilab}}==
=={{header|Scilab}}==
<lang Scilab>disp("Hello world!");</lang>
<syntaxhighlight lang="scilab">disp("Hello world!");</syntaxhighlight>

=={{header|ScratchScript}}==
<syntaxhighlight lang="scratchscript">print "Hello world!"</syntaxhighlight>
This example waits until the mouse is clicked for the program to end. This can be useful if the program executes too fast for "Hello world!" to be visible on the screen long enough for it to be comfortable.
<syntaxhighlight lang="scratchscript">print "Hello world!"
delayOnClick</syntaxhighlight>


=={{header|sed}}==
=={{header|sed}}==
<lang sed>i\
<syntaxhighlight lang="sed">i\
Hello world!
Hello world!
q</lang>
q</syntaxhighlight>


=={{header|Seed7}}==
=={{header|Seed7}}==
<lang seed7>$ include "seed7_05.s7i";
<syntaxhighlight lang="seed7">$ include "seed7_05.s7i";


const proc: main is func
const proc: main is func
begin
begin
writeln("Hello world!");
writeln("Hello world!");
end func;</lang>
end func;</syntaxhighlight>


=={{header|Self}}==
=={{header|Self}}==
<lang self>'Hello world!' printLine.</lang>
<syntaxhighlight lang="self">'Hello world!' printLine.</syntaxhighlight>


=={{header|SenseTalk}}==
=={{header|SenseTalk}}==
<lang sensetalk>put "Hello world!"</lang>
<syntaxhighlight lang="sensetalk">put "Hello world!"</syntaxhighlight>


=={{header|Set lang}}==
=={{header|Set lang}}==
<lang set_lang>set ! H
<syntaxhighlight lang="set_lang">set ! H
set ! E
set ! E
set ! L
set ! L
Line 3,040: Line 4,236:
set ! L
set ! L
set ! D
set ! D
set ! 33</lang>
set ! 33</syntaxhighlight>


=={{header|SETL}}==
=={{header|SETL}}==
<lang SETL>print("Hello world!");</lang>
<syntaxhighlight lang="setl">print("Hello world!");</syntaxhighlight>


=={{header|SETL4}}==
=={{header|SETL4}}==
<lang SETL4>out("Hello world!");end</lang>
<syntaxhighlight lang="setl4">out("Hello world!");end</syntaxhighlight>


=={{header|Shen}}==
=={{header|Shen}}==
<lang Shen>(output "Hello world!~%")</lang>
<syntaxhighlight lang="shen">(output "Hello world!~%")</syntaxhighlight>


=={{header|Shiny}}==
=={{header|Shiny}}==
<lang shiny>say 'Hello world!'</lang>
<syntaxhighlight lang="shiny">say 'Hello world!'</syntaxhighlight>


=={{header|Sidef}}==
=={{header|Sidef}}==
<lang sidef>„Hello world!”.say;</lang>
<syntaxhighlight lang="sidef">„Hello world!”.say;</syntaxhighlight>

=={{header|SimpleCode}}==
The letters are only outputted in uppercase in the running program. However, lowercase characters can be used in the code instead.
<syntaxhighlight lang="simplecode">dtxt
Hello world!</syntaxhighlight>


=={{header|SIMPOL}}==
=={{header|SIMPOL}}==
<lang simpol>function main()
<syntaxhighlight lang="simpol">function main()
end function "Hello world!{d}{a}"</lang>
end function "Hello world!{d}{a}"</syntaxhighlight>


=={{header|Simula}}==
=={{header|Simula}}==
{{works with|SIMULA-67}}
{{works with|SIMULA-67}}
<lang simula>BEGIN
<syntaxhighlight lang="simula">BEGIN
OUTTEXT("Hello world!");
OUTTEXT("Hello world!");
OUTIMAGE
OUTIMAGE
END</lang>
END</syntaxhighlight>

=={{header|Sing}}==
<syntaxhighlight lang="sing">requires "sio";

public fn singmain(argv [*]string) i32
{
sio.print("hello world !\r\n");
return(0);
}</syntaxhighlight>


=={{header|Sisal}}==
=={{header|Sisal}}==
<lang sisal>define main
<syntaxhighlight lang="sisal">define main


% Sisal doesn't yet have a string built-in.
% Sisal doesn't yet have a string built-in.
Line 3,078: Line 4,288:
function main(returns string)
function main(returns string)
"Hello world!"
"Hello world!"
end function</lang>
end function</syntaxhighlight>

=={{header|Skew}}==
{{works with|skewc|0.9.19}}

<syntaxhighlight lang="skew">
@entry
def main {
dynamic.console.log("Hello world!")
}
</syntaxhighlight>


=={{header|SkookumScript}}==
=={{header|SkookumScript}}==
<lang javascript>print("Hello world!")</lang>
<syntaxhighlight lang="javascript">print("Hello world!")</syntaxhighlight>
Alternatively if just typing in the SkookumIDE [http://skookumscript.com/docs/v3.0/ide/console/workspace/ REPL]:
Alternatively if just typing in the SkookumIDE [http://skookumscript.com/docs/v3.0/ide/console/workspace/ REPL]:
<lang javascript>"Hello world!"</lang>
<syntaxhighlight lang="javascript">"Hello world!"</syntaxhighlight>


=={{header|Slate}}==
=={{header|Slate}}==
<lang slate>inform: 'Hello world!'.</lang>
<syntaxhighlight lang="slate">inform: 'Hello world!'.</syntaxhighlight>

=={{header|Slope}}==
<syntaxhighlight lang="slope">(write "Hello, world!")</syntaxhighlight>

=={{header|SmallBASIC}}==
<syntaxhighlight lang="smallbasic">PRINT "Hello world!"</syntaxhighlight>


=={{header|Smalltalk}}==
=={{header|Smalltalk}}==
<lang smalltalk>Transcript show: 'Hello world!'; cr.</lang>
<syntaxhighlight lang="smalltalk">Transcript show: 'Hello world!'; cr.</syntaxhighlight>


{{works with|GNU Smalltalk}} (as does the above code)
{{works with|GNU Smalltalk}} (as does the above code)
<lang smalltalk>'Hello world!' printNl.</lang>
<syntaxhighlight lang="smalltalk">'Hello world!' printNl.</syntaxhighlight>


=={{header|smart BASIC}}==
=={{header|smart BASIC}}==
<lang qbasic>PRINT "Hello world!"</lang>
<syntaxhighlight lang="qbasic">PRINT "Hello world!"</syntaxhighlight>


=={{header|SmileBASIC}}==
=={{header|SmileBASIC}}==
<lang smilebasic>PRINT "Hello world!"</lang>
<syntaxhighlight lang="smilebasic">PRINT "Hello world!"</syntaxhighlight>


=={{header|SNOBOL4}}==
=={{header|SNOBOL4}}==
Using CSnobol4 dialect
Using CSnobol4 dialect
<lang snobol4> OUTPUT = "Hello world!"
<syntaxhighlight lang="snobol4"> OUTPUT = "Hello world!"
END</lang>
END</syntaxhighlight>


=={{header|SNUSP}}==
=={{header|SNUSP}}==
===Core SNUSP===
===Core SNUSP===
<lang snusp>/++++!/===========?\>++.>+.+++++++..+++\
<syntaxhighlight lang="snusp">/++++!/===========?\>++.>+.+++++++..+++\
\+++\ | /+>+++++++>/ /++++++++++<<.++>./
\+++\ | /+>+++++++>/ /++++++++++<<.++>./
$+++/ | \+++++++++>\ \+++++.>.+++.-----\
$+++/ | \+++++++++>\ \+++++.>.+++.-----\
\==-<<<<+>+++/ /=.>.+>.--------.-/</lang>
\==-<<<<+>+++/ /=.>.+>.--------.-/</syntaxhighlight>


===Modular SNUSP===
===Modular SNUSP===
<lang snusp>@\G.@\o.o.@\d.--b.@\y.@\e.>@\comma.@\.<-@\W.+@\o.+++r.------l.@\d.>+.! #
<syntaxhighlight lang="snusp">@\G.@\o.o.@\d.--b.@\y.@\e.>@\comma.@\.<-@\W.+@\o.+++r.------l.@\d.>+.! #
| | \@------|# | \@@+@@++|+++#- \\ -
| | \@------|# | \@@+@@++|+++#- \\ -
| \@@@@=+++++# | \===--------!\===!\-----|-------#-------/
| \@@@@=+++++# | \===--------!\===!\-----|-------#-------/
\@@+@@@+++++# \!#+++++++++++++++++++++++#!/</lang>
\@@+@@@+++++# \!#+++++++++++++++++++++++#!/</syntaxhighlight>

=={{header|Soda}}==
<syntaxhighlight lang="soda">
class Main

main (arguments : Array [String] ) : Unit =
println ("Hello world!")

end
</syntaxhighlight>


=={{header|SoneKing Assembly}}==
=={{header|SoneKing Assembly}}==
<lang soneking assembly>
<syntaxhighlight lang="soneking assembly">
extern print
extern print


Line 3,128: Line 4,364:
call print
call print
pop
pop
</syntaxhighlight>
</lang>


=={{header|SPARC Assembly}}==
=={{header|SPARC Assembly}}==
<lang sparc>
<syntaxhighlight lang="sparc">
.section ".text"
.section ".text"
.global _start
.global _start
Line 3,148: Line 4,384:
.ascii "Hello world!\n"
.ascii "Hello world!\n"
.msgend:
.msgend:
</syntaxhighlight>
</lang>


=={{header|Sparkling}}==
=={{header|Sparkling}}==
<lang sparkling>print("Hello world!");</lang>
<syntaxhighlight lang="sparkling">print("Hello world!");</syntaxhighlight>


=={{header|SPL}}==
=={{header|SPL}}==
<lang spl>#.output("Hello world!")</lang>
<syntaxhighlight lang="spl">#.output("Hello world!")</syntaxhighlight>


=={{header|SQL}}==
=={{header|SQL}}==
{{works with|Oracle}}
{{works with|Oracle}}
{{works with|Db2 LUW}}
{{works with|Db2 LUW}}
<lang sql>
<syntaxhighlight lang="sql">
select 'Hello world!' text from dual;
select 'Hello world!' text from dual;
</syntaxhighlight>
</lang>


<pre>
<pre>
Line 3,173: Line 4,409:
{{works with|Db2 LUW}}
{{works with|Db2 LUW}}
With SQL only:
With SQL only:
<lang sql pl>
<syntaxhighlight lang="sql pl">
SELECT 'Hello world!' AS text FROM sysibm.sysdummy1;
SELECT 'Hello world!' AS text FROM sysibm.sysdummy1;
</syntaxhighlight>
</lang>
Output:
Output:
<pre>
<pre>
Line 3,190: Line 4,426:
{{works with|Db2 LUW}} version 9.7 or higher.
{{works with|Db2 LUW}} version 9.7 or higher.
With SQL PL:
With SQL PL:
<lang sql pl>
<syntaxhighlight lang="sql pl">
SET SERVEROUTPUT ON;
SET SERVEROUTPUT ON;


CALL DBMS_OUTPUT.PUT_LINE('Hello world!');
CALL DBMS_OUTPUT.PUT_LINE('Hello world!');
</syntaxhighlight>
</lang>
Output:
Output:
<pre>
<pre>
Line 3,208: Line 4,444:


=={{header|Standard ML}}==
=={{header|Standard ML}}==
<lang sml>print "Hello world!\n"</lang>
<syntaxhighlight lang="sml">print "Hello world!\n"</syntaxhighlight>


=={{header|Stata}}==
=={{header|Stata}}==
<lang stata>display "Hello world!"</lang>
<syntaxhighlight lang="stata">display "Hello world!"</syntaxhighlight>


=={{header|Suneido}}==
=={{header|Suneido}}==
<lang Suneido>Print("Hello world!")</lang>
<syntaxhighlight lang="suneido">Print("Hello world!")</syntaxhighlight>

=={{header|Swahili}}==
<syntaxhighlight lang="swahili">andika("Hello world!")</syntaxhighlight>


=={{header|Swift}}==
=={{header|Swift}}==
{{works with|Swift|2.x+}}
{{works with|Swift|2.x+}}
<lang swift>print("Hello world!")</lang>
<syntaxhighlight lang="swift">print("Hello world!")</syntaxhighlight>
{{works with|Swift|1.x}}
{{works with|Swift|1.x}}
<lang swift>println("Hello world!")</lang>
<syntaxhighlight lang="swift">println("Hello world!")</syntaxhighlight>


=={{header|Symsyn}}==
=={{header|Symsyn}}==
<lang symsyn>
<syntaxhighlight lang="symsyn">
'hello world' []
'hello world' []
</syntaxhighlight>
</lang>
=={{header|TailDot}}==

<syntaxhighlight lang=taildot>c,x,Hello World!,v,x</syntaxhighlight>
=={{header|Tailspin}}==
=={{header|Tailspin}}==
<lang tailspin>'Hello World' -> !OUT::write</lang>
<syntaxhighlight lang="tailspin">'Hello World' -> !OUT::write</syntaxhighlight>


=={{header|Tcl}}==
=={{header|Tcl}}==
Output to terminal:
Output to terminal:
<lang tcl>puts "Hello world!"</lang>
<syntaxhighlight lang="tcl">puts stdout {Hello world!}</syntaxhighlight>


Output to arbitrary open, writable file:
Output to arbitrary open, writable file:
<lang tcl>puts $fileID "Hello world!"</lang>
<syntaxhighlight lang="tcl">puts $fileID {Hello world!}</syntaxhighlight>


=={{header|Teco}}==
=={{header|Teco}}==
Outputting to terminal. Please note that ^A means control-A, not a caret followed by 'A', and that $ represent the ESC key.
Outputting to terminal. Please note that ^A means control-A, not a caret followed by 'A', and that $ represent the ESC key.
<lang teco>^AHello world!^A$$</lang>
<syntaxhighlight lang="teco">^AHello world!^A$$</syntaxhighlight>


=={{header|Tern}}==
=={{header|Tern}}==
<lang tern>println("Hello world!");</lang>
<syntaxhighlight lang="tern">println("Hello world!");</syntaxhighlight>


=={{header|Terra}}==
=={{header|Terra}}==
<lang terra>C = terralib.includec("stdio.h")
<syntaxhighlight lang="terra">C = terralib.includec("stdio.h")


terra hello(argc : int, argv : &rawstring)
terra hello(argc : int, argv : &rawstring)
C.printf("Hello world!\n")
C.printf("Hello world!\n")
return 0
return 0
end</lang>
end</syntaxhighlight>


=={{header|Terraform}}==
=={{header|Terraform}}==
<lang hcl>output "result" {
<syntaxhighlight lang="hcl">output "result" {
value = "Hello world!"
value = "Hello world!"
}</lang>
}</syntaxhighlight>
{{Out}}
{{Out}}
<pre>$ terraform init
<pre>$ terraform init
Line 3,269: Line 4,509:


=={{header|TestML}}==
=={{header|TestML}}==
<lang TestML>%TestML 0.1.0
<syntaxhighlight lang="testml">%TestML 0.1.0
Print("Hello world!")</lang>
Print("Hello world!")</syntaxhighlight>

=={{header|TI-57}}==
0.7745
You must then turn the calculator upside down to read the text: [https://aerobarfilms.files.wordpress.com/2023/04/ti-57-hello-world-1.jpg screenshot]


=={{header|TI-83 BASIC}}==
=={{header|TI-83 BASIC}}==
<lang ti83b>Disp "Hello world!</lang>
<syntaxhighlight lang="ti83b">Disp "Hello world!</syntaxhighlight>
(Lowercase letters DO exist in TI-BASIC, though you need an assembly program to enable them.)
(Lowercase letters DO exist in TI-BASIC, though you need an assembly program to enable them.)


=={{header|TI-89 BASIC}}==
=={{header|TI-89 BASIC}}==
<lang ti89b>Disp "Hello world!"</lang>
<syntaxhighlight lang="ti89b">Disp "Hello world!"</syntaxhighlight>

=={{header|Tiny BASIC}}==
{{works with|TinyBasic}}
<syntaxhighlight lang="basic">
10 PRINT "Hello, World!"
20 END
</syntaxhighlight>


=={{header|TMG}}==
=={{header|TMG}}==
Unix TMG:
Unix TMG:
<lang tqs>begin: parse(( = { <Hello, World!> * } ));</lang>
<syntaxhighlight lang="tqs">begin: parse(( = { <Hello, World!> * } ));</syntaxhighlight>


=={{header|TorqueScript}}==
=={{header|TorqueScript}}==
<lang tqs>echo("Hello world!");</lang>
<syntaxhighlight lang="tqs">echo("Hello world!");</syntaxhighlight>


=={{header|TPP}}==
=={{header|TPP}}==
<lang tpp>Hello world!</lang>
<syntaxhighlight lang="tpp">Hello world!</syntaxhighlight>


=={{header|Transact-SQL}}==
=={{header|Transact-SQL}}==


<lang sql>PRINT "Hello world!"</lang>
<syntaxhighlight lang="sql">PRINT "Hello world!"</syntaxhighlight>

=={{header|Transd}}==

<syntaxhighlight lang="scheme">(textout "Hello, World!")</syntaxhighlight>


=={{header|TransFORTH}}==
=={{header|TransFORTH}}==
<lang forth>PRINT " Hello world! "</lang>
<syntaxhighlight lang="forth">PRINT " Hello world! "</syntaxhighlight>


=={{header|Trith}}==
=={{header|Trith}}==
<lang trith>"Hello world!" print</lang>
<syntaxhighlight lang="trith">"Hello world!" print</syntaxhighlight>


=={{header|True BASIC}}==
=={{header|True BASIC}}==
<lang truebasic>
<syntaxhighlight lang="truebasic">
! In True BASIC all programs run in their own window. So this is almost a graphical version.
! In True BASIC all programs run in their own window. So this is almost a graphical version.
PRINT "Hello world!"
PRINT "Hello world!"
END
END
</syntaxhighlight>
</lang>


=={{header|TUSCRIPT}}==
=={{header|TUSCRIPT}}==
<lang tuscript>
<syntaxhighlight lang="tuscript">
$$ MODE TUSCRIPT
$$ MODE TUSCRIPT
PRINT "Hello world!"
PRINT "Hello world!"
</syntaxhighlight>
</lang>
Output:
Output:
<pre>
<pre>
Line 3,316: Line 4,571:
</pre>
</pre>


=={{header|uBasic/4tH}}==
<syntaxhighlight lang="text">Print "Hello world!"</syntaxhighlight>
=={{header|Uniface}}==
=={{header|Uniface}}==
<syntaxhighlight lang="uniface">
<lang Uniface>
message "Hello world!"
message "Hello world!"
</syntaxhighlight>
</lang>

=={{header|Unison}}==
<syntaxhighlight lang="unison">
main = '(printLine "Hello world!")
</syntaxhighlight>


=={{header|UNIX Shell}}==
=={{header|UNIX Shell}}==
{{works with|Bourne Shell}}
{{works with|Bourne Shell}}
<lang bash>#!/bin/sh
<syntaxhighlight lang="bash">#!/bin/sh
echo "Hello world!"</lang>
echo "Hello world!"</syntaxhighlight>


==={{header|C Shell}}===
==={{header|C Shell}}===
<lang csh>#!/bin/csh -f
<syntaxhighlight lang="csh">#!/bin/csh -f
echo "Hello world!\!"</lang>
echo "Hello world!\!"</syntaxhighlight>


We use \! to prevent history substitution. Plain ! at end of string seems to be safe, but we use \! to be sure.
We use \! to prevent history substitution. Plain ! at end of string seems to be safe, but we use \! to be sure.


=={{header|Unlambda}}==
=={{header|Unlambda}}==
<lang unlambda>`r```````````````.G.o.o.d.b.y.e.,. .W.o.r.l.d.!i</lang>
<syntaxhighlight lang="unlambda">`r```````````````.G.o.o.d.b.y.e.,. .W.o.r.l.d.!i</syntaxhighlight>


=={{header|Ursa}}==
=={{header|Ursa}}==
<lang ursa>out "hello world!" endl console</lang>
<syntaxhighlight lang="ursa">out "hello world!" endl console</syntaxhighlight>


=={{header|Ursala}}==
=={{header|Ursala}}==
output as a side effect of compilation
output as a side effect of compilation
<lang Ursala>#show+
<syntaxhighlight lang="ursala">#show+


main = -[Hello world!]-</lang>
main = -[Hello world!]-</syntaxhighlight>
output by a compiled executable
output by a compiled executable
<lang Ursala>#import std
<syntaxhighlight lang="ursala">#import std


#executable ('parameterized','')
#executable ('parameterized','')


main = <file[contents: -[Hello world!]-]>!</lang>
main = <file[contents: -[Hello world!]-]>!</syntaxhighlight>

=={{header|Ursalang}}==
<syntaxhighlight lang="ursa">print("hello woods!")</syntaxhighlight>


=={{header|உயிர்/Uyir}}==
=={{header|உயிர்/Uyir}}==
<lang உயிர்/Uyir>முதன்மை என்பதின் வகை எண் பணி {{
<syntaxhighlight lang="உயிர்/uyir">முதன்மை என்பதின் வகை எண் பணி {{
("உலகத்தோருக்கு வணக்கம்") என்பதை திரை.இடு;
("உலகத்தோருக்கு வணக்கம்") என்பதை திரை.இடு;


முதன்மை = 0;
முதன்மை = 0;
}};</lang>
}};</syntaxhighlight>

=={{header|Uxntal}}==
<syntaxhighlight lang="Uxntal">
( hello-world.tal )
|00 @System [ &vector $2 &wst $1 &rst $1 &eaddr $2 &ecode $1 &pad $1 &r $2 &g $2 &b $2 &debug $1 &halt $1 ]
|10 @Console [ &vector $2 &read $1 &pad $5 &write $1 &error $1 ]

( program )
|0100 @on-reset ( -> )
;hello print-str
HALT
BRK

@print-str ( str* -- )
&while
LDAk .Console/write DEO
INC2 LDAk ?&while
POP2
JMP2r

@HALT ( -- )
#01 .System/halt DEO
JMP2r

@hello "Hello 20 "world! 0a 00
</syntaxhighlight>


=={{header|V}}==
=={{header|V}}==
<lang v>"Hello world!" puts</lang>
<syntaxhighlight lang="v">"Hello world!" puts</syntaxhighlight>


=={{header|Vala}}==
=={{header|Vala}}==
<lang vala>void main(){
<syntaxhighlight lang="vala">void main(){
stdout.printf("Hello world!\n");
stdout.printf("Hello world!\n");
}</lang>
}</syntaxhighlight>

=={{header|Vale}}==
{{works with|Vale|0.2.0}}
<syntaxhighlight lang="vale">
import stdlib.*;

exported func main() {
println("Hello world!");
}
</syntaxhighlight>


=={{header|VAX Assembly}}==
=={{header|VAX Assembly}}==


<syntaxhighlight lang="vax assembly">
<lang VAX Assembly>
desc: .ascid "Hello World!" ;descriptor (len+addr) and text
desc: .ascid "Hello World!" ;descriptor (len+addr) and text
.entry hello, ^m<> ;register save mask
.entry hello, ^m<> ;register save mask
Line 3,374: Line 4,675:
ret ;restore registers, clean stack & return
ret ;restore registers, clean stack & return
.end hello ;transfer address for linker
.end hello ;transfer address for linker
</syntaxhighlight>
</lang>

=={{header|VBA}}==
<syntaxhighlight lang="vb">
Public Sub hello_world_text
Debug.Print "Hello World!"
End Sub
</syntaxhighlight>



=={{header|VBScript}}==
=={{header|VBScript}}==
{{works with|Windows Script Host|5.7}}
{{works with|Windows Script Host|5.7}}
<lang VBScript>WScript.Echo "Hello world!"</lang>
<syntaxhighlight lang="vbscript">WScript.Echo "Hello world!"</syntaxhighlight>


=={{header|Vedit macro language}}==
=={{header|Vedit macro language}}==
<lang vedit>Message("Hello world!")</lang>
<syntaxhighlight lang="vedit">Message("Hello world!")</syntaxhighlight>


=={{header|Verbexx}}==
=={{header|Verbexx}}==
<lang Verbexx>@SAY "Hello world!";</lang>
<syntaxhighlight lang="verbexx">@SAY "Hello world!";</syntaxhighlight>


=={{header|Verilog}}==
<syntaxhighlight lang="verilog">
module main;
initial begin
$display("Hello world!");
$finish ;
end
endmodule
</syntaxhighlight>


=={{header|VHDL}}==
=={{header|VHDL}}==
<lang VHDL>LIBRARY std;
<syntaxhighlight lang="vhdl">LIBRARY std;
USE std.TEXTIO.all;
USE std.TEXTIO.all;


Line 3,402: Line 4,722:
wait; -- needed to stop the execution
wait; -- needed to stop the execution
end process;
end process;
end architecture beh;</lang>
end architecture beh;</syntaxhighlight>


=={{header|Vim Script}}==
=={{header|Vim Script}}==
<lang vim>echo "Hello world!\n"</lang>
<syntaxhighlight lang="vim">echo "Hello world!\n"</syntaxhighlight>


=={{header|Visual Basic}}==
=={{header|Visual Basic}}==
Line 3,411: Line 4,731:
{{works with|Visual Basic|VB6 Standard}}
{{works with|Visual Basic|VB6 Standard}}
Visual Basic 6 is actually designed to create GUI applications, however with a little help from the Microsoft.Scripting Library it is fairly easy to write a simple console application.
Visual Basic 6 is actually designed to create GUI applications, however with a little help from the Microsoft.Scripting Library it is fairly easy to write a simple console application.
<lang vb>Option Explicit
<syntaxhighlight lang="vb">Option Explicit


Private Declare Function AllocConsole Lib "kernel32.dll" () As Long
Private Declare Function AllocConsole Lib "kernel32.dll" () As Long
Line 3,429: Line 4,749:
mStdIn.Read 1
mStdIn.Read 1
Call FreeConsole
Call FreeConsole
End Sub</lang>
End Sub</syntaxhighlight>


=={{header|Visual Basic .NET}}==
=={{header|Visual Basic .NET}}==
<lang vb>Imports System
<syntaxhighlight lang="vb">Imports System


Module HelloWorld
Module HelloWorld
Line 3,438: Line 4,758:
Console.WriteLine("Hello world!")
Console.WriteLine("Hello world!")
End Sub
End Sub
End Module</lang>
End Module</syntaxhighlight>


=={{header|Viua VM assembly}}==
=={{header|Viua VM assembly}}==
<lang>.function: main/0
<syntaxhighlight lang="text">.function: main/0
text %1 local "Hello World!"
text %1 local "Hello World!"
print %1 local
print %1 local
izero %0 local
izero %0 local
return
return
.end</lang>
.end</syntaxhighlight>


=={{header|Vlang}}==
=={{header|V (Vlang)}}==
<lang vlang>fn main() {
<syntaxhighlight lang="go">fn main() {
println('Hello World!')
println('Hello World!')
}</lang>
}</syntaxhighlight>

=={{header|VTL-2}}==
<syntaxhighlight lang="vtl-2">10 ?="Hello world!"</syntaxhighlight>
=={{header|Waduzitdo}}==
<syntaxhighlight lang="waduzitdo">T:Hello world!
S:</syntaxhighlight>


=={{header|Wart}}==
=={{header|Wart}}==


<lang wart>prn "Hello world!"</lang>
<syntaxhighlight lang="wart">prn "Hello world!"</syntaxhighlight>


=={{header|WDTE}}==
=={{header|WDTE}}==
<lang WDTE>io.writeln io.stdout 'Hello world!';</lang>
<syntaxhighlight lang="wdte">io.writeln io.stdout 'Hello world!';</syntaxhighlight>

=={{header|WebAssembly}}==

{{libheader|WASI}}
<syntaxhighlight lang="webassembly">(module $helloworld

;;Import fd_write from WASI, declaring that it takes 4 i32 inputs and returns 1 i32 value
(import "wasi_unstable" "fd_write"
(func $fd_write (param i32 i32 i32 i32) (result i32))
)

;;Declare initial memory size of 32 bytes
(memory 32)

;;Export memory so external functions can see it
(export "memory" (memory 0))
;;Declare test data starting at address 8
(data (i32.const 8) "Hello world!\n")
;;The entry point for WASI is called _start
(func $main (export "_start")
;;Write the start address of the string to address 0
(i32.store (i32.const 0) (i32.const 8))
;;Write the length of the string to address 4
(i32.store (i32.const 4) (i32.const 13))

;;Call fd_write to print to console
(call $fd_write
(i32.const 1) ;;Value of 1 corresponds to stdout
(i32.const 0) ;;The location in memory of the string pointer
(i32.const 1) ;;Number of strings to output
(i32.const 24) ;;Address to write number of bytes written
)
drop ;;Ignore return code
)
)
</syntaxhighlight>


=={{header|Wee Basic}}==
=={{header|Wee Basic}}==
<lang Wee Basic>print 1 "Hello world!"
<syntaxhighlight lang="wee basic">print 1 "Hello world!"
end</lang>
end</syntaxhighlight>


=={{header|Whenever}}==
=={{header|Whenever}}==


<lang whenever>1 print("Hello world!");</lang>
<syntaxhighlight lang="whenever">1 print("Hello world!");</syntaxhighlight>


=={{header|Whiley}}==
=={{header|Whiley}}==


<lang whiley>import whiley.lang.System
<syntaxhighlight lang="whiley">import whiley.lang.System


method main(System.Console console):
method main(System.Console console):
console.out.println("Hello world!")</lang>
console.out.println("Hello world!")</syntaxhighlight>


=={{header|Whitespace}}==
=={{header|Whitespace}}==
There is a "Hello World" - example-program on the [http://compsoc.dur.ac.uk/whitespace/hworld.ws Whitespace-website]
There is a "Hello World" - example-program on the [http://compsoc.dur.ac.uk/whitespace/hworld.ws Whitespace-website]

=={{header|Wisp}}==
Output in Wisp follows the same concepts as [[Scheme]], but replacing outer parentheses with indentation.

With [[Guile]] and wisp installed, this example can be tested in a REPL started with guile --language=wisp, or directly with the command wisp.

<syntaxhighlight lang="wisp">import : scheme base
scheme write
display "Hello world!"
newline</syntaxhighlight>


=={{header|Wolfram Language}}==
=={{header|Wolfram Language}}==
<lang wolfram>Print["Hello world!"]</lang>
<syntaxhighlight lang="wolfram">Print["Hello world!"]</syntaxhighlight>


=={{header|Wren}}==
=={{header|Wren}}==
<lang ecmascript>System.print("Hello world!")</lang>
<syntaxhighlight lang="wren">System.print("Hello world!")</syntaxhighlight>

=={{header|X10}}==
<syntaxhighlight lang="x10">class HelloWorld {
public static def main(args:Rail[String]):void {
if (args.size < 1) {
Console.OUT.println("Hello world!");
return;
}
}
}</syntaxhighlight>


=={{header|X86 Assembly}}==
=={{header|X86 Assembly}}==
Line 3,490: Line 4,876:


Prints "Hello world!" to stdout (and there is probably an even simpler version):
Prints "Hello world!" to stdout (and there is probably an even simpler version):
<lang asm>section .data
<syntaxhighlight lang="asm">section .data
msg db 'Hello world!', 0AH
msg db 'Hello world!', 0AH
len equ $-msg
len equ $-msg
Line 3,504: Line 4,890:
mov ebx, 0
mov ebx, 0
mov eax, 1
mov eax, 1
int 80h</lang>
int 80h</syntaxhighlight>


'''AT&T syntax:''' works with gcc (version 4.9.2) and gas (version 2.5):
'''AT&T syntax:''' works with gcc (version 4.9.2) and gas (version 2.5):


<lang asm>.section .text
<syntaxhighlight lang="asm">.section .text


.globl main
.globl main
Line 3,521: Line 4,907:


.section .data
.section .data
str: .ascii "Hello world!\12"</lang>
str: .ascii "Hello world!\12"</syntaxhighlight>


=={{header|X86-64 Assembly}}==
'''AT&T syntax (x64):'''
===UASM===
<lang>// No "main" used
<syntaxhighlight lang="asm">
option casemap:none
if @Platform eq 1
option dllimport:<kernel32>
ExitProcess proto :dword
option dllimport:none
exit equ ExitProcess
endif
printf proto :qword, :vararg
exit proto :dword

.code
main proc
invoke printf, CSTR("Goodbye, World!",10)
invoke exit, 0
ret
main endp
end
</syntaxhighlight>
===AT&T syntax (Gas)===
<syntaxhighlight lang="asm">// No "main" used
// compile with `gcc -nostdlib`
// compile with `gcc -nostdlib`
#define SYS_WRITE $1
#define SYS_WRITE $1
Line 3,546: Line 4,953:
.data
.data
message: .ascii "Hello, world!\n"</lang>
message: .ascii "Hello, world!\n"</syntaxhighlight>


=={{header|XBasic}}==
=={{header|XBasic}}==
{{works with|Windows XBasic}}
{{works with|Windows XBasic}}
<lang xbasic>
<syntaxhighlight lang="xbasic">
PROGRAM "hello"
PROGRAM "hello"
VERSION "0.0003"
VERSION "0.0003"
Line 3,560: Line 4,967:
END FUNCTION
END FUNCTION
END PROGRAM
END PROGRAM
</syntaxhighlight>
</lang>


=={{header|xEec}}==
=={{header|xEec}}==
<syntaxhighlight lang="xeec">
<lang xEec>
h#10 h$! h$d h$l h$r h$o h$w h#32
h#10 h$! h$d h$l h$r h$o h$w h#32
h$o h$l h$l h$e h$H >o o$ p jno
h$o h$l h$l h$e h$H >o o$ p jno
</syntaxhighlight>
</lang>


=={{header|XL}}==
=={{header|XL}}==
<lang XL>use XL.UI.CONSOLE
<syntaxhighlight lang="xl">use XL.UI.CONSOLE
WriteLn "Hello world!"</lang>
WriteLn "Hello world!"</syntaxhighlight>


=={{header|XLISP}}==
=={{header|XLISP}}==
<lang xlisp>(DISPLAY "Hello world!")
<syntaxhighlight lang="xlisp">(DISPLAY "Hello world!")
(NEWLINE)</lang>
(NEWLINE)</syntaxhighlight>


=={{header|XPL0}}==
=={{header|XPL0}}==
<lang XPL0>code Text=12;
<syntaxhighlight lang="xpl0">code Text=12;
Text(0, "Hello world!
Text(0, "Hello world!
")</lang>
")</syntaxhighlight>

=={{header|XPath}}==
<syntaxhighlight lang="xpath">'Hello world&#xA;'</syntaxhighlight>


=={{header|XSLT}}==
=={{header|XSLT}}==
With a literal newline:
<lang xml><xsl:text>Hello world!
<syntaxhighlight lang="xml"><xsl:text>Hello world!
</xsl:text></lang>
</xsl:text></syntaxhighlight>
Or, with an explicit newline:
<syntaxhighlight lang="xml"><xsl:text>Hello world!&#xA;</xsl:text></syntaxhighlight>

=={{header|Yabasic}}==
<syntaxhighlight lang="yabasic">
print "Hello world!"
</syntaxhighlight>

=={{header|YAMLScript}}==

All the following examples are valid YAML and valid YAMLScript.

This is a good example of various ways to write function calls in YAMLScript.

Since function calls must fit into their YAML context, which may be mappings or scalars;
it is actually useful to support these variants.

<syntaxhighlight lang="yaml">
!yamlscript/v0

say: "Hello, world!"

=>: (say "Hello, world!")

=>: say("Hello, world!")

say:
=>: "Hello, world!"

say: ("Hello, " + "world!")

say: ."Hello," "world!"

say "Hello,": "world!"

say "Hello," "world!":
</syntaxhighlight>


=={{header|Yorick}}==
=={{header|Yorick}}==
<lang yorick>write, "Hello world!"</lang>
<syntaxhighlight lang="yorick">write, "Hello world!"</syntaxhighlight>


=={{header|Z80 Assembly}}==
=={{header|Z80 Assembly}}==
Line 3,592: Line 5,040:
Using the Amstrad CPC firmware:
Using the Amstrad CPC firmware:


<lang z80>org $4000
<syntaxhighlight lang="z80">org $4000


txt_output: equ $bb5a
txt_output: equ $bb5a
Line 3,609: Line 5,057:
ret
ret


world: defm "Hello world!\r\n\0"</lang>
world: defm "Hello world!\r\n\0"</syntaxhighlight>


=={{header|zkl}}==
=={{header|zkl}}==
<lang zkl>println("Hello world!");</lang>
<syntaxhighlight lang="zkl">println("Hello world!");</syntaxhighlight>
{{omit from|VBA|VBA can't write or output to console}}
{{omit from|VBA|VBA can't write or output to console}}

=={{header|Zig}}==

'''Works with:''' 0.10.x, 0.11.x, 0.12.0-dev.1389+42d4d07ef

<syntaxhighlight lang="zig">const std = @import("std");

pub fn main() std.fs.File.WriteError!void {
const stdout = std.io.getStdOut();

try stdout.writeAll("Hello world!\n");
}</syntaxhighlight>

=={{header|Zoea}}==
<syntaxhighlight lang="zoea">program: hello_world
output: "Hello world!"</syntaxhighlight>

=={{header|Zoea Visual}}==
[http://zoea.co.uk/examples/zv-rc/Hello_world.png Hello World]


=={{header|Zoomscript}}==
=={{header|Zoomscript}}==
For typing:
For typing:
<lang Zoomscript>print "Hello world!"</lang>
<syntaxhighlight lang="zoomscript">print "Hello world!"</syntaxhighlight>
For importing:
For importing:


Line 3,623: Line 5,090:


=={{header|ZX Spectrum Basic}}==
=={{header|ZX Spectrum Basic}}==
<lang zxbasic>10 print "Hello world!"</lang>
<syntaxhighlight lang="zxbasic">10 print "Hello world!"</syntaxhighlight>

Revision as of 11:49, 8 May 2024

Task
Hello world/Text
You are encouraged to solve this task according to the task description, using any language you may know.
Hello world/Text is part of Short Circuit's Console Program Basics selection.
Task

Display the string Hello world! on a text console.

Related tasks



0815

<:48:x<:65:=<:6C:$=$=$$~<:03:+
$~<:ffffffffffffffb1:+$<:77:~$
~<:fffffffffffff8:x+$~<:03:+$~
<:06:x-$x<:0e:x-$=x<:43:x-$

11l

print(‘Hello world!’)

360 Assembly

Using native SVC (Supervisor Call) to write to system console:

HELLO    CSECT 
         USING HELLO,15
         LA    1,MSGAREA     Point Register 1 to message area
         SVC   35            Invoke SVC 35 (Write to Operator) 
         BR    14            Return
MSGAREA  EQU   *             Message Area
         DC    AL2(19)       Total area length = 19 (Prefix length:4 + Data Length:15) 
         DC    XL2'00'       2 bytes binary of zeros
         DC    C'Hello world!'  Text to be written to system console
         END

Using WTO Macro to generate SVC 35 and message area:

         WTO   'Hello world!'
         BR    14            Return
         END

IBM Z HL/ASM

Using Modern IBM Z High Level assembler to write 'Hello World' to the Unix System Services 'stdout' file descriptor

        PRINT ON,GEN,DATA
HELLO   CSECT
HELLO   RMODE ANY
HELLO   AMODE 31
*
* Prolog
*
        SAVE (14,12)
        BASR R12,0
        USING *,R12
        STORAGE OBTAIN,LENGTH=DYNL,ADDR=(R11)
        USING DYNAREA,R11

        LA R2,DSA
        ST R2,8(,R13)
        ST R13,DSA+4
        LR R13,R2
*
* Body
* Write Hello World to STDOUT
*

*
* Store values into parameter list
*
        MVC REC(HWL),HW
        LA  R1,REC
        ST  R1,RECA
        LA  R1,HWL
        ST  R1,RECL
        L   R1,STDOUT
        ST  R1,FD
        L   R1,BPXALET
        ST  R1,ALET

        CALL  BPX1WRT,(FD,                                             x
               RECA,                                                   x
               ALET,                                                   x
               RECL,                                                   x
               RV,                                                     x
               RC,                                                     x
               RN),MF=(E,BPXWRTD)

        L   R8,RV
        L   R9,RC
        L   R10,RN
*
* Epilog
*
        L   R13,DSA+4
        STORAGE RELEASE,LENGTH=DYNL,ADDR=(R11)
        RETURN (14,12),RC=0

*
* Statics, Dynamic Storage, Equates follows
*
* Naming convention:
* Suffixes:
*  L : length
*  S : static
*  D : dynamic
*  A : address

        LTORG
*
* Statics (constants)
*
STDIN   DC F'0'
STDOUT  DC F'1'
STDERR  DC F'2'
BPXALET DC F'0'
BPX1WRT DC V(BPX1WRT)

BPXWRTS CALL  ,(0,0,0,0,0,0,0),MF=L
BPXWRTL EQU *-BPXWRTS

HW      DC C'Hello World'
NEWLINE DC X'15'
HWL     EQU *-HW

*
* Dynamic (storage obtain'ed) area
*
DYNAREA DSECT
*
* Dynamic Save Area regs always first
*
DSA   DS 18F

*
* Working storage
*
FD      DS  F

RECSIZE EQU RECEND-*
REC     DS CL80
RECEND  EQU *
RECA    DS  A
BPXWRTD DS  CL(BPXWRTL)
ALET    DS  F
RECL    DS  F
RV      DS  F
RC      DS  F
RN      DS  F

DYNL EQU *-DYNAREA
*
*
* End of working storage
*

*
* Equates
*
R0      EQU 0
R1      EQU 1
R2      EQU 2
R3      EQU 3
R4      EQU 4
R5      EQU 5
R6      EQU 6
R7      EQU 7
R8      EQU 8
R9      EQU 9
R10     EQU 10
R11     EQU 11
R12     EQU 12
R13     EQU 13
R14     EQU 14
R15     EQU 15
        END

4DOS Batch

echo Hello world!

6502 Assembly

; goodbyeworld.s for C= 8-bit machines, ca65 assembler format.
; String printing limited to strings of 256 characters or less.

a_cr	= $0d		; Carriage return.
bsout	= $ffd2		; C64 KERNEL ROM, output a character to current device.
			; use $fded for Apple 2, $ffe3 (ascii) or $ffee (raw) for BBC.
	.code

	ldx #0		; Starting index 0 in X register.
printnext:
	lda text,x	; Get character from string.
	beq done	; If we read a 0 we're done.
	jsr bsout	; Output character. 
	inx		; Increment index to next character.
	bne printnext	; Repeat if index doesn't overflow to 0.
done:
	rts		; Return from subroutine.

	.rodata

text:
	.byte	"Hello world!", a_cr, 0

6800 Assembly

        .cr  6800
        .tf  gbye6800.obj,AP1
        .lf  gbye6800
;=====================================================;
;        Hello world! for the Motorola 6800        ;
;                 by barrym 2013-03-17                ;
;-----------------------------------------------------;
; Prints the message "Hello world!" to an ascii    ;
;   terminal (console) connected to a 1970s vintage   ;
;   SWTPC 6800 system, which is the target device for ;
;   this assembly.                                    ;
; Many thanks to:                                     ;
;   swtpc.com for hosting Michael Holley's documents! ;
;   sbprojects.com for a very nice assembler!         ;
;   swtpcemu.com for a very capable emulator!         ;
; reg x is the string pointer                         ;
; reg a holds the ascii char to be output             ;
;-----------------------------------------------------;
outeee   =   $e1d1      ;ROM: console putchar routine
        .or  $0f00
;-----------------------------------------------------;
main    ldx  #string    ;Point to the string
        bra  puts       ;  and print it
outs    jsr  outeee     ;Emit a as ascii
        inx             ;Advance the string pointer
puts    ldaa ,x         ;Load a string character
        bne  outs       ;Print it if non-null
        swi             ;  else return to the monitor
;=====================================================;
string  .as  "Hello world!",#13,#10,#0
        .en

8080 Assembly

	; This is Hello World, written in 8080 assembly to run under CP/M
	; As you can see, it is similar to the 8086, and CP/M is very
	; similar to DOS in the way it is called.
	org	100h	; CP/M .COM entry point is 100h - like DOS
	mvi	c,9	; C holds the syscall, 9 = print string - like DOS
	lxi	d,msg	; DE holds a pointer to the string
	jmp	5	; CP/M calls are accessed through the jump at 05h
	; Normally you'd CALL it, but since you'd end the program by RETurning,
	; JMP saves a byte (if you've only got 64k of address space you want to
	; save bytes). 
msg:	db	'Hello world!$'

8086 Assembly

DOSSEG
.MODEL TINY
.DATA
TXT DB "Hello world!$"
.CODE
START:
	MOV ax, @DATA
	MOV ds, ax
	
	MOV ah, 09h		; prepare output function
	MOV dx, OFFSET TXT	; set offset
	INT 21h			; output string TXT
	
	MOV AX, 4C00h 		; go back to DOS
	INT 21h
END START

With A86 or NASM syntax:

  org 100h

  mov dx, msg
  mov ah, 9
  int 21h

  mov ax, 4c00h
  int 21h

msg:
  db "Hello world!$"

8th

"Hello world!\n" . bye

AArch64 Assembly

.equ STDOUT, 1
.equ SVC_WRITE, 64
.equ SVC_EXIT, 93

.text
.global _start

_start:
	stp x29, x30, [sp, -16]!
	mov x0, #STDOUT
	ldr x1, =msg
	mov x2, 13
	mov x8, #SVC_WRITE
	mov x29, sp
	svc #0 // write(stdout, msg, 13);
	ldp x29, x30, [sp], 16
	mov x0, #0
	mov x8, #SVC_EXIT
	svc #0 // exit(0);

msg:	.ascii "Hello World!\n"
.align 4

ABAP

REPORT zgoodbyeworld.
  WRITE 'Hello world!'.

ACL2

(cw "Hello world!~%")

Acornsoft Lisp

Since there is no string data type in the language, a symbol (an identifier or 'character atom') must be used instead. When writing a symbol in source code, exclamation mark is an escape character that allows characters such as spaces and exclamation marks to be treated as part of the symbol's name. Some output functions will include exclamation mark escapes when outputting such symbols, and others, such as printc, will not.

(printc 'Hello! world!!)

The single quote in front of Hello! world!! makes it an expression that evaluates to the symbol itself; otherwise, it would be treated as a variable and its value (if it had one) would be printed instead.

Action!

Proc Main()
 Print("Hello world!")
Return

ActionScript

trace("Hello world!");

Ada

Works with: GCC version 4.1.2
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
begin
  Put_Line ("Hello world!");
end Main;

Agda

For Agda 2.6.3, based on its documentation.

module HelloWorld where

open import Agda.Builtin.IO using (IO)
open import Agda.Builtin.Unit renaming ( to Unit)
open import Agda.Builtin.String using (String)

postulate putStrLn : String -> IO Unit
{-# FOREIGN GHC import qualified Data.Text as T #-}
{-# COMPILE GHC putStrLn = putStrLn . T.unpack #-}

main : IO Unit
main = putStrLn "Hello world!"

Agena

print( "Hello world!" )

Aime

o_text("Hello world!\n");

or:

integer
main(void)
{
    o_text("Hello world!\n");

    return 0;
}

Algae

printf("Hello world!\n");

ALGOL 60

'BEGIN'
    OUTSTRING(1,'('Hello world!')');
    SYSACT(1,14,1)
'END'

ALGOL 68

main: (
  printf($"Hello world!"l$)
)

ALGOL W

begin
    write( "Hello world!" )
end.

ALGOL-M

BEGIN
    WRITE( "Hello world!" );
END

Alore

Print('Hello world!')

Amazing Hopper

1)

main:
   {"Hello world!\n"}print
exit(0)
execute with:  hopper helloworld.com

2)

#include <hopper.h>
main:
   exit("Hello world!\n")
execute with:  hopper helloworld.com -d

3)

main:
  {"Hello world!\n"}return
execute with:  hopper helloworld.com -d

AmbientTalk

system.println("Hello world!")

AmigaE

PROC main()
  WriteF('Hello world!\n')
ENDPROC

AngelScript

void main() { print("Hello world\n"); }

AntLang

Note, that "Hello, World!" prints twice in interactive mode. One time as side-effect and one as the return value of echo.

echo["Hello, World!"]

Anyways

There was a guy called Hello World
"Ow!" it said.
That's all folks!

APL

'Hello world!'

AppleScript

To show in Script Editor Result pane:

"Hello world!"

To show in Script Editor Event Log pane:

log "Hello world!"

Applesoft BASIC

Important Note: Although Applesoft BASIC allowed the storage and output of mixed-case strings, the ability to enter mixed-case via the keyboard and to output mixed-case on the default display was not offered as standard equipment on the original Apple II/II+. Since Applesoft WAS the default programming language for the Apple II+, perhaps some flexibility in the task specification could be offered, for this and for other systems that lacked proper mixed-case I/O capabilities in at least one popular configuration.

 PRINT "Hello world!"

Apricot

(puts "Hello world!")

Arc

(prn "Hello world!")

Arendelle

"Hello world!"

Argile

use std
print "Hello world!"

compile with: arc hello_world.arg -o hello_world.c && gcc -o hello_world hello_world.c

ARM Assembly

.global main

message:
    .asciz "Hello world!\n"
    .align 4

main:
    ldr r0, =message
    bl printf

    mov r7, #1
    swi 0

Alternative versions

 Developed on an Acorn A5000 with RISC OS 3.10 (30 Apr 1992)
 Using the assembler contained in ARM BBC BASIC V version 1.05 (c) Acorn 1989

The Acorn A5000 is the individual computer used to develop the code,
the code is applicable to all the Acorn Risc Machines (ARM)
produced by Acorn and the StrongARM produced by digital.

 In the BBC BASIC part of the program I have included:
    OS_WriteC  = &00
    OS_WriteO  = &02
    OS_NewLine = &03
 this is so I can write SWI OS_WriteC etc instead of SWI &0 to make the assembler more legible

 (a) method1 - output the text character by character until the terminating null (0) is seen

     .method1_vn00
           ADR     R8  , method1_string    \ the ARM does not have an ADR instruction
                                           \ the assembler will work out how far the data item
                                           \ is from here (in this case a +ve relative offset)
                                           \ and so will produce an ADD R8 , PC, offset to method1_string
                                           \ a magic trick by the ARM assembler

     .method1_loop
           LDRB     R0  , [R8], #1         \ load the byte found at address in R8 into R0
                                           \ then post increment the address in R8 in preparation
                                           \ for the next byte (the #1 is my choice for the increment)
           CMP      R0  , #0               \ has the terminating null (0) been reached
           SWINE    OS_WriteC              \ when not the null output the character in R0
                                           \ (every opportunity to have a SWINE in your program should be taken)
           BNE      method1_loop           \ go around the loop for the next character if not reached the null

           SWI      OS_NewLine             \ up to you if you want a newline

           MOVS     PC  , R14              \ return
                                           \ when I call an operating system function it no longer operates
                                           \ in 'user mode' and it has its own R14, and anyway the operating system
                                           \ is too polite to write rubbish into this return address


     .method1_string
           EQUS "Hello world!"             \ the string to be output
           EQUB &00                        \ a terminating null (0)
           ALIGN                           \ tell the assembler to ensure that the next item is on a word boundary




 (b) method2 - get the supplied operating system to do the work

     .method2_vn00
           ADR     R0   , method2_string   \ the ARM does not have an ADR instruction
                                           \ the assembler will work out how far the data item
                                           \ is from here (in this case a +ve relative offset)
                                           \ and so will produce an ADD R0 , PC, offset to method2_string
                                           \ a magic trick by the ARM assembler

           SWI      OS_WriteO              \ R0 = pointer to null-terminated string to write

           SWI      OS_NewLine             \ up to you if you want a newline

           MOVS    PC   , R14              \ return
 
     .method2_string
           EQUS "hELLO WORLD!"             \ the string to be output
           EQUB &00                        \ a terminating null (0)
           ALIGN                           \ tell the assembler to ensure that the next item is on a word boundary

ArnoldC

IT'S SHOWTIME
TALK TO THE HAND "Hello world!"
YOU HAVE BEEN TERMINATED

Arturo

print "Hello world!"
Output:
Hello world!

AsciiDots

.-$'Hello, World!'

Astro

print "Hello world!"

Asymptote

write('Hello world!');

Atari BASIC

10 PRINT "Hello World"

ATS

implement main0 () = print "Hello world!\n"

AutoHotkey

script launched from windows explorer

DllCall("AllocConsole")
FileAppend, Goodbye`, World!, CONOUT$
FileReadLine, _, CONIN$, 1

scripts run from shell [requires Windows XP or higher; older Versions of Windows don´t have the "AttachConsole" function]

DllCall("AttachConsole", "int", -1)
FileAppend, Goodbye`, World!, CONOUT$
SendInput Hello world!{!}

AutoIt

ConsoleWrite("Hello world!" & @CRLF)

AutoLISP

(printc "Hello World!")

Avail

Print: "Hello World!";

AWK

BEGIN{print "Hello world!"}


"BEGIN" is a "special pattern" - code within "{}" is executed before the input file is read, even if there is no input. "END" is a similar pattern, for after completion of main processing.

END {
     print "Hello world!"
    }

For a file containing data, the work can be done in the "body". The "//" is "match anything" so gets the first data, the "exit" halts processing the file (any "END" would then be executed). Or instead of //, simply 1 is true.

//  { 
    print "Hello world!" 
    exit
    }


For a "single record" file.

//  { 
    print "Hello world!" 
    }

For a "single record" file containing - Hello world! -. The "default" action for a "pattern match" (the "/" and "/" define a "pattern" to match data) is to "print" the record.

//

Axe

Note that the i here is the imaginary i, not the lowercase letter i.

Disp "Hello world!",i

B

Works with: The Amsterdam Compiler Kit - B version V6.1pre1
main()
{
    putstr("Hello world!*n");
    return(0);
}

B4X

Log("Hello world!")

Babel

"Hello world!" <<

BabyCobol

      * Since no quotes are used, two undeclared fields (variables) are printed.
      * Their default values are their own names in uppercase.
       IDENTIFICATION DIVISION.
           PROGRAM-ID. USER OUTPUT.
       PROCEDURE DIVISION.
           DISPLAY HELLO WORLD.

Bait

fun main() {
    println('Hello World!')
}

Ballerina

import ballerina/io; 

public function main() {
    io:println("Hello World!"); 
}

bash

echo "Hello world!"

BASIC

Works with: BASICA
Works with: Chipmunk Basic
Works with: Commodore BASIC
Works with: GW-BASIC
Works with: IS-BASIC
Works with: Just BASIC
Works with: Liberty BASIC
Works with: Locomotive Basic
Works with: M2000 Interpreter
Works with: MSX BASIC
Works with: QBasic
Works with: Quite BASIC
Works with: Run BASIC
Works with: Tiny BASIC
Works with: ZX Spectrum Basic
10 print "Hello world!"


Works with: 7Basic
Works with: Applesoft BASIC
Works with: BaCon
Works with: BASIC256
Works with: FreeBASIC
Works with: IS-BASIC
Works with: M2000 Interpreter
Works with: QBasic
Works with: QB64
Works with: Script Basic
Works with: SmallBASIC
Works with: Yabasic
PRINT "Hello world!"

BASIC256

PRINT "Hello world!"

Batch File

Under normal circumstances, when delayed expansion is disabled

echo Hello world!

If delayed expansion is enabled, then the ! must be escaped twice

setlocal enableDelayedExpansion
echo Hello world!^^!

Battlestar

const hello = "Hello world!\n"

print(hello)

BBC BASIC

      PRINT "Hello world!"

bc

"Hello world!
"

BCPL

GET "libhdr"

LET start() = VALOF
{ writef("Hello world!")
  RESULTIS 0
}

Beef

Using System;
namespace HelloWorld {
  class Program
  {
    static void Main()
    {
      Console.Writeln("Hello World!");
    }
  }
}

beeswax

Straightforward:

*`Hello, World!

Less obvious way:

>`ld!
`
 r
  o
   W
    `
     b` ,olleH`_

Even less obvious, demonstrating the creation and execution order of instruction pointers, and the hexagonal layout of beeswax programs:

r  l
 l o
  ``
ol`*`,d!
   ``
   e H
   W

Befunge

52*"!dlroW ,olleH">:#,_@

Binary Lambda Calculus

As explained at https://www.ioccc.org/2012/tromp/hint.html

 Hello world!

Bird

It's not possible to print exclamation marks in Bird which is why it is not used in this example.

use Console

define Main
    Console.Println "Hello world"
end

Blade

echo 'Hello world!'

or

print('Hello world!')

or

import io
io.stdout.write('Hello world!')

Blast

# This will display a goodbye message on the terminal screen
.begin
display "Hello world!"
return
# This is the end of the script.

BlitzMax

print "Hello world!"

Blue

Linux/x86

global _start

: syscall ( num:eax -- result:eax ) syscall ;

: exit ( status:edi -- noret ) 60 syscall ;
: bye ( -- noret ) 0 exit ;

1 const stdout

: write ( buf:esi len:edx fd:edi -- ) 1 syscall drop ;
: print ( buf len -- ) stdout write ;

: greet ( -- ) s" Hello world!\n" print ;

: _start ( -- noret ) greet bye ;

blz

print("Hello world!")

BML

display "Hello world!"

Boo

print "Hello world!"

bootBASIC

10 print "Hello world!"

BQN

Works in: CBQN

•Out "Hello world!"

Brace

#!/usr/bin/env bx
use b
Main:
	say("Hello world!")

Bracmat

put$"Hello world!"

Brainf***

To print text, we need the ascii-value of each character to output.
So, we wanna make a series of round numbers going like:

10	close to newline and carriage return
30	close to ! and SPACE
40	close to COMMA
70	close to G
80	close to W
90	close to b
100	is d and close to e and l
110	close to o
120	close to y

forming all the letters we need if we just add up a bit

Commented version:

+++++ +++++		First cell 10 (its a counter and we will be "multiplying")

[
>+			10 times 1 is 10
>+++			10 times 3 is 30
>++++			etc etc
>+++++ ++
>+++++ +++
>+++++ ++++
>+++++ +++++
>+++++ ++++++
>+++++ +++++++
<<<<<<<<< -		go back to counter and subtract 1
]

printing G
>>>> + .

o twice
>>>> + ..

d
< .

b
< +++++ +++ .

y
>>> + .

e
<< + .

COMMA
<<<< ++++ .

SPACE
< ++ .

W
>>> +++++ ++ .

o
>>> .

r
+++ .

l
< +++++ ++ .

d
----- --- .

!
<<<<< + .

CRLF
< +++ . --- .

Uncommented:

++++++++++[>+>+++>++++>+++++++>++++++++>+++++++++>++
++++++++>+++++++++++>++++++++++++<<<<<<<<<-]>>>>+.>>>
>+..<.<++++++++.>>>+.<<+.<<<<++++.<++.>>>+++++++.>>>.+++.
<+++++++.--------.<<<<<+.<+++.---.

It can most likely be optimized, but this is a nice way to show how character printing works in Brainf*** :)

Brat

p "Hello world!"

Brlcad

The mged utility can output text to the terminal:

echo Hello world!

Bruijn

Ignore stdin by not referring to the abstraction:

main ["Hello world!"]

Burlesque

"Hello world!"sh

Although please note that sh actually does not print anything.

C

Works with: gcc version 4.0.1
#include <stdlib.h>
#include <stdio.h>

int main(void)
{
  printf("Hello world!\n");
  return EXIT_SUCCESS;
}

Or:

#include <stdlib.h>
#include <stdio.h>

int main(void)
{
  puts("Hello world!");
  return EXIT_SUCCESS;
}

Or, the eternal favourite :)

#include<stdio.h>

int main()
{
  printf("\nHello world!");
  return 0;
}

or better yet...

#include<stdio.h>

int main()
{
	return printf("\nHello World!");
}

C#

Works with: Mono version 1.2
Works with: Visual C# version 2003
namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            System.Console.WriteLine("Hello world!");
        }
    }
}
Works with: Visual C# version 9.0+

C# 9.0 allows statements at the top level of a source file (a compilation_unit in the specification) between any using statements and namespace declarations. These statements become the program entry point and are placed in a method in a compiler-generated type.

System.Console.WriteLine("Hello world!");

or

using System;
Console.WriteLine("Hello world!");

C++

#include <iostream>

int main() {
  std::cout << "Hello world!\n";
}

Since C++23’s addition of the <print> header and the standard library module std we could now write this:

import module std; // here does the same thing as #include <print>

int main() {
  std::print("Hello world!\n");
}

C++/CLI

using namespace System;
int main()
{
  Console::WriteLine("Hello world!");
}

C1R

Hello_world/Text
Output:
$ echo Hello_world/Text >hw.c1r
$ ./c1r hw.c1r
$ ./a.out
Hello world!

C2

module hello_world;
import stdio as io;

func i32 main(i32 argc, char** argv) {
    io.printf("Hello World!\n");
    return 0;
}

C3

import std::io;

fn void main() 
{
    io::printn("Hello, World!");
}

Casio BASIC

Locate 1,1,"Hello World!"

or just

"Hello World!"

Cat

"Hello world!" writeln

Cduce

print "Hello world!";;

CFEngine

#!/usr/bin/env cf-agent
# without --no-lock option to cf-agent
# this output will only occur once per minute
# this is by design.
bundle agent main
{
  reports:
    "Hello world!";
}

See https://docs.cfengine.com/docs/master/examples.html for a more complete example and introduction.

Chapel

writeln("Hello world!");

Chef

Goodbye World Souffle.
 
Ingredients.
71 g green beans
111 cups oil
98 g butter
121 ml yogurt
101 eggs
44 g wheat flour
32 zucchinis
119 ml water
114 g red salmon
108 g lard
100 g dijon mustard
33 potatoes
 
Method.
Put potatoes into the mixing bowl.
Put dijon mustard into the mixing bowl.
Put lard into the mixing bowl.
Put red salmon into the mixing bowl.
Put oil into the mixing bowl.
Put water into the mixing bowl.
Put zucchinis into the mixing bowl.
Put wheat flour into the mixing bowl.
Put eggs into the mixing bowl.
Put yogurt into the mixing bowl.
Put butter into the mixing bowl.
Put dijon mustard into the mixing bowl.
Put oil into the mixing bowl.
Put oil into the mixing bowl.
Put green beans into the mixing bowl.
Liquefy contents of the mixing bowl.
Pour contents of the mixing bowl into the baking dish.
 
Serves 1.

Chipmunk Basic

10 print "Hello world!"

ChucK

<<< "Hello world!">>>;

Cind

execute() {
    host.println("Hello world!");
}

Clay

main() {
    println("Hello world!");
}

Clean

Start = "Hello world!"

Clio

'hello world!' -> print

Clipper

? "Hello world!"

CLIPS

(printout t "Hello world!" crlf)

CLU

start_up = proc ()
    po: stream := stream$primary_output()
    stream$putl(po, "Hello world!")
end start_up

Clojure

(println "Hello world!")

CMake

message(STATUS "Hello world!")

This outputs

-- Hello world!

COBOL

Using fixed format.

Works with: OpenCOBOL
	program-id. hello.
	procedure division.
		display "Hello world!".
		stop run.

Using relaxed compilation rules, the hello program can become a single DISPLAY statement.

Works with: GnuCOBOL
display"Hello, world".
prompt$ cobc -x -frelax-syntax -free hello.cob
hello.cob: 1: Warning: PROGRAM-ID header missing - assumed
hello.cob: 1: Warning: PROCEDURE DIVISION header missing - assumed

prompt$ ./hello
Hello, world

Note how COBOL can handle the DISPLAY reserved word without a space before the quoted string, the quote being a compile time scan delimiter. The full stop period after the single statement is still mandatory, at least for GnuCOBOL and a clean compile to executable.

Cobra

class Hello
    def main
        print 'Hello world!'

CoffeeScript

Works with: Node.js
console.log "Hello world!"
Works with: Rhino engine
print "Hello world!"

ColdFusion

<cfoutput>Hello world!</cfoutput>

Comal

PRINT "Hello world!"

Comefrom0x10

'Hello world!'
"Hello world!"

Commodore BASIC

By default some Commodore computers boot into uppercase/graphics mode (C64, C128, VIC-20, Plus 4, etc.) while others (PET, CBM etc.) boot into lowercase/uppercase mode. Therefore, depending on machine used, the CHR$(14) may or may not be required to switch into mixed-case mode.

10 print chr$(147);chr$(14);:REM 147=clear screen, 14=switch to lowercase mode
20 print "Hello world!"
30 end
Output:
Hello world!

Common Lisp

(format t "Hello world!~%")

Or

(print "Hello world!")

Alternate solution

I use Allegro CL 10.1

;; Project : Hello world/Text

(format t "~a" "Hello world!")

Output:

Hello world!

Component Pascal

MODULE Hello;
	IMPORT Out;
	
	PROCEDURE Do*;
	BEGIN
		Out.String("Hello world!"); Out.Ln
	END Do;
END Hello.

Run command Hello.Do by commander.

Coq

Require Import Coq.Strings.String.

Eval compute in ("Hello world!"%string).

Corescript

print Hello world!

Cowgol

include "cowgol.coh";
print("Hello world!");
print_nl();


Crack

import crack.io cout;
cout `Hello world!\n`;

Craft Basic

print "Hello world!"

Creative Basic

OPENCONSOLE

PRINT"Hello world!"

'This line could be left out.
PRINT:PRINT:PRINT"Press any key to end."

'Keep the console from closing right away so the text can be read.
DO:UNTIL INKEY$<>""

CLOSECONSOLE

END

Crystal

puts "Hello world!"

Curto

." Hola, mundo!"

D

Works with: D version 2.0
import std.stdio;

void main() {
    writeln("Hello world!");
}

Dafny

method Main() {
  print "hello, world!\n";
  assert 10 < 2;
}

Dao

io.writeln( 'Hello world!' )

Dart

main() {
    var bye = 'Hello world!';
    print("$bye");
}

DataWeave

"Hello world!"

DBL

;
;       Hello world for DBL version 4 by Dario B.
;
                                PROC
;------------------------------------------------------------------
        XCALL FLAGS (0007000000,1)           ;Suppress STOP message

        OPEN (1,O,'TT:')
        WRITES (1,"Hello world")

        DISPLAY (1,"Hello world",10)
        DISPLAY (1,$SCR_MOV(-1,12),"again",10)  ;move up, right and print

        CLOSE 1
END

Dc

[Hello world!]p

...or print a numerically represented string.

5735816763073014741799356604682 P

DCL

$ write sys$output "Hello world!"

DDNC

DDNC can only output to a single 7-segment LED display digit, so first we must convert each character into its 7-segment equivalent numerical value.

The three horizontal bars are assigned bits 6, 3, and 0 from top to bottom. The top two vertical bars are assigned bits 5 and 4 while the bottom two vertical bars are assigned bits 2 and 1 from left to right.

Because DDNC can only interpret literals in decimal, each binary number was converted and stored in consecutive memory cells starting at cell 10.

The code can be divided into three sections. The first stores the character numbers in order in an array. The second sets up the loop by loading a delay of 500 milliseconds to slot 3, the start address of the character array in memory to slot 2, and the number of times to loop (14) plus one to slot 5. The third section starts the loop of displaying the characters, waiting for the delay time, incrementing the pointer, decrementing the counter, and checking if the counter is negative to know whether to continue the loop.

0 111 10
0 15 11
0 15 12
0 31 13
0 47 14
0 59 15
0 125 16
0 3 17
0 0 18
0 63 19
0 15 20
0 12 21
0 36 22
0 31 23
0 17 24

0 500 3
0 10 2
0 15 5

60 4
2 2 1
80 1
72 3
30 2
31 5
62 5
61 4
64

Delphi

program ProjectGoodbye;
{$APPTYPE CONSOLE}
begin
  WriteLn('Hello world!');
end.

DeviousYarn

o:"Hello world!

DIBOL-11

          START     ;Hello World

          RECORD  HELLO
,         A11, 'Hello World'

          PROC
          XCALL FLAGS (0007000000,1)          ;Suppress STOP message

          OPEN(8,O,'TT:')
          WRITES(8,HELLO)
          END

Diego

Once the caller has met the computer and its printer...

with_computer(comp1)_printer(lp1)_text(Hello World!);

If the caller is the computer...

with_me()_printer(lp1)_text(Hello World!);

...or can be shortened as...

me()_ptr(lp1)_txt(Hello World!);

If the computer has more than one printer...

me()_printer()_text(Hello World!);

If there are more than one computer which have zero or more printers...

with_computer()_printer()_text(Hello World!);

If there are zero or more printers connected to any thing (device)...

with_printer()_text(Hello World!);

DIV Games Studio

PROGRAM HELLOWORLD;

BEGIN

    WRITE_TEXT(0,160,100,4,"HELLO WORLD!");
    LOOP
        FRAME;
    END
END

DM

/client/New()
    ..()
    src << "Hello world!"

Draco

proc nonrec main() void:
    writeln("Hello world!")
corp

Dragon

showln "Hello world!"

DreamBerd

print "Hello world!"!

dt

"Hello world!" pl

DWScript

PrintLn('Hello world!');

Dyalect

print("Hello world!")

Dylan

module: hello-world

format-out("%s\n", "Hello world!");

Dylan.NET

Works with: Mono version 2.6.7
Works with: Mono version 2.10.x
Works with: Mono version 3.x.y
Works with: .NET version 3.5
Works with: .NET version 4.0
Works with: .NET version 4.5

One Line version:

Console::WriteLine("Hello world!")

Hello World Program:

//compile using the new dylan.NET v, 11.5.1.2 or later
//use mono to run the compiler
#refstdasm mscorlib.dll

import System

assembly helloworld exe
ver 1.2.0.0

class public Program

   method public static void main()
      Console::WriteLine("Hello world!")
   end method

end class

Déjà Vu

!print "Hello world!"

E

println("Hello world!")

stdout.println("Hello world!")

EasyLang

print "Hello world!"

eC

class GoodByeApp : Application
{
   void Main()
   {
      PrintLn("Hello world!");
   }
}

EchoLisp

(display "Hello world!" "color:blue")

ECL

OUTPUT('Hello world!');

Ecstasy

module HelloWorld {
    void run() {
        @Inject Console console;
        console.print("Hello, World!");
    }
}

EDSAC order code

The EDSAC did not support lower-case letters. The method used here is to include a separate O order to print each character: for short messages and labels this is quite adequate. A more general (though slightly more involved) solution for printing strings is given at Hello world/Line printer#EDSAC order code.

[ Print HELLO WORLD ]
[ A program for the EDSAC ]
[ Works with Initial Orders 2 ]

T64K  [ Set load point: address 64 ]
GK    [ Set base address ]
O13@  [ Each O order outputs one ]
O14@  [ character. The numerical ]
O15@  [ parameter gives the offset ]
O16@  [ (from the base address) where ]
O17@  [ the character to print is ]
O18@  [ stored ]
O19@
O20@
O21@  
O22@
O23@
O24@
ZF    [ Stop ]
*F    [ Shift to print letters ]
HF    [ Character literals ]
EF
LF
LF
OF
!F    [ Space character ]
WF
OF
RF
LF
DF
EZPF  [ Start program beginning at
        the load point ]
Output:
HELLO WORLD

Efene

short version (without a function)

io.format("Hello world!~n")

complete version (put this in a file and compile it)

@public 
run = fn () {
    io.format("Hello world!~n")
}

Egel

def main = "Hello World!"

Egison

(define $main
  (lambda [$argv]
    (write-string "Hello world!\n")))

EGL

Works with: EDT
Works with: RBD
program HelloWorld
    function main()
        SysLib.writeStdout("Hello world!");
    end
end

Eiffel

This page uses content from Wikipedia. The original article was at Eiffel (programming language). The list of authors can be seen in the page history. As with Rosetta Code, the text of Wikipedia is available under the GNU FDL. (See links for details on variance)
class
    HELLO_WORLD
create
    make
feature
    make
        do
            print ("Hello world!%N")
        end
end

Ela

open monad io
do putStrLn "Hello world!" ::: IO

Elan

putline ("Hello, world!");

elastiC

From the elastiC Manual.

package hello;

    // Import the `basic' package
    import basic;

    // Define a simple function
    function hello()
    {
        // Print hello world
        basic.print( "Hello world!\n" );
    }

    /*
     *  Here we start to execute package code
     */

    // Invoke the `hello' function
    hello();

Elena

ELENA 6.x:

public program()
{
    console.writeLine("Hello world!")
}

Elisa

 "Hello world!"?

Elixir

IO.puts "Hello world!"

Elm

main = text "Goodbye World!"

Emacs Lisp

(message "Hello world!")

Alternatively, princ can be used:

(princ "Hello world!\n")

EMal

writeLine("Hello world!")

Emojicode

🏁 🍇
  😀 🔤Hello world!🔤
🍉

Enguage

This shows "hello world", and shows how Enguage can generate this program on-the-fly.

On "say hello world", reply "hello world".

## This can be tested:
#] say hello world: hello world.

## This can also be created within Enguage:
#] to the phrase hello reply hello to you too: ok.
#] hello: hello to you too.

Output:

TEST: hello
===========

user> say hello world.
enguage> hello world.

user> to the phrase hello reply hello to you too.
enguage> ok.

user> hello.
enguage> hello to you too.
1 test group(s) found
+++ PASSED 3 tests in 53ms +++

Erlang

io:format("Hello world!~n").

ERRE

! Hello World in ERRE language
PROGRAM HELLO
BEGIN
  PRINT("Hello world!")
END PROGRAM

Euler Math Toolbox

"Hello world!"

Extended BrainF***

[.>]@Hello world!

Ezhil

பதிப்பி"வணக்கம் உலகம்!"
பதிப்பி "Hello world!"
பதிப்பி"******* வணக்கம்! மீண்டும் சந்திப்போம் *******"
exit()

F#

printfn "%s" "Hello world!"

or using .Net classes directly

System.Console.WriteLine("Hello world!")

Factor

"Hello world!" print

Falcon

With the printl() function:

printl("Hello world!")

Or via "fast print":

> "Hello world!"

FALSE

"Hello world!
"

Fantom

class HelloText
{
  public static Void main ()
  {
    echo ("Hello world!")
  }
}

Fe

(print "Hello World")

Fennel

(print "Hello World")

ferite

word.}}

uses "console";
Console.println( "Goodby, World!" );

Fermat

!!'Hello, World!';

Fexl

say "Hello world!"

Fhidwfe

puts$ "Hello, world!\n"

Fish

Standard Hello, world example, modified for this task:

!v"Hello world!"r!
 >l?!;o

Explanation of the code:
!v" jumps over the v character with the ! sign, then starts the string mode with " .
Then the characters Hello world! are added, and string mode is closed with ".
The stack is reversed for printing (r), and a jump (!) is executed to jump over the ! at the beginning of the line and execute the v. (Fish is torical)
After going down by v, it goes rightwards again by > and this line is being executed.
This line pushes the stack size (l), and stops (;) if the top item on the stack is equal to 0 (?). Else it executes the ! directly after it and jumps to the o, which outputs the top item in ASCII. Then the line is executed again. It effectively prints the stack until it's empty, then it terminates.

FOCAL

TYPE "Hello, world" !

Forth

." Hello world!"

Or as a whole program:

: goodbye ( -- )   ." Hello world!" CR ;

Fortran

Works with: F77

Simplest case - display using default formatting:

print *,"Hello world!"

Use explicit output format:

100   format (5X,A,"!")
      print 100,"Hello world!"

Output to channels other than stdout goes like this:

write (89,100) "Hello world!"

uses the format given at label 100 to output to unit 89. If output unit with this number exists yet (no "OPEN" statement or processor-specific external unit setting), a new file will be created and the output sent there. On most UNIX/Linux systems that file will be named "fort.89". Template:7*7

Fortress

export Executable                                                                                                                       
                                                                                                                                        
run() = println("Hello world!")

FreeBASIC

? "Hello world!"
sleep


Free Pascal

PROGRAM HelloWorld ;

{$APPTYPE CONSOLE}

(*) 

        https://www.freepascal.org/advantage.var

(*)

USES

    crt;

BEGIN

  WriteLn ( 'Hello world!' ) ;

END.

Frege

Works with: Frege version 3.20.113
module HelloWorld where
main _ = println "Hello world!"

friendly interactive shell

Unlike other UNIX shell languages, fish doesn't support history substitution, so ! is safe to use without quoting.

echo Hello world!

Frink

println["Hello world!"]

FTCBASIC

print "Hello, world!"
pause
end

FunL

println( 'Hello world!' )


Furor

."Hello, World!\n"

Peri

."Hello, World!\n"

FutureBasic

window 1
print @"Hello world!"

HandleEvents

FUZE BASIC

PRINT "Hello world!"

Gambas

Click this link to run this code

Public Sub Main()

PRINT "Hello world!"
 
End

GAP

# Several ways to do it
"Hello world!";

Print("Hello world!\n"); # No EOL appended

Display("Hello world!");

f := OutputTextUser();
WriteLine(f, "Hello world!\n");
CloseStream(f);

GB BASIC

10 print "Hello world!"

gecho

'Hello, <> 'World! print

Gema

Gema ia a preprocessor that reads an input file and writes an output file. This code will write "Hello world!' no matter what input is given.

*= ! ignore off content of input
\B=Hello world!\! ! Start output with this text.

Genie

init
    print "Hello world!"

Gentee

func hello <main>
{
   print("Hello world!")
}

GFA Basic

PRINT "Hello World"

GLBasic

STDOUT "Hello world!"

Gleam

import gleam/io

pub fn main() {
    io.println("Hello world!")
}

Glee

"Hello world!"

or

'Hello world!'

or to display with double quotes

 '"Goodbye,World!"'

or to display with single quotes

 "'Goodbye,World!'"

Global Script

This uses the gsio I/O operations, which are designed to be simple to implement on top of Haskell and simple to use.

λ _. print qq{Hello world!\n}

GlovePIE

debug="Hello world!"

GML

show_message("Hello world!"); // displays a pop-up message
show_debug_message("Hello world!"); // sends text to the debug log or IDE

Go

package main

import "fmt"

func main() { fmt.Println("Hello world!") }

Golfscript

"Hello world!"

Gosu

print("Hello world!")

Grain

print("Hello world!")

Groovy

println "Hello world!"

GW-BASIC

10 PRINT "Hello world!"

Hack

<?hh echo 'Hello world!'; ?>

Halon

If the code in run in the REPL the output will be to stdout otherwise syslog LOG_DEBUG will be used.

echo "Hello world!";

Harbour

? "Hello world!"

Hare

use fmt;

export fn main() void = {
	fmt::println("Hello, world!")!;
};

Haskell

main = putStrLn "Hello world!"

Haxe

trace("Hello world!");

hexiscript

println "Hello world!"

HicEst

WRITE() 'Hello world!'

HLA

program goodbyeWorld;
#include("stdlib.hhf")
begin goodbyeWorld;

  stdout.put( "Hello world!" nl );

end goodbyeWorld;

HolyC

"Hello world!\n";

Hoon

~&  "Hello world!"  ~

Hopper

program Hello
{
    uses "/Source/Library/Boards/PiPico"
    
    Hopper()
    {
        WriteLn("Hello world!");
        loop
        {
            LED = !LED;
            Delay(500);
        }
    }
}
Output:

In IDE, build hello.hs into hello.hexe, (press F7) and start debug (F5) or hm console monitor.

!> hello
Hello world!

The language and runtime install verification message shows up on the monitor console. In keeping with most MCU introductions, the onboard Light Emitting Diode (LED) will then blink on and off at 1/2 second intervals, forever; (until power runs out, or explicit operator intervention).

HPPPL

PRINT("Hello world!");

HQ9+

This example is incorrect. Please fix the code and remove this message.

Details: output isn't consistent with the task's requirements (and is probably incapable of solving the task).

H
  • Technically, HQ9+ can't print "Hello world!" text because of its specification.

- H : Print 'Hello World!'
- Q : Quine
- 9 : Print '99 Bottles of Beer'
- + : Increase Pointer (useless!)

Huginn

#! /bin/sh
exec huginn --no-argv -E "${0}" "${@}"
#! huginn

main() {
	print( "Hello World!\n" );
	return ( 0 );
}

HTML5

<!DOCTYPE html>
<html>
<body>
<h1>Hello world!</h1>
</body>
</html>

Hy

(print "Hello world!")

i

software {
    print("Hello world!")
}

Icon and Unicon

procedure main()
  write( "Hello world!" )
end

IDL

print,'Hello world!'

Idris

module Main

main : IO ()
main = putStrLn "Hello world!"

Inform 6

[Main;
  print "Hello world!^";
];

Inko

import std::stdio::stdout

stdout.print('Hello, world!')

Insitux

(print "Hello, world!")

Intercal

DO ,1 <- #13
PLEASE DO ,1 SUB #1 <- #238
DO ,1 SUB #2 <- #108
DO ,1 SUB #3 <- #112
DO ,1 SUB #4 <- #0
DO ,1 SUB #5 <- #64
DO ,1 SUB #6 <- #194
PLEASE DO ,1 SUB #7 <- #48
DO ,1 SUB #8 <- #26
DO ,1 SUB #9 <- #244
PLEASE DO ,1 SUB #10 <- #168
DO ,1 SUB #11 <- #24
DO ,1 SUB #12 <- #16
DO ,1 SUB #13 <- #162
PLEASE READ OUT ,1
PLEASE GIVE UP


Integer BASIC

NOTE: Integer BASIC was written (and hand-assembled by Woz himself) for the Apple 1 and original Apple 2. The Apple 1 has NO support for lower-case letters, and it was an expensive (and later) option on the Apple 2. This example accurately represents the only reasonable solution for those target devices, and therefore cannot be "fixed", only deleted.

   10 PRINT "Hello world!"
   20 END

Io

"Hello world!" println

Ioke

"Hello world!" println

IS-BASIC

PRINT "Hello world!"

Isabelle

theory Scratch
  imports Main
begin
  value ‹''Hello world!''›
end

IWBASIC

OPENCONSOLE

PRINT"Hello world!"

'This line could be left out.
PRINT:PRINT:PRINT"Press any key to end."

'Keep the console from closing right away so the text can be read.
DO:UNTIL INKEY$<>""

CLOSECONSOLE

END

J

   'Hello world!'
Hello world!

Here are some redundant alternatives:

   [data=. 'Hello world!'
Hello world!
   data
Hello world!
   smoutput data
Hello world!

   NB. unassigned names are verbs of infinite rank awaiting definition.
   NB. j pretty prints the train.
   Hello World!
Hello World !


   NB. j is glorious, and you should know this!

   i. 2 3   NB. an array of integers
0 1 2
3 4 5

   verb_with_infinite_rank =: 'Hello world!'"_

   verb_with_infinite_rank i. 2 3
Hello world!
   

   verb_with_atomic_rank =: 'Hello world!'"0

   verb_with_atomic_rank i. 2 3
Hello world!
Hello world!
Hello world!

Hello world!
Hello world!
Hello world!

Jack

class Main {
  function void main () {
    do Output.printString("Hello world!");
    do Output.println();
    return;
  }
}

Jacquard Loom

This weaves the string "Hello world!"

+---------------+
|               |
|    *    *     |
|*   *    *  *  |
|*           * *|
|*           * *|
|*  *         * |
|   *     *   * |
|         *     |
+---------------+

+---------------+
|               |
|*   *    *     |
|*   *    *     |
|            * *|
|            * *|
|*  *         * |
|*  *     *   * |
|         *     |
+---------------+

+---------------+
|               |
|*   **   * *   |
|*******  *** * |
| **** *   * ***|
| **** *  ******|
| ******   ** * |
|   * *   *   * |
|         *     |
+---------------+

+---------------+
|               |
|*******  *** * |
|*******  *** * |
|           ** *|
|*        *  * *|
|*******   ** * |
|*******  *** * |
|         *     |
+---------------+

+---------------+
|               |
|*******  *** * |
|*******  *** * |
|      *  *  * *|
|      *  *  * *|
|*******  **  * |
|*******  **  * |
|         *     |
+---------------+

+---------------+
|               |
|***** *  *** * |
|*******  *** * |
|     * * *  *  |
|     * *    *  |
|******   **  * |
|******   **  * |
|         *     |
+---------------+

+---------------+
|               |
|    *    * *   |
|***** *  ***** |
|***** **  * ***|
|***** **  * ***|
|*******   * ** |
|   * *   *   * |
|         *     |
+---------------+

+---------------+
|               |
|               |
|     * *       |
|     * *       |
|     *         |
|     *         |
|               |
|               |
+---------------+

Jai

#import "Basic";

main :: () {
    print("Hello, World!\n");
}

Jakt

fn main() {
    println("Hello world!")
}

Janet

(print "Hello world!")

Java

public class HelloWorld
{
 public static void main(String[] args)
 {
  System.out.println("Hello world!");
 }
}

JavaScript

document.write("Hello world!");
Works with: NJS version 0.2.5
Works with: Rhino
Works with: SpiderMonkey
print('Hello world!');
Works with: JScript
WScript.Echo("Hello world!");
Works with: Node.js
console.log("Hello world!")

JCL

/*MESSAGE Hello world!

Jinja

from jinja2 import Template
print(Template("Hello World!").render())

A bit more convoluted, really using a template:

from jinja2 import Template
print(Template("Hello {{ something }}!").render(something="World"))

Joy

"Hello world!\n" putchars.

jq

"Hello world!"

JSE

Print "Hello world!"

Jsish

puts("Hello world!")

Julia

println("Hello world!")

K

"Hello world!"

Some of the other ways this task can be attached are:

`0: "Hello world!\n"
s: "Hello world!"
s
\echo "Hello world!"

Kabap

return = "Hello world!";

Kaya

program hello;
 
Void main() {
    // My first program!
    putStrLn("Hello world!");
}

Kdf9 Usercode

This example is incorrect. Please fix the code and remove this message.

Details: output isn't consistent with the task's requirements: wording, punctuation.

 

V2; W0;
RESTART; J999; J999;
PROGRAM;                   (main program);
   V0 = Q0/AV1/AV2;
   V1 = B0750064554545700; ("Hello" in Flexowriter code);
   V2 = B0767065762544477; ("World" in Flexowriter code);
   V0; =Q9; POAQ9;         (write "Hello World" to Flexowriter);
999;  OUT;
   FINISH;

Keg

Hello world\!

Kite

simply a single line

"#!/usr/local/bin/kite

"Hello world!"|print;

Kitten

"Hello world!" say

KL1

:- module main.

main :-
      unix:unix([stdio(normal(S))]),
      S = [fwrite("Hello world\n")].

Koka

fun main() {
  println("Hello world!")
}

Alternatively:

- indentation instead of braces

- uniform function call syntax

- omitted parentheses for function calls with no parameters

fun main()
  "Hello world!".println

KonsolScript

Displays it in a text file or console/terminal.

function main() {
  Konsol:Log("Hello world!")
}

Kotlin

fun main() {
    println("Hello world!")
}

KQL

print 'Hello world!'

KSI

`plain
'Hello world!' #echo #

Lambdatalk

Hello world!
{h1 Hello world!}
_h1 Hello world!\n

Lang

fn.println(Hello world!)

Lang5

"Hello world!\n" .

langur

writeln "Hello"

Lasso

A plain string is output automatically.

'Hello world!'

LaTeX

\documentclass{minimal}
\begin{document}
Hello World!
\end{document}

Latitude

putln "Hello world!".

LC3 Assembly

.orig x3000
LEA R0, hello    ; R0 = &hello
TRAP x22         ; PUTS (print char array at addr in R0)
HALT
hello .stringz "Hello World!"
.end

Or (without PUTS)

.orig x3000
LEA R1, hello        ; R1 = &hello
TOP LDR R0, R1, #0   ; R0 = R1[0]
BRz END              ; if R0 is string terminator (x0000) go to END
TRAP x21             ; else OUT (write char in R0)
ADD R1, R1, #1       ;      increment R1
BR TOP               ;      go to TOP
END HALT
hello .stringz "Hello World!"
.end

LDPL

procedure:
display "Hello World!" crlf

Lean

#eval "Hello world!"

Slightly longer version:

def main : IO Unit :=
  IO.println ("Hello world!")

#eval main

LFE

(: io format '"Hello world!~n")

Liberty BASIC

print "Hello world!"

LIL

#
# Hello world in lil
#

print "Hello, world!"

Lily

There are two ways to do this. First, with the builtin print:

print("Hello world!")

Second, by using stdout directly:

stdout.print("Hello world!\n")

Lilypond

\version "2.18.2"
global = {
  \time 4/4
  \key c \major
  \tempo 4=100
}
\relative c''{ g e e( g2)
}
\addlyrics {
  Hel -- lo,   World!
}

Limbo

implement Command;
 
 include "sys.m";
     sys: Sys;
 
 include "draw.m";
 
 include "sh.m";
 
 init(nil: ref Draw->Context, nil: list of string)
 {
     sys = load Sys Sys->PATH;
     sys->print("Hello world!\n");
 }

Lingo

put "Hello world!"

or:

trace("Hello world!")

Lisaac

Works with: Lisaac version 0.13.1

You can print to standard output in Lisaac by calling STRING.print or INTEGER.print:

Section Header          // The Header section is required.
  + name := GOODBYE;    // Define the name of this object.

Section Public
  - main <- ("Hello world!\n".print;);

However, it may be more straightforward to use IO.print_string instead:

Section Header          // The Header section is required.
  + name := GOODBYE2;   // Define the name of this object.

Section Public
  - main <- (IO.put_string "Hello world!\n";);

Little

Output to terminal:

puts("Hello world!");

Without the newline terminator:

puts(nonewline: "Hello world!");

Output to arbitrary open, writable file, for example the standard error channel:

puts(stderr, "Hello world!");

LiveCode

Examples using the full LiveCode IDE.

Text input and output done in the Message palette/window:

put "Hello World!"

Present a dialog box to the user

Answer "Hello World!"

Example using command-line livecode-server in shell script

#! /usr/local/bin/livecode-server
set the outputLineEndings to "lf"
put "Hello world!" & return

Livecode also supports stdout as a device to write to

write "Hello world!" & return to stdout

LLVM

; const char str[14] = "Hello World!\00"
@.str = private unnamed_addr constant  [14 x i8] c"Hello, world!\00"

; declare extern `puts` method
declare i32 @puts(i8*) nounwind

define i32 @main()
{
  call i32 @puts( i8* getelementptr ([14 x i8]* @str, i32 0,i32 0))
  ret i32 0
}

Lobster

print "Hello world!"

Print includes a line feed:

print [Hello world!]

Type does not:

type [Hello world!]

Logtalk

:- object(hello_world).

    % the initialization/1 directive argument is automatically executed
    % when the object is loaded into memory:
    :- initialization(write('Hello world!\n')).

:- end_object.

LOLCODE

HAI
CAN HAS STDIO?
VISIBLE "Hello world!"
KTHXBYE

LotusScript

:- object(hello_world).
    'This will send the output to the status bar at the bottom of the Notes client screen
    print "Hello world!"

:- end_object.

LSE

AFFICHER [U, /] 'Hello world!'

LSE64

"Hello world!" ,t nl

Lua

Function calls with either a string literal or a table constructor passed as their only argument do not require parentheses.

print "Hello world!"

Harder way with a table:

 
local chars = {"G","o","o","d","b","y","e",","," ","W","o","r","l","d","!"}
for i = 1, #chars do
  io.write(chars[i])
end
-- or:
print(table.concat(chars))

Luna

def main:
    hello = "Hello, World!"
    print hello

M2000 Interpreter

Print "Hello World!" \\ printing on columns, in various ways defined by last $() for specific layer
Print $(4),"Hello World!" \\ proportional printing using columns, expanded to a number of columns as the length of string indicates.
Report "Hello World!"  \\ proportional printing with word wrap, for text, can apply justification and rendering a range of text lines

M4

For the particular nature of m4, this is simply:

`Hello world!'

MACRO-10

        TITLE HELLO

COMMENT !
  Hello-World program, PDP-10 assembly language, written by kjx, 2022.
           Assembler: MACRO-10    Operating system: TOPS-20
!

        SEARCH MONSYM                      ;Get symbolic names for system-calls.

GO::    RESET%                             ;System call: Initialize process.

        HRROI 1,[ASCIZ /Hello World!/]     ;Put pointer to string into register 1.
        PSOUT%                             ;System call: Print string.
        HALTF%                             ;System call: Halt program.

        JRST GO                            ;Unconditional jump to GO (in case the
                                           ;user uses the CONTINUE-command while this
                                           ;program is still loaded).

        END GO

MACRO-11

;
;          TEXT BASED HELLO WORLD
;          WRITTEN  BY:  BILL GUNSHANNON
;
 
           .MCALL  .PRINT .EXIT 
           .RADIX  10
 
 
 
MESG1:     .ASCII  "  "
           .ASCII  " HELLO WORLD "
           .EVEN
 
START:
           .PRINT  #MESG1
 
DONE:
 
;   CLEAN UP AND GO BACK TO KMON
 
           .EXIT
 
 
           .END     START


Maclisp

(format t "Hello world!~%")

Or

(print "Hello world!")

MAD

           VECTOR VALUES HELLO = $11HHELLO WORLD*$
           PRINT FORMAT HELLO
           END OF PROGRAM

make

Makefile contents:

all:
$(info Hello world!)

Running make produces:

Hello world!
make: Nothing to be done for `all'.

Malbolge

Long version:

('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"
`CB]V?Tx<uVtT`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${z@>

Short version:

(=<`#9]~6ZY32Vx/4Rs+0No-&Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8dc
Output:
HELLO WORLD!

MANOOL

In “applicative” notation:

{{extern "manool.org.18/std/0.3/all"} in WriteLine[Out; "Hello world!"]}

OOPish notation (equivalent to the above, up to Abstract Syntax Tree):

{{extern "manool.org.18/std/0.3/all"} in Out.WriteLine["Hello world!"]}

LISPish notation (ditto):

{{extern "manool.org.18/std/0.3/all"} in {WriteLine Out "Hello world!"}}

Using a colon punctuator (ditto):

{{extern "manool.org.18/std/0.3/all"} in: WriteLine Out "Hello world!"}

Note that all semicolons, wherever allowed, are optional. The above example with all possible semicolons:

{{extern; "manool.org.18/std/0.3/all"} in: WriteLine; Out; "Hello world!"}

Maple

> printf( "Hello world!\n" ): # print without quotes
Hello world!

Mastermind

output "Hello world!\n";

Mathcad

Simply type the following directly onto a Mathcad worksheet (A worksheet is Mathcad's combined source code file & console).

"Hello, World!"

Applies to Mathcad Prime, Mathcad Prime Express and Mathcad 15 (and earlier)

Mathematica / Wolfram Language

Print["Hello world!"]

MATLAB

>> disp('Hello world!')


Maude

fmod BYE-WORLD is

	protecting STRING .
	
	op sayBye : -> String .
	
	eq sayBye = "Hello world!" .
	
endfm

red sayBye .

Maxima

print("Hello world!");

MAXScript

print "Hello world!"

or:

format "%" "Hello world!"

MDL

<PRINC "Hello world!">
<CRLF>

MEL

proc helloWorld () {
   print "Hello, world!\n";
}

MelonBasic

Say:Hello world!

helloWorld;

Mercury

:- module hello.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.

:- implementation.
main(!IO) :-
    io.write_string("Hello world!\n", !IO).

Metafont

message "Hello world!"; end

Microsoft Small Basic

TextWindow.WriteLine("Hello world!")

min

"Hello world!" puts

Minimal BASIC

10 PRINT "Hello world!"
20 END

MiniScript

print "Hello world!"

MiniZinc

output ["Hello World"];
Output:
Hello World
----------

MIPS Assembly

Works with: MARS

and

Works with: SPIM
   .data #section for declaring variables
hello:  .asciiz "Hello world!" #asciiz automatically adds the null terminator. If it's .ascii it doesn't have it.

   .text # beginning of code
main: # a label, which can be used with jump and branching instructions.
   la $a0, hello # load the address of hello into $a0
   li $v0, 4 # set the syscall to print the string at the address $a0
   syscall # make the system call

   li $v0, 10 # set the syscall to exit
   syscall # make the system call

Miranda

main :: [sys_message]
main = [Stdout "Hello, world!\n"]

mIRC Scripting Language

echo -ag Hello world!

ML/I

Hello world!

Modula-2

MODULE Hello;
IMPORT InOut;

BEGIN
  InOut.WriteString('Hello world!');
  InOut.WriteLn
END Hello.

TopSpeed Modula-2

Modula-2 does not have built-in procedures for I/O. Instead, I/O is done via library modules. The names and contents of these modules vary between implementations of Modula-2. The solution below shows that the console I/O module supplied with TopSpeed Modula-2 has a different name and different procedures from the implementation in the previous solution.

MODULE Hello;
IMPORT IO;

BEGIN
  IO.WrStr('Hello world!'); IO.WrLn;

(* Another way, showing some features of Modula-2 *)
  IO.WrStr("Hello");  (* either single or double quotes can be used *)
  IO.WrChar(40C);     (* character whose ASCII code is 40 octal *)
  IO.WrStr('world!');
  IO.WrLn();          (* procedure with no arguments: () is optional *)
END Hello.

Modula-3

MODULE Goodbye EXPORTS Main;

IMPORT IO;

BEGIN
  IO.Put("Hello world!\n");
END Goodbye.

MontiLang

|Hello, World!| PRINT .

Morfa

import morfa.io.print;
func main(): void
{
    println("Hello world!");
}

Mosaic

proc main =
    println "Hello, world"
end

Or just:

println "Hello, world"

MSX Basic

10 PRINT "Hello world!"

MUF

: main[ -- ]
me @ "Hello world!" notify
exit
;

MUMPS

Write "Hello world!",!

MyDef

Run with:

mydef_run hello.def

Perl:

$print Hello world

C:

module: c
$print Hello world

python:

module: python
$print Hello world

JavaScript

module: js
$print "Hello world"

go:

module: go
$print Hello world

MyrtleScript

script HelloWorld {
    func main returns: int {
        print("Hello World!")
    }
}

MySQL

SELECT 'Hello world!';

Mythryl

print "Hello world!";

N/t/roff

To get text output, compile the source file using NROFF and set output to the text terminal. If you compile using TROFF, you will get graphical output suitable for typesetting on a graphical typesetter/printer instead.

Because /.ROFF/ is a document formatting language, the majority of input is expected to be text to output onto a medium. Therefore, there are no routines to explicitly call to print text.

Hello world!

Nanoquery

println "Hello world!"

Neat

void main() writeln "Hello world!";

Neko

$print("Hello world!");

Nemerle

class Hello
{
  static Main () : void
  {
    System.Console.WriteLine ("Hello world!");
  }
}

Easier method:

System.Console.WriteLine("Hello world!");

NetRexx

say  'Hello world!'

Never

func main() -> int {
    prints("Hello world!\n");
    0
}
Output:
prompt$ never -f hello.nev
Hello world!

newLISP

Works with: newLisp version 6.1 and after
(println "Hello world!")

Nickle

printf("Hello world!\n")

Nim

echo("Hello world!")

using stdout

stdout.writeLine("Hello World!")

Nit

print "Hello world!"

Nix

"Hello world!"

NLP++

@CODE
"output.txt" << "Hello world!";
@@CODE

NS-HUBASIC

As lowercase characters are not offered in NS-HUBASIC, perhaps some flexibility in the task specification could be offered.

Using ?:

10 ? "HELLO WORLD!"

Using PRINT:

10 PRINT "HELLO WORLD!"

Nu

print "Hello world!"

Nutt

module hello_world
imports native.io.output.say

say("Hello, world!")

end

Nyquist

Interpreter: Nyquist (3.15)

LISP syntax

(format t "Hello world!")

Or

(print "Hello world!")

SAL syntax

print "Hello World!"

Or

exec format(t, "Hello World!")

Oberon-2

MODULE Goodbye;
IMPORT Out;
  PROCEDURE World*;
  BEGIN
    Out.String("Hello world!");Out.Ln
  END World;
BEGIN
  World;
END Goodbye.

Objeck

class Hello {
  function : Main(args : String[]) ~ Nil {
    "Hello world!"->PrintLine();
  }
}

ObjectIcon

import io

procedure main ()
  io.write ("Hello world!")
end
Output:
$ oiscript hello-OI.icn
Hello world!

Objective-C

Works with: clang-602.0.53

The de facto Objective-C "Hello, World!" program is most commonly illustrated as the following, using the NSLog() function:

#import <Foundation/Foundation.h>

int main() {
    @autoreleasepool {
        NSLog(@"Hello, World!");
    }
}

However the purpose of the NSLog() function is to print a message to standard error prefixed with a timestamp, which does not meet the most common criteria of a "Hello, World!" program of displaying only the requested message to standard output.

The following code prints the message to standard output without a timestamp using exclusively Objective-C messages:

#import <Foundation/Foundation.h>

int main() {
    @autoreleasepool {
        NSFileHandle *standardOutput = [NSFileHandle fileHandleWithStandardOutput];
        NSString *message = @"Hello, World!\n";
        [standardOutput writeData:[message dataUsingEncoding:NSUTF8StringEncoding]];
    }
}

Objective-C also supports functions contained within the C standard library. However, Objective-C's NSString objects must be converted into a UTF-8 string in order to be supported by the C language's I/O functions.

#import <Foundation/Foundation.h>

int main() {
    @autoreleasepool {
        NSString *message = @"Hello, World!\n";
        printf("%s", message.UTF8String);
    }
}

OCaml

print_endline "Hello world!"

Occam

Works with: kroc
#USE "course.lib"
PROC main (CHAN BYTE screen!)
  out.string("Hello world!*c*n", 0, screen)
:

Octave

disp("Hello world!");

Or, using C-style function printf:

printf("Hello world!");

Odin

package main
import "core:fmt"

main :: proc() {
  fmt.println("Hellope!");
}

Oforth

"Hello world!" .

Ol

(print "Hello world!")

Onyx

`Hello world!\n' print flush

Onyx (wasm)

use core {printf}
main :: () {
    printf("Hello world!");
}
Output:
Hello world!

OOC

To print a String, either call its println() method:

main: func {
  "Hello world!" println()
}

Or call the free println() function with the String as the argument.

main: func {
  println("Hello world!")
}

ooRexx

Refer also to the Rexx and NetRexx solutions. Simple output is common to most Rexx dialects.

/* Rexx */
say 'Hello world!'

OpenLisp

We can use the same code as the Common Lisp example, but as a shell script.

#!/openlisp/uxlisp -shell
(format t "Hello world!~%")
(print "Hello world!")

Output: Hello world! "Hello world!"

Openscad

echo("Hello world!");  // writes to the console
text("Hello world!");  // creates 2D text in the object space
linear_extrude(height=10) text("Hello world!"); // creates 3D text in the object space

Owl Lisp

(print "Hello world!")
Output:
$ ol hello-Owl.scm
Hello world!


Oxygene

From wp:Oxygene (programming language)

namespace HelloWorld;
 
interface
 
type
  HelloClass = class
  public
    class method Main; 
  end;
 
implementation
 
class method HelloClass.Main;
begin
  writeLn('Hello world!');
end;
 
end.
Output:
Hello world!

Oz

{Show "Hello world!"}

PARI/GP

print("Hello world!")

Pascal

Works with: Free Pascal
program byeworld;
begin
 writeln('Hello world!');
end.

PascalABC.NET

// Hello world/Text. Nigel Galloway: January 25th., 2023
begin
  System.Console.WriteLine('Hello World!');
end.
Output:
Hello World!

PASM

print "Hello world!\n"
end

PDP-1 Assembly

This can be assembled with macro1.c distributed with SIMH and then run on the SIMH PDP-1 simulator.

hello   
/ above: title line - was punched in human readable letters on paper tape
/ below: location specifier - told assembler what address to assemble to
100/
lup,	lac i ptr		/ load ac from address stored in pointer
	cli			/ clear io register
lu2,	rcl 6s			/ rotate combined ac + io reg 6 bits to the left
				/ left 6 bits in ac move into right 6 bits of io reg
	tyo			/ type out character in 6 right-most bits of io reg
	sza			/ skip next instr if accumulator is zero
	jmp lu2			/ otherwise do next character in current word
	idx ptr			/ increment pointer to next word in message
	sas end			/ skip next instr if pointer passes the end of message
	jmp lup			/ otherwise do next word in message
	hlt			/ halt machine
ptr,	msg			/ pointer to current word in message
msg,	text "hello, world"	/ 3 6-bit fiodec chars packed into each 18-bit word
end,	.         		/ sentinel for end of message
start 100			/ tells assembler where program starts

PDP-11 Assembly

This is Dennis Ritchie's Unix Assembler ("as"). Other PDP-11 assemblers include PAL-11R, PAL-11S and MACRO-11.

Works with: UNIX version 1

to

Works with: UNIX version 7
.globl  start
	.text
start:
        mov	$1,r0               / r0=stream, STDOUT=$1
	sys	4; outtext; outlen  / sys 4 is write
	sys	1                   / sys 1 is exit
	rts	pc                  / in case exit returns

	.data
outtext: <Hello world!\n>
outlen = . - outtext

Pebble

;Hello world example program
;for x86 DOS
;compile with Pebble

;compiled com program is 51 bytes

program examples\hello

begin

	echo "Hello, world!"
	pause
	kill

end

PepsiScript

The letters are only outputted in uppercase in the running program. However, lowercase characters can be used in the code instead.

For typing:

#include default-libraries

#author Childishbeat

class Hello world/Text:
function Hello world/Text:

print "Hello world!"

end

For importing:

•dl◘Childishbeat◙♦Hello world/Text♪♣Hello_world!♠

Perl

Works with: Perl version 5.8.8
print "Hello world!\n";
Works with: Perl version 5.10.x

Backported from Raku:

use feature 'say';
say 'Hello world!';

or:

use 5.010;
say 'Hello world!';

Peylang

chaap 'Hello world!';
Output:
$ peyman hello.pey
Hello world!

Pharo

"Comments are in double quotes"
"Sending message printString to 'Hello World' string"

'Hello World' printString

Phix

Library: Phix/basics
puts(1,"Hello world!")

PHL

module helloworld;
extern printf;

@Integer main [
    printf("Hello world!");
    return 0;
]

PHP

<?php
echo "Hello world!\n";
?>

Alternatively, any text outside of the <?php ?> tags will be automatically echoed:

Hello world!

Picat

println("Hello, world!")

PicoLisp

(prinl "Hello world!")

Pict

Using the syntax sugared version:

(prNL "Hello World!");

Using the channel syntax:

new done: ^[]
run ( prNL!["Hello World!" (rchan done)]
    | done?_ = () )

Pikachu

pikachu pika pikachu pika pika pi pi pika pikachu pika pikachu pi pikachu pi pikachu pi pika pi pikachu pikachu pi pi pika pika pikachu pika pikachu pikachu pi pika pi pika pika pi pikachu pikachu pi pikachu pi pika pikachu pi pikachu pika pikachu pi pikachu pikachu pi pikachu pika pika pikachu pi pikachu pi pi pikachu pikachu pika pikachu pi pika pi pi pika pika pikachu pikachu pi pi pikachu pi pikachu
pikachu pikachu pi pikachu
pikachu pika pika pikachu pika pikachu pikachu pika pika pikachu pikachu pi pi pikachu pika pikachu pika pika pi pika pikachu pikachu pi pika pika pikachu pi pika pi pika pi pikachu pi pikachu pika pika pi pi pika pi pika pika pikachu pikachu pika pikachu pikachu pika pi pikachu pika pi pikachu pi pika pika pi pikachu pika pi pika pikachu pi pi pikachu pika pika pi pika pi pikachu
pikachu pikachu pi pikachu
pikachu pika pi pika pika pikachu pika pikachu pi pikachu pi pi pika pi pikachu pika pi pi pika pikachu pi pikachu pi pi pikachu pikachu pika pikachu pikachu pika pi pikachu pi pika pikachu pi pikachu pika pika pikachu pika pi pi pikachu pikachu pika pika pikachu pi pika pikachu pikachu pi pika pikachu pikachu pika pi pi pikachu pikachu pi pikachu pi pikachu pi pikachu pi pika pikachu pi pikachu pika pikachu pi pika pi pikachu
pi pika
pikachu pikachu pi pikachu
pika pi
pikachu pikachu pi pikachu
pikachu pi pikachu pi pi pikachu pi pikachu pika pikachu pikachu pi pikachu pikachu pika pi pi pika pikachu pika pikachu pi pi pikachu pika pi pi pikachu pika pika pi pika pika pikachu pika pikachu pi pi pika pikachu pika pi pikachu pikachu pi pikachu pika pikachu pikachu pika pi pi pikachu pikachu pi pika pikachu pi pikachu pika pikachu pikachu pika pi pikachu pikachu pika pikachu pi pikachu pika pika pi pikachu pi pika pi pikachu pikachu pi pikachu
pi pika
pikachu pikachu pi pikachu
pikachu pikachu pi pika pikachu pi pika pika pi pi pika pi pikachu pi pika pi pika pi pika pikachu pika pi pi pikachu pi pikachu pi pika pi pika pika pikachu pi pikachu
pikachu pikachu pi pikachu
pikachu pi pikachu pika pikachu pi pika pi pikachu pikachu pika pika pi pi pikachu pi pika pi pikachu pi pika pikachu pi pika pi pi pikachu pikachu pika pika pikachu pikachu pi pi pikachu pi pikachu pi pikachu pi pi pikachu pikachu pi pikachu pi pikachu pi pika pika pikachu pikachu pika pi pika pikachu pi pikachu pi pi pika pikachu pika pi pikachu pi pika pi pi pikachu pikachu pika pika pikachu pika pika pikachu pi pika pi pika pikachu pi pika pikachu pika pi pika pikachu
pikachu pikachu pika pikachu
pikachu pikachu pika pikachu
pi pi pikachu pi pikachu pika pika pi pikachu pika pika pi pi pika pika pikachu pi pi pikachu pi pika pi pika pikachu pi pikachu pi pikachu pikachu pi pi pika pika pi pika pika pi pika pikachu pikachu pi pikachu pika pi pi pika pi pi pikachu pikachu pika pi pi pika pika pi pika pikachu pi pikachu pi pi pika pi pika pika pikachu pika pi pika pikachu pi pikachu pikachu pi pi pika pi pika pika pikachu pikachu pi pikachu
pikachu pikachu pi pikachu
pikachu pi pikachu pikachu pika pikachu pikachu pika pika pikachu pikachu pika pikachu pi pika pikachu pika pika pi pikachu pi pi pika pi pi pikachu pika pika pikachu pikachu pika pikachu pikachu pi pika pi pi pikachu pikachu pika pi pi pikachu pikachu pika pikachu pika pi pikachu pi pika pi pika pikachu pika pi pikachu pi pikachu pikachu pi pika pikachu pi pikachu pikachu pi pika pi pikachu pikachu pi pikachu pika pika pi pi pikachu
pikachu pi pi pika pi pi pikachu pika pikachu pikachu pika pika pi pi pika pikachu pi pikachu pi pi pika pi pika pi pi pika pikachu pi pika pi pikachu pika pikachu pika pi pi pika pi pi pikachu pi pikachu pikachu pika pi pikachu pi pi pika pi pikachu pi pi pika pi pi pikachu pika pikachu pika pikachu pika pi pikachu pikachu pi pi pika pika pikachu
pikachu pikachu pi pikachu
pikachu pikachu pika pikachu

Pike

int main(){
   write("Hello world!\n");
}

PILOT

T:Hello world!

PIR

.sub hello_world_text :main
	print "Hello world!\n"
.end

Pixilang

fputs("Hello world!\n")

PL/I

goodbye:proc options(main);
     put list('Hello world!');
end goodbye;

PL/M

The original PL/M compiler does not recognise lower-case letters, hence the Hello, World! string must specify the ASCII codes for the lower-case letters.

100H:
   /* CP/M BDOS SYSTEM CALL */
   BDOS: PROCEDURE( FN, ARG ); DECLARE FN BYTE, ARG ADDRESS; GOTO 5; END;
   /* PRINT A $ TERMINATED STRING */
   PRINT$STRING: PROCEDURE( S ); DECLARE S ADDRESS; CALL BDOS( 9, S ); END;
   /* HELLO, WORLD! IN MIXED CASE */
   DECLARE HELLO$WORLD ( 14 ) BYTE
           INITIAL( 'H', 65H, 6CH, 6CH, 6FH, ',', ' '
                  , 'W', 6FH, 72H, 6CH, 64H, 21H, '$'
                  );
   CALL PRINT$STRING( .HELLO$WORLD );
EOF

PL/SQL

Works with: Oracle
set serveroutput on

BEGIN
  DBMS_OUTPUT.PUT_LINE('Hello world!');
END;
/
SQL> set serveroutput on
SQL> 
SQL> BEGIN
  2    DBMS_OUTPUT.PUT_LINE('Hello world!');
  3  END;
  4  /
Hello world!                                                                    

PL/SQL procedure successfully completed.

Plain English

\This prints Hello World within the CAL-4700 IDE.
\...and backslashes are comments!
To run:
Start up.
Write "Hello World!" to the console.
Wait for the escape key.
Shut down.

Plan

This prints HELLO WORLD on operator's console.

#STEER         LIST,BINARY
#PROGRAM       HLWD
#LOWER
MSG1A          11HHELLO WORLD
MSG1B          11/MSG1A
#PROGRAM
#ENTRY         0
      DISTY    MSG1B
      SUSWT    2HHH
#END
#FINISH
#STOP

Pointless

output = println("Hello world!")

Pony

actor Main
  new create(env: Env) =>
    env.out.print("Hello world!")

Pop11

printf('Hello world!\n');

Portugol

Portugol keywords are Portuguese words.

programa {
// funcao defines a new function
// inicio is the entry point of the program, like main in C
    funcao inicio() {
        // escreva is used to print stuff to the screen
        escreva("Hello, world!\n") // no ';' needed
    }
}

PostScript

To generate a document that shows the text "Hello world!":

%!PS
/Helvetica 20 selectfont
70 700 moveto
(Hello world!) show
showpage

If the viewer has a console, then there are the following ways to display the topmost element of the stack:

(Hello world!) ==

will display the string "(Hello world!)";

(Hello world!) =

will display the content of the string "(Hello world!)"; that is, "Hello world!";

(Hello world!) print

will do the same, without printing a newline. It may be necessary to provoke an error message to make the console pop up. The following program combines all four above variants:

%!PS
/Helvetica 20 selectfont
70 700 moveto
(Hello world!) dup dup dup
= print == % prints three times to the console
show % prints to document
1 0 div % provokes error message
showpage

Potion

"Hello world!\n" print

PowerBASIC

#COMPILE EXE
#COMPILER PBCC 6

FUNCTION PBMAIN () AS LONG
  CON.PRINT "Hello world!"
  CON.WAITKEY$
END FUNCTION

PowerShell

This example used to say that using Write-Host was good practice. This is not true - it should in fact be avoided in most cases.

See http://www.jsnover.com/blog/2013/12/07/write-host-considered-harmful/ (Jeffrey Snover is one of the creators of PowerShell).

'Hello world!'

Processing

println("Hello world!");

ProDOS

printline Hello world!

Programming Language

For typing:

print(Hello world!)

For importing:

[print(Hello world!)]

Prolog

:- write('Hello world!'), nl.

PROMAL

program hello
include library
begin
output "Hello world!"
end

PSQL

 EXECUTE BLOCK
   RETURNS(S VARCHAR(40))
 AS
 BEGIN
   S = 'Hello world!';
   SUSPEND;
 END

Pure

using system;

puts "Hello world!\n" ;

PureBasic

OpenConsole()
PrintN("Hello world!")
Input() ; Wait for enter

using Debug

Debug("Hello world!")

Python

Works with: Python version 2.4
print "Hello world!"

The same using sys.stdout

import sys
sys.stdout.write("Hello world!\n")

In Python 3.0, print is changed from a statement to a function.

Works with: Python version 3.0

(And version 2.X too).

print("Hello world!")

An easter egg The first two examples print Hello, world! once, and the last one prints it twice.

import __hello__
import __phello__
import __phello__.spam

QB64

PRINT "Hello world!"

Quackery

say "Hello world!"

Quill

"Hello world!" print

Quite BASIC

10 print "Hello world!"

R

 cat("Hello world!\n")

or

 message("Hello world!")

or

 print("Hello world!")

Ra

class HelloWorld
	**Prints "Hello world!"**

	on start

		print "Hello world!"

Racket

(printf "Hello world!\n")

Raku

(formerly Perl 6)

say 'Hello world!';

In an object-oriented approach, the string is treated as an object calling its say() method:

"Hello, World!".say();

Raven

'Hello world!' print

RATFOR

program hello

write(*,101)"Hello World"
101 format(A)

end


RASEL

A"!dlroW ,olleH">:?@,Hj

REALbasic

Works with: REALbasic version 5.5

This requires a console application.

Function Run(args() as String) As Integer
  Print "Hello world!"
  Quit
End Function

REBOL

print "Hello world!"

RED

print "Hello world!"

Refal

$ENTRY Go {
    = <Prout 'Hello, world!'>;
};

Relation

' Hello world!

ReScript

Js.log("Hello world!")
Output:
$ bsc hello.res > hello.bs.js
$ node hello.bs.js
Hello world!

Retro

'Hello_world! s:put

REXX

using SAY

/*REXX program to show a line of text.  */
say 'Hello world!'

using SAY variable

/*REXX program to show a line of text.  */
yyy = 'Hello world!'
say yyy

using LINEOUT

/*REXX program to show a line of text.  */

call lineout ,"Hello world!"

Rhovas

print("Hello world!");

Ring

See "Hello world!"

RISC-V Assembly

.data
hello:
.string "Hello World!\n\0"
.text
main:
la a0, hello
li a7, 4
ecall
li a7, 10
ecall

Roc

app "hello"
    packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.1.1/zAoiC9xtQPHywYk350_b7ust04BmWLW00sjb9ZPtSQk.tar.br" }
    imports [pf.Stdout]
    provides [main] to pf

main =
    Stdout.line "I'm a Roc application!"

Rockstar

Shout "Hello world!"

RPG

**free
dsply 'Hello World!';

RPL

≪ "Hello world!" 1 DISP 
   1 FREEZE                 @ remove this line on HP-28 models
≫ 'TASK' STO

RTL/2

TITLE Goodbye World;

LET NL=10;

EXT PROC(REF ARRAY BYTE) TWRT;

ENT PROC INT RRJOB();

    TWRT("Hello world!#NL#");
    RETURN(1);

ENDPROC;

Ruby

Works with: Ruby version 1.8.4
puts "Hello world!"

or

$stdout.puts "Hello world!"

or even

 STDOUT.write "Hello world!\n"


Using the > global

$>.puts "Hello world!"
$>.write "Hello world!\n"

Run BASIC

print "Hello world!"

Rust

fn main() {
   print!("Hello world!");
}

or

fn main() {
   println!("Hello world!");
}

Salmon

"Hello world!"!

or

print("Hello world!\n");

or

standard_output.print("Hello world!\n");

SAS

/* Using a data step. Will print the string in the log window */
data _null_;
put "Hello world!";
run;

SASL

Note that a string starts with a single and ends with a double quote

'Hello World!",nl

Sather

class GOODBYE_WORLD is
 main is 
  #OUT+"Hello world!\n"; 
 end; 
end;

Scala

Library: Console

Ad hoc REPL solution

Ad hoc solution as REPL script. Type this in a REPL session:

println("Hello world!")

Via Java runtime

This is a call to the Java run-time library. Not recommended.

System.out.println("Hello world!")

Via Scala Console API

This is a call to the Scala run-time library. Recommended.

println("Hello world!")

Short term deviation to out

Console.withErr(Console.out) { Console.err.println("This goes to default _out_") }

Long term deviation to out

  Console.err.println ("Err not deviated")
  Console.setErr(Console.out)
  Console.err.println ("Err deviated")
  Console.setErr(Console.err) // Reset to normal

Scheme

All Scheme implementations display the value of the last evaluated expression before the program terminates.

"Hello world!"

The display and newline procedures are found in specific modules of the standard library in R6RS and R7RS. The previous standards have no concept of modules and the entirety of the standard library is loaded by default.

R5RS

(display "Hello world!")
(newline)

R6RS

(import (rnrs base (6))
        (rnrs io simple (6)))
(display "Hello world!")
(newline)

R7RS

(import (scheme base)
        (scheme write))
(display "Hello world!")
(newline)

Scilab

disp("Hello world!");

ScratchScript

print "Hello world!"

This example waits until the mouse is clicked for the program to end. This can be useful if the program executes too fast for "Hello world!" to be visible on the screen long enough for it to be comfortable.

print "Hello world!"
delayOnClick

sed

i\
Hello world!
q

Seed7

$ include "seed7_05.s7i";

const proc: main is func
  begin
    writeln("Hello world!");
  end func;

Self

'Hello world!' printLine.

SenseTalk

put "Hello world!"

Set lang

set ! H
set ! E
set ! L
set ! L
set ! O
set ! 32
set ! W
set ! O
set ! R
set ! L
set ! D
set ! 33

SETL

print("Hello world!");

SETL4

out("Hello world!");end

Shen

(output "Hello world!~%")

Shiny

say 'Hello world!'

Sidef

„Hello world!”.say;

SimpleCode

The letters are only outputted in uppercase in the running program. However, lowercase characters can be used in the code instead.

dtxt
Hello world!

SIMPOL

function main()
end function "Hello world!{d}{a}"

Simula

Works with: SIMULA-67
BEGIN
   OUTTEXT("Hello world!");
   OUTIMAGE
END

Sing

requires "sio";

public fn singmain(argv [*]string) i32
{
    sio.print("hello world !\r\n");
    return(0);
}

Sisal

define main

% Sisal doesn't yet have a string built-in.
% Let's define one as an array of characters.

type string = array[character];

function main(returns string)
  "Hello world!"
end function

Skew

Works with: skewc version 0.9.19
@entry
def main {
  dynamic.console.log("Hello world!")
}

SkookumScript

print("Hello world!")

Alternatively if just typing in the SkookumIDE REPL:

"Hello world!"

Slate

inform: 'Hello world!'.

Slope

(write "Hello, world!")

SmallBASIC

PRINT "Hello world!"

Smalltalk

Transcript show: 'Hello world!'; cr.
Works with: GNU Smalltalk

(as does the above code)

'Hello world!' printNl.

smart BASIC

PRINT "Hello world!"

SmileBASIC

PRINT "Hello world!"

SNOBOL4

Using CSnobol4 dialect

    OUTPUT = "Hello world!"
END

SNUSP

Core SNUSP

/++++!/===========?\>++.>+.+++++++..+++\
\+++\ | /+>+++++++>/ /++++++++++<<.++>./
$+++/ | \+++++++++>\ \+++++.>.+++.-----\
      \==-<<<<+>+++/ /=.>.+>.--------.-/

Modular SNUSP

@\G.@\o.o.@\d.--b.@\y.@\e.>@\comma.@\.<-@\W.+@\o.+++r.------l.@\d.>+.! #
 |   |     \@------|#  |    \@@+@@++|+++#-    \\               -
 |   \@@@@=+++++#  |   \===--------!\===!\-----|-------#-------/
 \@@+@@@+++++#     \!#+++++++++++++++++++++++#!/

Soda

class Main

  main (arguments : Array [String] ) : Unit =
    println ("Hello world!")

end

SoneKing Assembly

extern print

dv Msg Goodbye,World!

mov eax Msg
push
call print
pop

SPARC Assembly

	.section	".text"
	.global		_start
_start:
	mov	4,%g1			! 4 is SYS_write
	mov	1,%o0			! 1 is stdout
	set	.msg,%o1		! pointer to buffer
	mov	(.msgend-.msg),%o2	! length
	ta	8

	mov	1,%g1			! 1 is SYS_exit
	clr	%o0			! return status is 0
	ta	8

.msg:
	.ascii	"Hello world!\n"
.msgend:

Sparkling

print("Hello world!");

SPL

#.output("Hello world!")

SQL

Works with: Oracle
Works with: Db2 LUW
select 'Hello world!' text from dual;
SQL>select 'Hello world!' text from dual;
TEXT
------------
Hello world!

SQL PL

Works with: Db2 LUW

With SQL only:

SELECT 'Hello world!' AS text FROM sysibm.sysdummy1;

Output:

db2 -t
db2 => SELECT 'Hello world!' AS text FROM sysibm.sysdummy1;

TEXT        
------------
Hello world!

  1 record(s) selected.
Works with: Db2 LUW

version 9.7 or higher.

With SQL PL:

SET SERVEROUTPUT ON;

CALL DBMS_OUTPUT.PUT_LINE('Hello world!');

Output:

db2 -t
db2 => SET SERVEROUTPUT ON
DB20000I  The SET SERVEROUTPUT command completed successfully.
db2 => CALL DBMS_OUTPUT.PUT_LINE('Hello world!')

  Return Status = 0

Hello world!

Standard ML

print "Hello world!\n"

Stata

display "Hello world!"

Suneido

Print("Hello world!")

Swahili

andika("Hello world!")

Swift

Works with: Swift version 2.x+
print("Hello world!")
Works with: Swift version 1.x
println("Hello world!")

Symsyn

 'hello world' []

TailDot

c,x,Hello World!,v,x

Tailspin

'Hello World' -> !OUT::write

Tcl

Output to terminal:

puts stdout {Hello world!}

Output to arbitrary open, writable file:

puts $fileID {Hello world!}

Teco

Outputting to terminal. Please note that ^A means control-A, not a caret followed by 'A', and that $ represent the ESC key.

^AHello world!^A$$

Tern

println("Hello world!");

Terra

C = terralib.includec("stdio.h")

terra hello(argc : int, argv : &rawstring)
  C.printf("Hello world!\n")
  return 0
end

Terraform

output "result" {
  value = "Hello world!"
}
Output:
$ terraform init
$ terraform apply

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

result = Hello world!
$ terraform output result
Hello world!

TestML

%TestML 0.1.0
Print("Hello world!")

TI-57

0.7745

You must then turn the calculator upside down to read the text: screenshot

TI-83 BASIC

Disp "Hello world!

(Lowercase letters DO exist in TI-BASIC, though you need an assembly program to enable them.)

TI-89 BASIC

Disp "Hello world!"

Tiny BASIC

Works with: TinyBasic
10 PRINT "Hello, World!"
20 END

TMG

Unix TMG:

begin: parse(( = { <Hello, World!> * } ));

TorqueScript

echo("Hello world!");

TPP

Hello world!

Transact-SQL

PRINT "Hello world!"

Transd

(textout "Hello, World!")

TransFORTH

PRINT " Hello world! "

Trith

"Hello world!" print

True BASIC

! In True BASIC all programs run in their own window. So this is almost a graphical version.
PRINT "Hello world!"
END

TUSCRIPT

$$ MODE TUSCRIPT
PRINT "Hello world!"

Output:

Hello world!

uBasic/4tH

Print "Hello world!"

Uniface

message "Hello world!"

Unison

main = '(printLine "Hello world!")

UNIX Shell

Works with: Bourne Shell
#!/bin/sh
echo "Hello world!"

C Shell

#!/bin/csh -f
echo "Hello world!\!"

We use \! to prevent history substitution. Plain ! at end of string seems to be safe, but we use \! to be sure.

Unlambda

`r```````````````.G.o.o.d.b.y.e.,. .W.o.r.l.d.!i

Ursa

out "hello world!" endl console

Ursala

output as a side effect of compilation

#show+

main = -[Hello world!]-

output by a compiled executable

#import std

#executable ('parameterized','')

main = <file[contents: -[Hello world!]-]>!

Ursalang

print("hello woods!")

உயிர்/Uyir

முதன்மை என்பதின் வகை எண் பணி {{
         ("உலகத்தோருக்கு வணக்கம்") என்பதை திரை.இடு;

         முதன்மை = 0;
}};

Uxntal

( hello-world.tal )
|00 @System  [ &vector $2 &wst  $1 &rst $1 &eaddr $2 &ecode $1 &pad $1 &r $2 &g $2 &b $2 &debug $1 &halt $1 ]
|10 @Console [ &vector $2 &read $1 &pad $5 &write $1 &error $1 ]

( program )
|0100 @on-reset ( -> )
    ;hello print-str
    HALT
BRK

@print-str ( str* -- )
    &while
        LDAk .Console/write DEO
        INC2 LDAk ?&while
    POP2
JMP2r

@HALT ( -- )
    #01 .System/halt DEO
JMP2r

@hello "Hello 20 "world! 0a 00

V

"Hello world!" puts

Vala

void main(){
	stdout.printf("Hello world!\n");
}

Vale

Works with: Vale version 0.2.0
import stdlib.*;

exported func main() {
	println("Hello world!");
}

VAX Assembly

desc:  .ascid "Hello World!"      ;descriptor (len+addr) and text
.entry hello, ^m<>                ;register save mask
       pushaq desc                ;address of descriptor
       calls #1, g^lib$put_output ;call with one argument on stack
       ret                        ;restore registers, clean stack & return
.end hello                        ;transfer address for linker

VBA

Public Sub hello_world_text
    Debug.Print "Hello World!"
End Sub


VBScript

Works with: Windows Script Host version 5.7
WScript.Echo "Hello world!"

Vedit macro language

Message("Hello world!")

Verbexx

@SAY "Hello world!";


Verilog

module main;
  initial begin
      $display("Hello world!");
      $finish ;
    end
endmodule

VHDL

LIBRARY std;
USE std.TEXTIO.all;

entity test is
end entity test;

architecture beh of test is
begin
  process
    variable line_out : line;
  begin
    write(line_out, string'("Hello world!"));
    writeline(OUTPUT, line_out);
    wait; -- needed to stop the execution
  end process;
end architecture beh;

Vim Script

echo "Hello world!\n"

Visual Basic

Works with: Visual Basic version VB6 Standard

Visual Basic 6 is actually designed to create GUI applications, however with a little help from the Microsoft.Scripting Library it is fairly easy to write a simple console application.

Option Explicit

Private Declare Function AllocConsole Lib "kernel32.dll" () As Long
Private Declare Function FreeConsole Lib "kernel32.dll" () As Long
'needs a reference set to "Microsoft Scripting Runtime" (scrrun.dll)

Sub Main()
  Call AllocConsole
  Dim mFSO As Scripting.FileSystemObject
  Dim mStdIn As Scripting.TextStream
  Dim mStdOut As Scripting.TextStream
  Set mFSO = New Scripting.FileSystemObject
  Set mStdIn = mFSO.GetStandardStream(StdIn)
  Set mStdOut = mFSO.GetStandardStream(StdOut)
  mStdOut.Write "Hello world!" & vbNewLine
  mStdOut.Write "press enter to quit program."
  mStdIn.Read 1
  Call FreeConsole
End Sub

Visual Basic .NET

Imports System

Module HelloWorld
    Sub Main()
        Console.WriteLine("Hello world!")
    End Sub
End Module

Viua VM assembly

.function: main/0
    text %1 local "Hello World!"
    print %1 local
    izero %0 local
    return
.end

V (Vlang)

fn main() {
        println('Hello World!')
}

VTL-2

10 ?="Hello world!"

Waduzitdo

T:Hello world!
S:

Wart

prn "Hello world!"

WDTE

io.writeln io.stdout 'Hello world!';

WebAssembly

Library: WASI
(module $helloworld

    ;;Import fd_write from WASI, declaring that it takes 4 i32 inputs and returns 1 i32 value
    (import "wasi_unstable" "fd_write"
        (func $fd_write (param i32 i32 i32 i32) (result i32))
    )

    ;;Declare initial memory size of 32 bytes
    (memory 32)

    ;;Export memory so external functions can see it
    (export "memory" (memory 0))
 
    ;;Declare test data starting at address 8
    (data (i32.const 8) "Hello world!\n")
 
    ;;The entry point for WASI is called _start
    (func $main (export "_start")
        
        ;;Write the start address of the string to address 0
        (i32.store (i32.const 0) (i32.const 8)) 
 
        ;;Write the length of the string to address 4
        (i32.store (i32.const 4) (i32.const 13))

        ;;Call fd_write to print to console
        (call $fd_write
            (i32.const 1) ;;Value of 1 corresponds to stdout
            (i32.const 0) ;;The location in memory of the string pointer
            (i32.const 1) ;;Number of strings to output
            (i32.const 24) ;;Address to write number of bytes written
        )
        drop ;;Ignore return code
    )
)

Wee Basic

print 1 "Hello world!"
end

Whenever

1 print("Hello world!");

Whiley

import whiley.lang.System

method main(System.Console console):
    console.out.println("Hello world!")

Whitespace

There is a "Hello World" - example-program on the Whitespace-website

Wisp

Output in Wisp follows the same concepts as Scheme, but replacing outer parentheses with indentation.

With Guile and wisp installed, this example can be tested in a REPL started with guile --language=wisp, or directly with the command wisp.

import : scheme base
         scheme write
display "Hello world!"
newline

Wolfram Language

Print["Hello world!"]

Wren

System.print("Hello world!")

X10

class HelloWorld {
  public static def main(args:Rail[String]):void {
    if (args.size < 1) {
        Console.OUT.println("Hello world!");
        return;
    }
  }
}

X86 Assembly

Works with: nasm version 2.05.01

This is known to work on Linux, it may or may not work on other Unix-like systems

Prints "Hello world!" to stdout (and there is probably an even simpler version):

section .data
msg     db      'Hello world!', 0AH
len     equ     $-msg

section .text
global  _start
_start: mov     edx, len
        mov     ecx, msg
        mov     ebx, 1
        mov     eax, 4
        int     80h

        mov     ebx, 0
        mov     eax, 1
        int     80h

AT&T syntax: works with gcc (version 4.9.2) and gas (version 2.5):

.section .text

.globl main

main:
	movl $4,%eax	#syscall number 4
	movl $1,%ebx	#number 1 for stdout
	movl $str,%ecx	#string pointer
	movl $16,%edx	#number of bytes
	int $0x80	#syscall interrupt
	ret

.section .data
str: .ascii "Hello world!\12"

X86-64 Assembly

UASM

option casemap:none
if @Platform eq 1
   option dllimport:<kernel32>
      ExitProcess   proto :dword
   option dllimport:none
      exit          equ ExitProcess
endif
printf              proto :qword, :vararg
exit                proto :dword

.code
main proc
invoke printf, CSTR("Goodbye, World!",10)
invoke exit, 0
ret
main endp
end

AT&T syntax (Gas)

// No "main" used
// compile with `gcc -nostdlib`
#define SYS_WRITE   $1
#define STDOUT      $1
#define SYS_EXIT    $60
#define MSGLEN      $14

.global _start
.text

_start:
    movq    $message, %rsi          // char *
    movq    SYS_WRITE, %rax
    movq    STDOUT, %rdi
    movq    MSGLEN, %rdx
    syscall                         // sys_write(message, stdout, 0x14);
    
    movq    SYS_EXIT, %rax
    xorq    %rdi, %rdi              // The exit code.
    syscall                         // exit(0)
    
.data
message:    .ascii "Hello, world!\n"

XBasic

Works with: Windows XBasic
PROGRAM "hello"
VERSION "0.0003"

DECLARE FUNCTION Entry()

FUNCTION Entry()
  PRINT "Hello World"
END FUNCTION
END PROGRAM

xEec

h#10 h$! h$d h$l h$r h$o h$w h#32  
h$o h$l h$l h$e h$H >o o$ p jno

XL

use XL.UI.CONSOLE
WriteLn "Hello world!"

XLISP

(DISPLAY "Hello world!")
(NEWLINE)

XPL0

code Text=12;
Text(0, "Hello world!
")

XPath

'Hello world&#xA;'

XSLT

With a literal newline:

<xsl:text>Hello world!
</xsl:text>

Or, with an explicit newline:

<xsl:text>Hello world!&#xA;</xsl:text>

Yabasic

print "Hello world!"

YAMLScript

All the following examples are valid YAML and valid YAMLScript.

This is a good example of various ways to write function calls in YAMLScript.

Since function calls must fit into their YAML context, which may be mappings or scalars; it is actually useful to support these variants.

!yamlscript/v0

say: "Hello, world!"

=>: (say "Hello, world!")

=>: say("Hello, world!")

say:
  =>: "Hello, world!"

say: ("Hello, " + "world!")

say: ."Hello," "world!"

say "Hello,": "world!"

say "Hello," "world!":

Yorick

write, "Hello world!"

Z80 Assembly

Using the Amstrad CPC firmware:

org		$4000

txt_output:	equ	$bb5a

		push	hl
		ld	hl,world

print:		ld	a,(hl)
		cp	0
		jr	z,end
		call	txt_output
		inc	hl
		jr	print

end:		pop	hl
		ret

world:		defm	"Hello world!\r\n\0"

zkl

println("Hello world!");

Zig

Works with: 0.10.x, 0.11.x, 0.12.0-dev.1389+42d4d07ef

const std = @import("std");

pub fn main() std.fs.File.WriteError!void {
    const stdout = std.io.getStdOut();

    try stdout.writeAll("Hello world!\n");
}

Zoea

program: hello_world 
  output: "Hello  world!"

Zoea Visual

Hello World

Zoomscript

For typing:

print "Hello world!"

For importing:

¶0¶print "Hello world!"

ZX Spectrum Basic

10 print "Hello world!"