Hello world/Text: Difference between revisions

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
No edit summary
(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)
(464 intermediate revisions by more than 100 users not shown)
Line 9:
*   [[Hello world/Graphical]]
*   [[Hello world/Line Printer]]
*   [[Hello world/Newbie]]
*   [[Hello world/Newline omission]]
*   [[Hello world/Standard error]]
Line 15 ⟶ 16:
 
=={{header|0815}}==
<langsyntaxhighlight lang="0815">
<:48:x<:65:=<:6C:$=$=$$~<:03:+
$~<:ffffffffffffffb1:+$<:77:~$
Line 21 ⟶ 22:
<:06:x-$x<:0e:x-$=x<:43:x-$
 
</syntaxhighlight>
</lang>
 
=={{header|11l}}==
<syntaxhighlight lang="11l">print(‘Hello world!’)</syntaxhighlight>
 
=={{header|360 Assembly}}==
Using native SVC (Supervisor Call) to write to system console:
<syntaxhighlight lang="360 assembly">
<lang 360 Assembly> LA 1,MSGAREA Point Register 1 to message area
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
Line 32 ⟶ 39:
DC XL2'00' 2 bytes binary of zeros
DC C'Hello world!' Text to be written to system console
END</langsyntaxhighlight>
Using WTO Macro to generate SVC 35 and message area:
<langsyntaxhighlight lang="360 Assemblyassembly"> WTO 'Hello world!'
BR 14 Return
END</lang>
</syntaxhighlight>
 
=={{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}}==
<syntaxhighlight lang ="4dos">echo Hello world!</langsyntaxhighlight>
 
=={{header|6502 Assembly}}==
<langsyntaxhighlight lang="asm">; 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 KERNALKERNEL ROM, output a character to current device.
; use $fded for Apple 2, $ffe3 (ascii) or $ffee (raw) for BBC.
.code
 
Line 63 ⟶ 207:
 
text:
.byte "Hello world!", a_cr, 0</langsyntaxhighlight>
 
=={{header|6800 Assembly}}==
<syntaxhighlight lang="text"> .cr 6800
.tf gbye6800.obj,AP1
.lf gbye6800
Line 96 ⟶ 240:
;=====================================================;
string .as "Hello world!",#13,#10,#0
.en</langsyntaxhighlight>
 
=={{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}}==
 
<langsyntaxhighlight lang="masm">DOSSEG
.MODEL TINY
.DATA
Line 115 ⟶ 273:
MOV AX, 4C00h ; go back to DOS
INT 21h
END START</langsyntaxhighlight>
 
With A86 or NASM syntax:
Line 131 ⟶ 289:
 
=={{header|8th}}==
<langsyntaxhighlight lang="forth">"Hello world!\n" . bye</langsyntaxhighlight>
 
=={{header|AArch64 Assembly}}==
<syntaxhighlight lang="arm_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</syntaxhighlight>
 
=={{header|ABAP}}==
<langsyntaxhighlight ABAPlang="abap">REPORT zgoodbyeworld.
WRITE 'Hello world!'.</langsyntaxhighlight>
 
=={{header|ACL2}}==
<langsyntaxhighlight lang="lisp">(cw "Hello world!~%")</langsyntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight ActionScriptlang="actionscript">trace("Hello world!");</langsyntaxhighlight>
 
=={{header|Ada}}==
{{works with|GCC|4.1.2}}
<langsyntaxhighlight lang="ada">with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
begin
Put_Line ("Hello world!");
end Main;</langsyntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight lang="agena">print( "Hello world!" )</langsyntaxhighlight>
 
=={{header|Aime}}==
<langsyntaxhighlight lang="aime">o_text("Hello world!\n");</langsyntaxhighlight>
 
or:
 
<langsyntaxhighlight lang="aime">integer
main(void)
{
Line 165 ⟶ 376:
 
return 0;
}</langsyntaxhighlight>
 
=={{header|Algae}}==
<langsyntaxhighlight lang="algae">printf("Hello world!\n");</langsyntaxhighlight>
 
=={{header|ALGOL 60}}==
<langsyntaxhighlight lang="algol60">'BEGIN'
OUTSTRING(1,'('Hello world!')');
SYSACT(1,14,1)
'END'</langsyntaxhighlight>
 
=={{header|ALGOL 68}}==
<langsyntaxhighlight lang="algol68">main: (
printf($"Hello world!"l$)
)</langsyntaxhighlight>
 
=={{header|ALGOL-M}}==
<lang algol>BEGIN
WRITE( "Hello world!" );
END</lang>
 
=={{header|ALGOL W}}==
<langsyntaxhighlight lang="algolw">begin
write( "Hello world!" )
end.</langsyntaxhighlight>
 
=={{header|ALGOL-M}}==
<syntaxhighlight lang="algol">BEGIN
WRITE( "Hello world!" );
END</syntaxhighlight>
 
=={{header|Alore}}==
<syntaxhighlight lang ="alore">Print('Hello world!')</langsyntaxhighlight>
=={{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}}==
<langsyntaxhighlight lang="ambienttalk">system.println("Hello world!")</langsyntaxhighlight>
 
=={{header|AmigaE}}==
<langsyntaxhighlight lang="amigae">PROC main()
WriteF('Hello world!\n')
ENDPROC</langsyntaxhighlight>
 
=={{header|AngelScript}}==
<syntaxhighlight lang="angelscript">void main() { print("Hello world\n"); }</syntaxhighlight>
 
=={{header|AntLang}}==
Note, that "Hello, World!" prints twice in interactive mode.
One time as side-effect and one as the return value of echo.
<langsyntaxhighlight AntLanglang="antlang">echo["Hello, World!"]</langsyntaxhighlight>
 
=={{header|Anyways}}==
 
<langsyntaxhighlight Anywayslang="anyways">There was a guy called Hello World
"Ow!" it said.
That's all folks!</langsyntaxhighlight>
 
=={{header|APL}}==
<syntaxhighlight lang ="apl">'Hello world!'</langsyntaxhighlight>
 
=={{header|AppleScript}}==
To show in Script Editor Result pane:
<langsyntaxhighlight lang="applescript">"Hello world!"</langsyntaxhighlight>
 
To show in Script Editor Event Log pane:
<langsyntaxhighlight lang="applescript">log "Hello world!"</langsyntaxhighlight>
 
=={{header|Applesoft BASIC}}==
Line 228 ⟶ 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.
 
<syntaxhighlight lang="applesoft Applesoft BASICbasic"> PRINT "Hello world!"</langsyntaxhighlight>
 
=={{header|Apricot}}==
<langsyntaxhighlight lang="apricot">(puts "Hello world!")</langsyntaxhighlight>
 
=={{header|Arc}}==
<syntaxhighlight lang="arc">(prn "Hello world!")</syntaxhighlight>
 
=={{header|Arendelle}}==
Line 237 ⟶ 476:
 
=={{header|Argile}}==
<langsyntaxhighlight Argilelang="argile">use std
print "Hello world!"</langsyntaxhighlight>
compile with: arc hello_world.arg -o hello_world.c && gcc -o hello_world hello_world.c
 
=={{header|ARM Assembly}}==
 
<langsyntaxhighlight ARM_Assemblylang="arm_assembly">.global main
 
message:
Line 254 ⟶ 493:
 
mov r7, #1
swi 0</langsyntaxhighlight>
 
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}}==
<syntaxhighlight lang="arnoldc">IT'S SHOWTIME
TALK TO THE HAND "Hello world!"
YOU HAVE BEEN TERMINATED</syntaxhighlight>
 
=={{header|Arturo}}==
<syntaxhighlight lang="rebol">print "Hello world!"</syntaxhighlight>
 
{{out}}
 
<pre>Hello world!</pre>
 
=={{header|AsciiDots}}==
 
<syntaxhighlight lang="asciidots">
.-$'Hello, World!'
</syntaxhighlight>
 
=={{header|Astro}}==
<langsyntaxhighlight lang="python">print "Hello world!"</langsyntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight ATSlang="ats">implement main0 () = print "Hello world!\n"</langsyntaxhighlight>
 
=={{header|AutoHotkey}}==
script launched from windows explorer
<langsyntaxhighlight AutoHotkeylang="autohotkey">DllCall("AllocConsole")
FileAppend, Goodbye`, World!, CONOUT$
FileReadLine, _, CONIN$, 1</langsyntaxhighlight>
scripts run from shell
[requires Windows XP or higher; older Versions of Windows don´t have the "AttachConsole" function]
<langsyntaxhighlight AutoHotkeylang="autohotkey">DllCall("AttachConsole", "int", -1)
FileAppend, Goodbye`, World!, CONOUT$</langsyntaxhighlight>
<syntaxhighlight lang AutoHotkey="autohotkey">SendInput Hello world!{!}</langsyntaxhighlight>
 
=={{header|AutoIt}}==
<langsyntaxhighlight AutoItlang="autoit">ConsoleWrite("Hello world!" & @CRLF)</langsyntaxhighlight>
 
=={{header|AutoLISP}}==
<langsyntaxhighlight lang="cadlisp">(printc "Hello World!")</langsyntaxhighlight>
 
=={{header|Avail}}==
<syntaxhighlight lang="avail">Print: "Hello World!";</syntaxhighlight>
 
=={{header|AWK}}==
<langsyntaxhighlight lang="awk">BEGIN{print "Hello world!"}</langsyntaxhighlight>
 
 
"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.
<langsyntaxhighlight lang="awk">
END {
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.
<langsyntaxhighlight lang="awk">
// {
print "Hello world!"
exit
}
</syntaxhighlight>
</lang>
 
 
For a "single record" file.
<langsyntaxhighlight lang="awk">
// {
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.
<langsyntaxhighlight lang="awk">
//
</syntaxhighlight>
</lang>
 
=={{header|Axe}}==
Note that the i here is the imaginary ''i'', not the lowercase letter i.
<langsyntaxhighlight lang="axe">Disp "Hello world!",i</langsyntaxhighlight>
 
=={{header|B}}==
{{works with|The Amsterdam Compiler Kit - B|V6.1pre1}}
<syntaxhighlight lang="b">main()
{
putstr("Hello world!*n");
return(0);
}</syntaxhighlight>
 
=={{header|B4X}}==
<syntaxhighlight lang="b4x">Log("Hello world!")</syntaxhighlight>
 
=={{header|Babel}}==
 
<langsyntaxhighlight lang="babel">"Hello world!" <<</langsyntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight lang="bash">echo "Hello world!"</langsyntaxhighlight>
 
=={{header|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}}
<langsyntaxhighlight lang="qbasic">10 print "Hello world!"</langsyntaxhighlight>
 
 
{{works with|7Basic}}
{{works with|Applesoft BASIC}}
{{works with|BaCon}} [[Category:BaCon]]
{{works with|BASIC256}}
{{works with|FreeBASIC}}
{{works with|IS-BASIC}}
{{works with|M2000 Interpreter}}
{{works with|QBasic}}
{{works with|QB64}}
<lang qbasic>PRINT "Hello world!"</lang>
{{works with|Script Basic}}
{{works with|SmallBASIC}}
{{works with|Yabasic}}
<syntaxhighlight lang="qbasic">PRINT "Hello world!"</syntaxhighlight>
 
=={{header|BASIC256}}==
<langsyntaxhighlight BASIC256lang="basic256">PRINT "Hello world!"</langsyntaxhighlight>
 
=={{header|Batch File}}==
'''Under normal circumstances, when delayed expansion is disabled'''
<syntaxhighlight lang ="dos">echo Hello world!</langsyntaxhighlight>
 
'''If delayed expansion is enabled, then the ! must be escaped twice'''
<langsyntaxhighlight lang="dos">setlocal enableDelayedExpansion
echo Hello world!^^!</langsyntaxhighlight>
 
=={{header|Battlestar}}==
<!--- supports C syntax highlighting --->
<langsyntaxhighlight lang="c">const hello = "Hello world!\n"
 
print(hello)</langsyntaxhighlight>
 
=={{header|BBC BASIC}}==
<langsyntaxhighlight lang="bbcbasic"> PRINT "Hello world!"</langsyntaxhighlight>
 
=={{header|bc}}==
<langsyntaxhighlight lang="bc">"Hello world!
"</langsyntaxhighlight>
 
=={{header|BCPL}}==
<langsyntaxhighlight BCPLlang="bcpl">GET "libhdr"
 
LET start() = VALOF
{ writef("Hello world!")
RESULTIS 0
}</langsyntaxhighlight>
 
=={{header|Beef}}==
<syntaxhighlight lang=csharp>Using System;
namespace HelloWorld {
class Program
{
static void Main()
{
Console.Writeln("Hello World!");
}
}
}
</syntaxhighlight>
 
=={{header|beeswax}}==
Straightforward:
 
<syntaxhighlight lang Beeswax="beeswax">*`Hello, World!</langsyntaxhighlight>
 
Less obvious way:
 
<langsyntaxhighlight lang="beeswax">>`ld!
`
r
Line 382 ⟶ 783:
W
`
b` ,olleH`_</langsyntaxhighlight>
 
Even less obvious, demonstrating the creation and execution order of instruction pointers, and the hexagonal layout of beeswax programs:
 
<langsyntaxhighlight lang="beeswax">r l
l o
``
Line 392 ⟶ 793:
``
e H
W</langsyntaxhighlight>
 
=={{header|Befunge}}==
<langsyntaxhighlight lang="befunge">52*"!dlroW ,eybdooGolleH">:#,_@</langsyntaxhighlight>
 
=={{header|Binary Lambda Calculus}}==
As explained at https://www.ioccc.org/2012/tromp/hint.html
<pre> Hello world!</pre>
 
=={{header|Bird}}==
It's not possible to print exclamation marks in [[Bird]] which is why it is not used in this example.
<syntaxhighlight lang="bird">use Console
 
define Main
Console.Println "Hello world"
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}}==
<langsyntaxhighlight lang="blast"># This will display a goodbye message on the terminal screen
.begin
display "Hello world!"
return
# This is the end of the script.</langsyntaxhighlight>
 
=={{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}}==
<syntaxhighlight lang="blz">print("Hello world!")</syntaxhighlight>
 
=={{header|BML}}==
<langsyntaxhighlight lang="bml">display "Hello world!"</langsyntaxhighlight>
 
=={{header|Boo}}==
<langsyntaxhighlight lang="boo">print "Hello world!"</langsyntaxhighlight>
 
=={{header|bootBASIC}}==
<syntaxhighlight lang="BASIC">10 print "Hello world!"</syntaxhighlight>
 
=={{header|BQN}}==
 
Works in: [[CBQN]]
 
<syntaxhighlight lang="bqn">•Out "Hello world!"</syntaxhighlight>
 
=={{header|Brace}}==
<langsyntaxhighlight lang="brace">#!/usr/bin/env bx
use b
Main:
say("Hello world!")</langsyntaxhighlight>
 
=={{header|Bracmat}}==
<langsyntaxhighlight lang="bracmat">put$"Hello world!"</langsyntaxhighlight>
 
=={{header|Brainf***}}==
Line 436 ⟶ 894:
 
Commented version:
<langsyntaxhighlight lang="bf">+++++ +++++ First cell 10 (its a counter and we will be "multiplying")
 
[
Line 494 ⟶ 952:
 
CRLF
< +++ . --- .</langsyntaxhighlight>
 
Uncommented:
<langsyntaxhighlight lang="bf">++++++++++[>+>+++>++++>+++++++>++++++++>+++++++++>++
++++++++>+++++++++++>++++++++++++<<<<<<<<<-]>>>>+.>>>
>+..<.<++++++++.>>>+.<<+.<<<<++++.<++.>>>+++++++.>>>.+++.
<+++++++.--------.<<<<<+.<+++.---.</langsyntaxhighlight>
It can most likely be optimized, but this is a nice way to show
how character printing works in Brainf*** :)
 
=={{header|Brat}}==
<langsyntaxhighlight lang="brat">p "Hello world!"</langsyntaxhighlight>
 
=={{header|Brlcad}}==
Line 511 ⟶ 969:
The mged utility can output text to the terminal:
 
<langsyntaxhighlight lang="brlcad">
echo Hello world!
</syntaxhighlight>
</lang>
 
=={{header|Bruijn}}==
 
Ignore stdin by not referring to the abstraction:
 
<syntaxhighlight lang="bruijn">
main ["Hello world!"]
</syntaxhighlight>
 
=={{header|Burlesque}}==
 
<langsyntaxhighlight lang="burlesque">
"Hello world!"sh
</syntaxhighlight>
</lang>
 
Although please note that ''sh'' actually does not print anything.
Line 525 ⟶ 991:
=={{header|C}}==
{{works with|gcc|4.0.1}}
<langsyntaxhighlight lang="c">#include <stdlib.h>
#include <stdio.h>
 
Line 532 ⟶ 998:
printf("Hello world!\n");
return EXIT_SUCCESS;
}</langsyntaxhighlight>
Or:
<langsyntaxhighlight lang="c">#include <stdlib.h>
#include <stdio.h>
 
Line 541 ⟶ 1,007:
puts("Hello world!");
return EXIT_SUCCESS;
}</langsyntaxhighlight>
Or, the eternal favourite :)
<syntaxhighlight lang="c">
<lang c>
#include<stdio.h>
 
Line 550 ⟶ 1,016:
printf("\nHello world!");
return 0;
}</langsyntaxhighlight>
 
or better yet...
<syntaxhighlight lang="c">
<lang C>
#include<stdio.h>
 
Line 560 ⟶ 1,026:
return printf("\nHello World!");
}
</syntaxhighlight>
</lang>
 
=={{header|C sharp|C#}}==
{{works with|Mono|1.2}}
{{works with|Visual C sharp|Visual C#|2003}}
<langsyntaxhighlight lang="csharp">namespace HelloWorld
{
class Program
Line 574 ⟶ 1,040:
}
}
}</langsyntaxhighlight>
 
{{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++}}==
<langsyntaxhighlight lang="cpp">#include <iostream>
 
int main () {
std::cout << "Hello world!\n" << std::endl;
}</langsyntaxhighlight>
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}}==
<langsyntaxhighlight lang="cpp">using namespace System;
int main()
{
Console::WriteLine("Hello world!");
}</langsyntaxhighlight>
 
=={{header|C1R}}==
<syntaxhighlight lang C0H="c0h">Hello_world/Text</langsyntaxhighlight>
{{out}}
<pre>
Line 599 ⟶ 1,078:
Hello world!
</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}}==
<langsyntaxhighlight Catlang="cat">"Hello world!" writeln</langsyntaxhighlight>
 
=={{header|Cduce}}==
<langsyntaxhighlight Cducelang="cduce">print "Hello world!";;</langsyntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight Cheflang="chef">Goodbye World Souffle.
Ingredients.
Line 642 ⟶ 1,159:
Pour contents of the mixing bowl into the baking dish.
Serves 1.</langsyntaxhighlight>
 
=={{header|Chipmunk Basic}}==
<syntaxhighlight lang="qbasic">10 print "Hello world!"</syntaxhighlight>
 
=={{header|ChucK}}==
<syntaxhighlight lang="text"><<< "Hello world!">>>;</langsyntaxhighlight>
 
=={{header|Cind}}==
 
<syntaxhighlight lang="cind">
execute() {
host.println("Hello world!");
}
</syntaxhighlight>
 
=={{header|Clay}}==
<langsyntaxhighlight lang="clay">main() {
println("Hello world!");
}</langsyntaxhighlight>
 
=={{header|Clean}}==
<langsyntaxhighlight lang="clean">Start = "Hello world!"</langsyntaxhighlight>
 
=={{header|Clio}}==
<syntaxhighlight lang="clio">'hello world!' -> print</syntaxhighlight>
 
=={{header|Clipper}}==
<langsyntaxhighlight Clipperlang="clipper">? "Hello world!"</langsyntaxhighlight>
 
=={{header|CLIPS}}==
<langsyntaxhighlight lang="clips">(printout t "Hello world!" crlf)</langsyntaxhighlight>
 
=={{header|CLU}}==
<syntaxhighlight lang="clu">start_up = proc ()
po: stream := stream$primary_output()
stream$putl(po, "Hello world!")
end start_up</syntaxhighlight>
 
=={{header|Clojure}}==
<langsyntaxhighlight lang="lisp">(println "Hello world!")</langsyntaxhighlight>
 
=={{header|CMake}}==
<langsyntaxhighlight lang="cmake">message(STATUS "Hello world!")</langsyntaxhighlight>
 
This outputs
Line 676 ⟶ 1,213:
{{works with|Dell Enterprise COBOL}}
 
<langsyntaxhighlight lang="cobol"> program-id. hello.
procedure division.
display "Hello world!".
stop run.</langsyntaxhighlight>
 
Using relaxed compilation rules, the hello program can become a single DISPLAY statement.
{{works with|GnuCOBOL}}
 
<syntaxhighlight lang="cobol">display"Hello, world".</syntaxhighlight>
 
<pre>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</pre>
 
''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.''
 
=={{header|Cobra}}==
<langsyntaxhighlight lang="cobra">class Hello
def main
print 'Hello world!'</langsyntaxhighlight>
 
=={{header|CoffeeScript}}==
{{works with|Node.js}}
<langsyntaxhighlight lang="coffeescript">console.log "Hello world!"</langsyntaxhighlight>
{{works with|Rhino engine}}
<langsyntaxhighlight lang="coffeescript">print "Hello world!"</langsyntaxhighlight>
 
=={{header|ColdFusion}}==
<langsyntaxhighlight lang="coldfusion"><cfoutput>Hello world!</cfoutput></langsyntaxhighlight>
 
=={{header|Comal}}==
<langsyntaxhighlight Comallang="comal">PRINT "Hello world!"</langsyntaxhighlight>
 
=={{header|Comefrom0x10}}==
<syntaxhighlight lang ="cf0x10">'Hello world!'</langsyntaxhighlight>
 
<langsyntaxhighlight lang="cf0x10">"Hello world!"</langsyntaxhighlight>
 
=={{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.
<syntaxhighlight lang="gwbasic">10 print chr$(147);chr$(14);:REM 147=clear screen, 14=switch to lowercase mode
20 print "Hello world!"
30 end
</syntaxhighlight>
 
{{Out}}<pre>Hello world!</pre>
 
=={{header|Common Lisp}}==
<langsyntaxhighlight lang="lisp">(format t "Hello world!~%")</langsyntaxhighlight>
 
Or
 
<langsyntaxhighlight lang="lisp">(print "Hello world!")</langsyntaxhighlight>
 
===Alternate solution===
I use [https://franz.com/downloads/clp/survey Allegro CL 10.1]
 
<syntaxhighlight lang="lisp">
;; Project : Hello world/Text
 
(format t "~a" "Hello world!")
</syntaxhighlight>
Output:
<pre>
Hello world!
</pre>
 
=={{header|Component Pascal}}==
<langsyntaxhighlight lang="oberon2">
MODULE Hello;
IMPORT Out;
Line 719 ⟶ 1,292:
Out.String("Hello world!"); Out.Ln
END Do;
END Hello.</langsyntaxhighlight>
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}}==
<langsyntaxhighlight lang="crack">
import crack.io cout;
cout `Hello world!\n`;
</syntaxhighlight>
</lang>
 
=={{header|Craft Basic}}==
<syntaxhighlight lang="basic">print "Hello world!"</syntaxhighlight>
 
=={{header|Creative Basic}}==
<syntaxhighlight lang="creative basic">
<lang Creative Basic>
OPENCONSOLE
 
Line 743 ⟶ 1,335:
 
END
</syntaxhighlight>
</lang>
 
=={{header|Crystal}}==
<langsyntaxhighlight lang="ruby">puts "Hello world!"</langsyntaxhighlight>
 
=={{header|Curto}}==
<syntaxhighlight lang="curto">." Hola, mundo!"</syntaxhighlight>
 
=={{header|D}}==
{{works with|D|2.0}}
<langsyntaxhighlight Dlang="d">import std.stdio;
 
void main() {
writeln("Hello world!");
}</langsyntaxhighlight>
 
=={{header|Dafny}}==
<langsyntaxhighlight lang="dafny">
method Main() {
print "hello, world!\n";
assert 10 < 2;
}
</syntaxhighlight>
</lang>
 
=={{header|Dao}}==
<langsyntaxhighlight lang="dao">io.writeln( 'Hello world!' )</langsyntaxhighlight>
 
=={{header|Dart}}==
<langsyntaxhighlight lang="dart">main() {
var bye = 'Hello world!';
print("$bye");
}</langsyntaxhighlight>
 
=={{header|DataWeave}}==
<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}}==
<syntaxhighlight lang="dc">[Hello world!]p</syntaxhighlight>
...or print a numerically represented string.
<syntaxhighlight lang="dc">5735816763073014741799356604682 P</syntaxhighlight>
 
=={{header|dc}}==
<lang dc>[Hello world!]p</lang>
=={{header|DCL}}==
<langsyntaxhighlight DCLlang="dcl">$ write sys$output "Hello world!"</langsyntaxhighlight>
 
=={{header|DDNC}}==
Line 788 ⟶ 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.
 
<langsyntaxhighlight lang="ddnc">
0 111 10
0 15 11
Line 818 ⟶ 1,436:
61 4
64
</syntaxhighlight>
</lang>
 
=={{header|Déjà Vu}}==
<lang dejavu>!print "Hello world!"</lang>
 
=={{header|DeviousYarn}}==
<lang deviousyarn>o:"Hello world!</lang>
 
=={{header|Delphi}}==
<langsyntaxhighlight lang="delphi">
program ProjectGoodbye;
{$APPTYPE CONSOLE}
Line 833 ⟶ 1,445:
WriteLn('Hello world!');
end.
</syntaxhighlight>
</lang>
 
=={{header|DeviousYarn}}==
<syntaxhighlight lang="deviousyarn">o:"Hello world!</syntaxhighlight>
 
=={{header|DIBOL-11}}==
<syntaxhighlight lang="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
 
</syntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight lang="div">
PROGRAM HELLOWORLD;
 
Line 847 ⟶ 1,492:
END
 
</syntaxhighlight>
</lang>
 
=={{header|DM}}==
<syntaxhighlight lang="dm">
<lang DM>
/client/New()
..()
src << "Hello world!"
</syntaxhighlight>
</lang>
 
=={{header|Draco}}==
<syntaxhighlight lang="draco">proc nonrec main() void:
writeln("Hello world!")
corp</syntaxhighlight>
 
=={{header|Dragon}}==
<syntaxhighlight lang="dragon">
showln "Hello world!"
</syntaxhighlight>
 
=={{header|DreamBerd}}==
<syntaxhighlight lang="text">
print "Hello world!"!
</syntaxhighlight>
 
=={{header|dt}}==
<syntaxhighlight lang="dt">"Hello world!" pl</syntaxhighlight>
 
=={{header|DWScript}}==
<langsyntaxhighlight lang="delphi">
PrintLn('Hello world!');
</syntaxhighlight>
</lang>
 
=={{header|Dyalect}}==
<syntaxhighlight lang="dyalect">print("Hello world!")</syntaxhighlight>
 
=={{header|Dylan}}==
<syntaxhighlight lang="dylan">
<lang Dylan>
module: hello-world
 
format-out("%s\n", "Hello world!");
</syntaxhighlight>
</lang>
 
=={{header|Dylan.NET}}==
Line 876 ⟶ 1,542:
{{works with|.NET|4.5}}
One Line version:
<langsyntaxhighlight Dylanlang="dylan.NETnet">Console::WriteLine("Hello world!")</langsyntaxhighlight>
 
Hello World Program:
<syntaxhighlight lang="dylan.net">
<lang Dylan.NET>
//compile using the new dylan.NET v, 11.5.1.2 or later
//use mono to run the compiler
Line 896 ⟶ 1,562:
 
end class
</syntaxhighlight>
</lang>
 
=={{header|Déjà Vu}}==
<syntaxhighlight lang="dejavu">!print "Hello world!"</syntaxhighlight>
 
=={{header|E}}==
<langsyntaxhighlight lang="e">println("Hello world!")
 
stdout.println("Hello world!")</syntaxhighlight>
 
=={{header|EasyLang}}==
 
<syntaxhighlight lang="text">
stdout.println("Hello world!")</lang>
print "Hello world!"
</syntaxhighlight>
 
=={{header|eC}}==
<langsyntaxhighlight lang="ec">class GoodByeApp : Application
{
void Main()
Line 910 ⟶ 1,585:
PrintLn("Hello world!");
}
}</langsyntaxhighlight>
 
=={{header|EchoLisp}}==
<langsyntaxhighlight lang="lisp">
(display "Hello world!" "color:blue")
</syntaxhighlight>
</lang>
 
=={{header|ECL}}==
<syntaxhighlight lang="ecl">
<lang ECL>
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}}==
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]].
<langsyntaxhighlight lang="edsac">[ Print HELLO WORLD ]
[ A program for the EDSAC ]
[ Works with Initial Orders 2 ]
Line 956 ⟶ 1,641:
DF
EZPF [ Start program beginning at
the load point ]</langsyntaxhighlight>
{{out}}
<pre>HELLO WORLD</pre>
Line 963 ⟶ 1,648:
short version (without a function)
 
<langsyntaxhighlight lang="efene">io.format("Hello world!~n")</langsyntaxhighlight>
 
complete version (put this in a file and compile it)
 
<langsyntaxhighlight lang="efene">@public
run = fn () {
io.format("Hello world!~n")
}</langsyntaxhighlight>
 
=={{header|Egel}}==
<syntaxhighlight lang="egel">
def main = "Hello World!"
</syntaxhighlight>
 
=={{header|Egison}}==
 
<langsyntaxhighlight lang="egison">
(define $main
(lambda [$argv]
(write-string "Hello world!\n")))
</syntaxhighlight>
</lang>
 
=={{header|EGL}}==
{{works with|EDT}}
{{works with|RBD}}
<syntaxhighlight lang="egl">
<lang EGL>
program HelloWorld
function main()
Line 989 ⟶ 1,679:
end
end
</syntaxhighlight>
</lang>
 
=={{header|Eiffel}}==
{{wikipedia|Eiffel (programming language)}}
<langsyntaxhighlight lang="eiffel">class
HELLO_WORLD
create
Line 1,002 ⟶ 1,692:
print ("Hello world!%N")
end
end</langsyntaxhighlight>
 
=={{header|Ela}}==
<langsyntaxhighlight lang="ela">open monad io
do putStrLn "Hello world!" ::: IO</langsyntaxhighlight>
 
=={{header|Elan}}==
<syntaxhighlight lang="elan">putline ("Hello, world!");</syntaxhighlight>
 
=={{header|elastiC}}==
From the [http://www.elasticworld.org/man/elastic.html elastiC Manual].
 
<langsyntaxhighlight lang="elastic">package hello;
 
// Import the `basic' package
Line 1,028 ⟶ 1,721:
 
// Invoke the `hello' function
hello();</langsyntaxhighlight>
 
=={{header|Elena}}==
ELENA 36.2x:
<syntaxhighlight lang="elena">public program()
<lang elena>program =
{
[
console .writeLine:("Hello world!".)
}</syntaxhighlight>
].</lang>
=== Alternative variant using Tape ===
<lang elena>program = system'dynamic'Tape("Hello world!",system'console,%"writeLine[1]").</lang>
 
=={{header|Elisa}}==
<langsyntaxhighlight lang="elisa"> "Hello world!"? </langsyntaxhighlight>
 
=={{header|Elixir}}==
<langsyntaxhighlight lang="elixir">
IO.puts "Hello world!"
</syntaxhighlight>
</lang>
 
=={{header|Elm}}==
<langsyntaxhighlight lang="haskell">main = text "Goodbye World!"</langsyntaxhighlight>
 
=={{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}}==
<syntaxhighlight lang="emojicode">🏁 🍇
😀 🔤Hello world!🔤
🍉</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}}==
<langsyntaxhighlight lang="erlang">io:format("Hello world!~n").</langsyntaxhighlight>
 
=={{header|ERRE}}==
<syntaxhighlight lang="erre">
<lang ERRE>
! Hello World in ERRE language
PROGRAM HELLO
Line 1,063 ⟶ 1,797:
PRINT("Hello world!")
END PROGRAM
</syntaxhighlight>
</lang>
 
=={{header|Euler Math Toolbox}}==
Line 1,073 ⟶ 1,807:
=={{header|Extended BrainF***}}==
 
<syntaxhighlight lang ="bf">[.>]@Hello world!</langsyntaxhighlight>
 
=={{header|Ezhil}}==
Line 1,083 ⟶ 1,817:
 
=={{header|F_Sharp|F#}}==
<langsyntaxhighlight lang="fsharp">printfn "%s" "Hello world!"</langsyntaxhighlight>
or using .Net classes directly
<langsyntaxhighlight lang="fsharp">System.Console.WriteLine("Hello world!")</langsyntaxhighlight>
 
=={{header|Factor}}==
<langsyntaxhighlight lang="factor">"Hello world!" print</langsyntaxhighlight>
 
=={{header|Falcon}}==
With the printl() function:
<langsyntaxhighlight lang="falcon">printl("Hello world!")</langsyntaxhighlight>
Or via "fast print":
<langsyntaxhighlight lang="falcon">> "Hello world!"</langsyntaxhighlight>
 
=={{header|FALSE}}==
<langsyntaxhighlight lang="false">"Hello world!
"</langsyntaxhighlight>
 
=={{header|Fantom}}==
 
<langsyntaxhighlight lang="fantom">
class HelloText
{
Line 1,110 ⟶ 1,844:
}
}
</syntaxhighlight>
</lang>
 
=={{header|Fe}}==
<syntaxhighlight lang="clojure">(print "Hello World")</syntaxhighlight>
 
=={{header|Fennel}}==
<syntaxhighlight lang="fennel">(print "Hello World")</syntaxhighlight>
 
=={{header|ferite}}==
word.}}
<langsyntaxhighlight lang="ferite">uses "console";
Console.println( "Goodby, World!" );</langsyntaxhighlight>
 
=={{header|Fermat}}==
<syntaxhighlight lang="fermat">!!'Hello, World!';</syntaxhighlight>
 
=={{header|Fexl}}==
<langsyntaxhighlight Fexllang="fexl">say "Hello world!"</langsyntaxhighlight>
 
=={{header|Fhidwfe}}==
<syntaxhighlight lang="fhidwfe">puts$ "Hello, world!\n"</syntaxhighlight>
 
=={{header|Fish}}==
Standard Hello, world example, modified for this task:
<langsyntaxhighlight Fishlang="fish">!v"Hello world!"r!
>l?!;o</langsyntaxhighlight>
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/>
Line 1,132 ⟶ 1,878:
 
=={{header|FOCAL}}==
<langsyntaxhighlight lang="focal">TYPE "Hello, world" !</langsyntaxhighlight>
 
=={{header|Forth}}==
<langsyntaxhighlight lang="forth">." Hello world!"</langsyntaxhighlight>
 
Or as a whole program:
 
<langsyntaxhighlight lang="forth">: goodbye ( -- ) ." Hello world!" CR ;</langsyntaxhighlight>
 
=={{header|Fortran}}==
Line 1,145 ⟶ 1,891:
Simplest case - display using default formatting:
 
<langsyntaxhighlight lang="fortran">print *,"Hello world!"</langsyntaxhighlight>
 
Use explicit output format:
 
<langsyntaxhighlight lang="fortran">100 format (5X,A,"!")
print 100,"Hello world!"</langsyntaxhighlight>
 
Output to channels other than stdout goes like this:
 
<langsyntaxhighlight lang="fortran">write (89,100) "Hello world!"</langsyntaxhighlight>
 
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>".
{{7*7}}
 
=={{header|Fortress}}==
<langsyntaxhighlight lang="fortress">export Executable
run() = println("Hello world!")</langsyntaxhighlight>
 
=={{header|FreeBASIC}}==
<langsyntaxhighlight FreeBASIClang="freebasic">? "Hello, Worldworld!"
sleep</syntaxhighlight>
 
</lang>
 
=={{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}}==
Line 1,172 ⟶ 1,942:
{{Works with|Frege|3.20.113}}
 
<langsyntaxhighlight lang="frege">module HelloWorld where
main _ = println "Hello world!"</langsyntaxhighlight>
 
=={{header|friendly interactive shell}}==
Unlike other [[UNIX shell]] languages, fish doesn't support history substitution, so <code>!</code> is safe to use without quoting.
<syntaxhighlight lang ="fishshell">echo Hello world!</langsyntaxhighlight>
 
=={{header|Frink}}==
<langsyntaxhighlight lang="frink">
println["Hello world!"]
</syntaxhighlight>
</lang>
 
=={{header|FTCBASIC}}==
<syntaxhighlight lang="basic">print "Hello, world!"
pause
end</syntaxhighlight>
 
=={{header|FunL}}==
<langsyntaxhighlight lang="funl">println( 'Hello world!' )</langsyntaxhighlight>
 
 
=={{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}}==
<syntaxhighlight lang="qbasic">PRINT "Hello world!"</syntaxhighlight>
-- [http://rosettacode.org/wiki/User:Sarossell Scott A. Rossell, 02-27-16]
<lang qbasic>PRINT "Hello world!"</lang>
 
=={{header|Gambas}}==
'''[https://gambas-playground.proko.eu/?gist=d3a51f670e4eb0f793b513b14329be51 Click this link to run this code]'''
<langsyntaxhighlight lang="gambas">Public Sub Main()
 
PRINT "Hello world!"
End</langsyntaxhighlight>
 
=={{header|GAP}}==
<langsyntaxhighlight lang="gap"># Several ways to do it
"Hello world!";
 
Line 1,209 ⟶ 1,998:
f := OutputTextUser();
WriteLine(f, "Hello world!\n");
CloseStream(f);</langsyntaxhighlight>
 
=={{header|GB BASIC}}==
<syntaxhighlight lang="gb basic">10 print "Hello world!"</syntaxhighlight>
 
=={{header|gecho}}==
<langsyntaxhighlight lang="gecho">'Hello, <> 'World! print</langsyntaxhighlight>
 
=={{header|Gema}}==
Line 1,218 ⟶ 2,010:
This code will write "Hello world!' no matter what input is given.
 
<langsyntaxhighlight lang="gema">*= ! ignore off content of input
\B=Hello world!\! ! Start output with this text.</langsyntaxhighlight>
 
=={{header|Genie}}==
<syntaxhighlight lang="genie">
init
print "Hello world!"
</syntaxhighlight>
 
=={{header|Gentee}}==
<langsyntaxhighlight lang="gentee">func hello <main>
{
print("Hello world!")
}</langsyntaxhighlight>
 
=={{header|GFA Basic}}==
<langsyntaxhighlight lang="gfabasic">PRINT "Hello World"</langsyntaxhighlight>
 
=={{header|GLBasic}}==
<langsyntaxhighlight GLBasiclang="glbasic">STDOUT "Hello world!"</langsyntaxhighlight>
 
=={{header|Gleam}}==
<syntaxhighlight lang="gleam">
import gleam/io
 
pub fn main() {
io.println("Hello world!")
}
</syntaxhighlight>
 
=={{header|Glee}}==
<langsyntaxhighlight lang="glee">"Hello world!"</langsyntaxhighlight>
 
or
 
<syntaxhighlight lang ="glee">'Hello world!'</langsyntaxhighlight>
 
or to display with double quotes
 
<langsyntaxhighlight lang="glee"> '"Goodbye,World!"'</langsyntaxhighlight>
 
or to display with single quotes
 
<langsyntaxhighlight lang="glee"> "'Goodbye,World!'"</langsyntaxhighlight>
 
=={{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.
<syntaxhighlight lang="global script">λ _. print qq{Hello world!\n}</syntaxhighlight>
 
=={{header|GlovePIE}}==
<syntaxhighlight lang="glovepie">debug="Hello world!"</syntaxhighlight>
 
=={{header|GML}}==
<langsyntaxhighlight Clang="c">show_message("Hello world!"); // displays a pop-up message
show_debug_message("Hello world!"); // sends text to the debug log or IDE</langsyntaxhighlight>
 
=={{header|Go}}==
 
<langsyntaxhighlight lang="go">package main
 
import "fmt"
 
func main() { fmt.Println("Hello world!") }</langsyntaxhighlight>
 
=={{header|Golfscript}}==
<langsyntaxhighlight lang="golfscript">"Hello world!"</langsyntaxhighlight>
 
=={{header|Gosu}}==
<langsyntaxhighlight lang="gosu">print("Hello world!")</langsyntaxhighlight>
 
=={{header|Grain}}==
<syntaxhighlight lang="grain">print("Hello world!")</syntaxhighlight>
 
=={{header|Groovy}}==
<langsyntaxhighlight lang="groovy">println "Hello world!"</langsyntaxhighlight>
 
=={{header|GW-BASIC}}==
<langsyntaxhighlight lang="qbasic">10 PRINT "Hello world!"</langsyntaxhighlight>
 
=={{header|Hack}}==
<langsyntaxhighlight lang="hack"><?hh echo 'Hello world!'; ?></langsyntaxhighlight>
 
=={{header|Halon}}==
If the code in run in the REPL the output will be to stdout otherwise syslog LOG_DEBUG will be used.
 
<langsyntaxhighlight lang="halon">echo "Hello world!";</langsyntaxhighlight>
 
=={{header|Harbour}}==
<langsyntaxhighlight lang="visualfoxpro">? "Hello world!"</langsyntaxhighlight>
 
=={{header|Hare}}==
<syntaxhighlight lang="hare">use fmt;
 
export fn main() void = {
fmt::println("Hello, world!")!;
};</syntaxhighlight>
 
=={{header|Haskell}}==
<langsyntaxhighlight lang="haskell">
main = putStrLn "Hello world!"
</syntaxhighlight>
</lang>
 
=={{header|Haxe}}==
<langsyntaxhighlight ActionScriptlang="actionscript">trace("Hello world!");</langsyntaxhighlight>
 
=={{header|hexiscript}}==
<syntaxhighlight lang="hexiscript">println "Hello world!"</syntaxhighlight>
 
=={{header|HicEst}}==
<syntaxhighlight lang ="hicest">WRITE() 'Hello world!'</langsyntaxhighlight>
 
=={{header|HLA}}==
<langsyntaxhighlight HLAlang="hla">program goodbyeWorld;
#include("stdlib.hhf")
begin goodbyeWorld;
Line 1,301 ⟶ 2,129:
stdout.put( "Hello world!" nl );
 
end goodbyeWorld;</langsyntaxhighlight>
 
=={{header|HolyC}}==
<langsyntaxhighlight lang="holyc">"Hello world!\n";</langsyntaxhighlight>
 
=={{header|Hoon}}==
<langsyntaxhighlight Hoonlang="hoon">~& "Hello world!" ~</langsyntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight HPPPLlang="hpppl">PRINT("Hello world!");</langsyntaxhighlight>
 
=={{header|HQ9+}}==
{{incorrect|HQ9+|output isn't consistent with the task's requirements (and is probably incapable of solving the task).}}
<syntaxhighlight lang ="hq9plus">H</langsyntaxhighlight>
*Technically, HQ9+ can't print "Hello world!" text because of its specification.
- H : Print 'Hello World!'<br>
Line 1,322 ⟶ 2,173:
 
=={{header|Huginn}}==
<langsyntaxhighlight lang="huginn">#! /bin/sh
exec huginn --no-argv -E "${0}" "${@}"
#! huginn
Line 1,329 ⟶ 2,180:
print( "Hello World!\n" );
return ( 0 );
}</langsyntaxhighlight>
=={{header|HTML5}}==
<syntaxhighlight lang="html5">
<!DOCTYPE html>
<html>
<body>
<h1>Hello world!</h1>
</body>
</html>
</syntaxhighlight>
 
=={{header|Hy}}==
<langsyntaxhighlight lang="clojure">(print "Hello world!")</langsyntaxhighlight>
 
=={{header|Ii}}==
<langsyntaxhighlight lang="i">software {
print("Hello Worldworld!")
}</langsyntaxhighlight>
 
=={{header|Icon}} and {{header|Unicon}}==
<langsyntaxhighlight lang="icon">procedure main()
write( "Hello world!" )
end</langsyntaxhighlight>
 
=={{header|IDL}}==
<syntaxhighlight lang ="idl">print,'Hello world!'</langsyntaxhighlight>
 
=={{header|Idris}}==
<syntaxhighlight lang="idris">module Main
 
main : IO ()
main = putStrLn "Hello world!"</syntaxhighlight>
 
=={{header|Inform 6}}==
<langsyntaxhighlight Informlang="inform 6">[Main;
print "Hello world!^";
];</langsyntaxhighlight>
 
=={{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}}==
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.
 
<langsyntaxhighlight Integerlang="integer BASICbasic"> 10 PRINT "Hello world!"
20 END</langsyntaxhighlight>
 
=={{header|Io}}==
<langsyntaxhighlight Iolang="io">"Hello world!" println</langsyntaxhighlight>
 
=={{header|Ioke}}==
<langsyntaxhighlight lang="ioke">"Hello world!" println</langsyntaxhighlight>
 
=={{header|IS-BASIC}}==
<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}}==
<syntaxhighlight lang="iwbasic">
<lang IWBASIC>
OPENCONSOLE
 
Line 1,379 ⟶ 2,282:
 
END
</syntaxhighlight>
</lang>
 
=={{header|J}}==
<langsyntaxhighlight lang="j"> 'Hello world!'
Hello world!</langsyntaxhighlight>
 
Here are some redundant alternatives:
<langsyntaxhighlight Jlang="j"> [data=. 'Hello world!'
Hello world!
data
Line 1,397 ⟶ 2,300:
Hello World!
Hello World !
 
</lang>
 
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!
</syntaxhighlight>
 
=={{header|Jack}}==
<langsyntaxhighlight lang="jack">class Main {
function void main () {
do Output.printString("Hello world!");
Line 1,406 ⟶ 2,333:
return;
}
}</langsyntaxhighlight>
 
=={{header|Jacquard Loom}}==
This weaves the string "Hello world!"
<langsyntaxhighlight lang="jacquard">+---------------+
| |
| * * |
Line 1,496 ⟶ 2,423:
| |
| |
+---------------+</langsyntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight lang="java">public class HelloWorld
{
public static void main(String[] args)
Line 1,505 ⟶ 2,451:
System.out.println("Hello world!");
}
}</langsyntaxhighlight>
 
=={{header|JavaScript}}==
<langsyntaxhighlight lang="javascript">document.write("Hello world!");</langsyntaxhighlight>
 
{{works with|NJS|0.2.5}}
{{works with|Rhino}}
{{works with|SpiderMonkey}}
<syntaxhighlight lang ="javascript">print('Hello world!');</langsyntaxhighlight>
 
{{works with|JScript}}
<langsyntaxhighlight lang="javascript">WScript.Echo("Hello world!");</langsyntaxhighlight>
 
{{works with|Node.js}}
<langsyntaxhighlight lang="javascript">console.log("Hello world!")</langsyntaxhighlight>
 
=={{header|JCL}}==
<syntaxhighlight lang JCL="jcl">/*MESSAGE Hello world!</langsyntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight lang="joy">"Hello world!\n" putchars.</langsyntaxhighlight>
 
=={{header|jq}}==
<langsyntaxhighlight lang="jq">"Hello world!"</langsyntaxhighlight>
 
=={{header|JSE}}==
<syntaxhighlight lang="jse">Print "Hello world!"</syntaxhighlight>
 
=={{header|Jsish}}==
<syntaxhighlight lang="javascript">puts("Hello world!")</syntaxhighlight>
 
=={{header|Julia}}==
<langsyntaxhighlight Julialang="julia">println("Hello world!")</langsyntaxhighlight>
 
=={{header|K}}==
<syntaxhighlight lang="k">
"Hello world!"
</syntaxhighlight>
Some of the other ways this task can be attached are:
<syntaxhighlight lang="k">
`0: "Hello world!\n"
</syntaxhighlight>
<syntaxhighlight lang="k">
s: "Hello world!"
s
</syntaxhighlight>
<syntaxhighlight lang="k">
\echo "Hello world!"
</syntaxhighlight>
 
=={{header|Kabap}}==
<syntaxhighlight lang="kabap">return = "Hello world!";</syntaxhighlight>
 
=={{header|Kaya}}==
<langsyntaxhighlight lang="kaya">program hello;
Void main() {
// My first program!
putStrLn("Hello world!");
}</langsyntaxhighlight>
 
=={{header|Kdf9 Usercode}}==
{{incorrect|Kdf9|output isn't consistent with the task's requirements: wording, punctuation.}}
<langsyntaxhighlight lang="joy">
 
V2; W0;
Line 1,554 ⟶ 2,536:
999; OUT;
FINISH;
</syntaxhighlight>
</lang>
 
=={{header|Keg}}==
<syntaxhighlight lang="keg">Hello world\!</syntaxhighlight>
 
=={{header|Kite}}==
simply a single line
<langsyntaxhighlight Kitelang="kite">"#!/usr/local/bin/kite
 
"Hello world!"|print;</langsyntaxhighlight>
 
=={{header|Kitten}}==
 
<langsyntaxhighlight Kittenlang="kitten">"Hello world!" say</langsyntaxhighlight>
 
=={{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}}==
Displays it in a text file or console/terminal.
<langsyntaxhighlight KonsolScriptlang="konsolscript">function main() {
Konsol:Log("Hello world!")
}</langsyntaxhighlight>
 
=={{header|Kotlin}}==
<syntaxhighlight lang Kotlin="kotlin">fun main(args: Array<String>) {
println("Hello world!")
}</langsyntaxhighlight>
 
=={{header|Lang5KQL}}==
<lang Lang5>"Hello world!\n" .</lang>
 
<syntaxhighlight lang="kql">print 'Hello world!'</syntaxhighlight>
=={{header|LaTeX}}==
<lang LaTeX>
\documentclass{scrartcl}
 
=={{header|KSI}}==
\begin{document}
Hello World!
\end{document}
</lang>
 
<syntaxhighlight lang="ksi">
`plain
'Hello world!' #echo #
</syntaxhighlight>
 
=={{header|Lambdatalk}}==
<syntaxhighlight lang="scheme">
Hello world!
{h1 Hello world!}
_h1 Hello world!\n
</syntaxhighlight>
 
=={{header|Lang}}==
<syntaxhighlight lang="lang">fn.println(Hello world!)</syntaxhighlight>
 
=={{header|Lang5}}==
<syntaxhighlight lang="lang5">"Hello world!\n" .</syntaxhighlight>
 
=={{header|langur}}==
<syntaxhighlight lang="langur">writeln "Hello"</syntaxhighlight>
 
=={{header|Lasso}}==
A plain string is output automatically.
<syntaxhighlight lang Lasso="lasso">'Hello world!'</langsyntaxhighlight>
 
=={{header|LFELaTeX}}==
<syntaxhighlight lang="latex">\documentclass{minimal}
<lang lisp>
\begin{document}
(: io format '"Hello world!~n")
Hello World!
</lang>
\end{document}</syntaxhighlight>
 
=={{header|Latitude}}==
<syntaxhighlight lang="latitude">putln "Hello world!".</syntaxhighlight>
 
=={{header|LC3 Assembly}}==
 
<langsyntaxhighlight lang="lc3asm">.orig x3000
LEA R0, hello ; R0 = &hello
TRAP x22 ; PUTS (print char array at addr in R0)
HALT
hello .stringz "Hello World!"
.end</langsyntaxhighlight>
Or (without PUTS)
<langsyntaxhighlight lang="lc3asm">.orig x3000
LEA R1, hello ; R1 = &hello
TOP LDR R0, R1, #0 ; R0 = R1[0]
Line 1,617 ⟶ 2,646:
END HALT
hello .stringz "Hello World!"
.end</langsyntaxhighlight>
 
=={{header|LDPL}}==
<syntaxhighlight lang="ldpl">
procedure:
display "Hello World!" crlf
</syntaxhighlight>
 
=={{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}}==
<syntaxhighlight lang="lisp">
(: io format '"Hello world!~n")
</syntaxhighlight>
 
=={{header|Liberty BASIC}}==
<langsyntaxhighlight lang="lb">print "Hello world!"</langsyntaxhighlight>
 
=={{header|LIL}}==
<syntaxhighlight lang="tcl">#
# Hello world in lil
#
 
print "Hello, world!"</syntaxhighlight>
 
=={{header|Lily}}==
There are two ways to do this. First, with the builtin print:
 
<langsyntaxhighlight lang="lily">print("Hello world!")</langsyntaxhighlight>
 
Second, by using stdout directly:
 
<langsyntaxhighlight lang="lily">stdout.print("Hello world!\n")</langsyntaxhighlight>
 
=={{header|LilyPondLilypond}}==
<langsyntaxhighlight lang="lilypond">\version "2.18.2"
global = {
\time 4/4
Line 1,642 ⟶ 2,702:
\addlyrics {
Hel -- lo, World!
}</langsyntaxhighlight>
 
 
=={{header|Limbo}}==
<langsyntaxhighlight lang="limbo">implement Command;
include "sys.m";
Line 1,659 ⟶ 2,718:
sys = load Sys Sys->PATH;
sys->print("Hello world!\n");
}</langsyntaxhighlight>
 
=={{header|Lingo}}==
<langsyntaxhighlight lang="lingo">put "Hello world!"</langsyntaxhighlight>
 
or:
 
<langsyntaxhighlight lang="lingo">trace("Hello world!")</langsyntaxhighlight>
 
=={{header|Lisaac}}==
Line 1,672 ⟶ 2,731:
You can print to standard output in Lisaac by calling STRING.print or INTEGER.print:
 
<langsyntaxhighlight lang="lisaac">Section Header // The Header section is required.
+ name := GOODBYE; // Define the name of this object.
 
Section Public
- main <- ("Hello world!\n".print;);</langsyntaxhighlight>
 
However, it may be more straightforward to use IO.print_string instead:
 
<langsyntaxhighlight lang="lisaac">Section Header // The Header section is required.
+ name := GOODBYE2; // Define the name of this object.
 
Section Public
- main <- (IO.put_string "Hello world!\n";);</langsyntaxhighlight>
 
=={{header|Lisp}}==
<lang lisp>
# Project : Hello world/Text
# Date : 2018/03/05
# Author : Gal Zsolt [~ CalmoSoft ~]
# Email : <calmosoft@gmail.com>
 
(format t "~a" "Hello world!")
</lang>
Output:
<pre>
Hello world!
</pre>
 
=={{header|Little}}==
Output to terminal:
<langsyntaxhighlight lang="c">puts("Hello world!");</langsyntaxhighlight>
 
Without the newline terminator:
 
<langsyntaxhighlight lang="c">puts(nonewline: "Hello world!");</langsyntaxhighlight>
 
Output to arbitrary open, writable file, for example the standard error channel:
<langsyntaxhighlight lang="c">puts(stderr, "Hello world!");</langsyntaxhighlight>
 
=={{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"
put "Hello world!" & return</langsyntaxhighlight>
 
Livecode also supports stdout as a device to write to <lang LiveCode>write "Hello world!" & return to stdout</lang>
<syntaxhighlight lang="livecode">write "Hello world!" & return to stdout</syntaxhighlight>
 
=={{header|LLVM}}==
 
<syntaxhighlight lang="llvm">
<lang llvm>@str = internal constant [14 x i8] c"Hello, world!\00"
; const char str[14] = "Hello World!\00"
declare i32 @puts(i8*)
@.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
}</langsyntaxhighlight>
 
=={{header|Lobster}}==
<langsyntaxhighlight lang="lobster">print "Hello world!"</langsyntaxhighlight>
 
=={{header|Logo}}==
Print includes a line feed:
<syntaxhighlight lang ="logo">print [Hello world!]</langsyntaxhighlight>
Type does not:
<syntaxhighlight lang ="logo">type [Hello world!]</langsyntaxhighlight>
 
=={{header|Logtalk}}==
<langsyntaxhighlight lang="logtalk">:- object(hello_world).
 
% the initialization/1 directive argument is automatically executed
Line 1,745 ⟶ 2,804:
:- initialization(write('Hello world!\n')).
 
:- end_object.</langsyntaxhighlight>
 
=={{header|LOLCODE}}==
<syntaxhighlight lang="lolcode">
<lang LOLCODE>
HAI
CAN HAS STDIO?
VISIBLE "Hello world!"
KTHXBYE
</syntaxhighlight>
</lang>
 
=={{header|LotusScript}}==
<langsyntaxhighlight lang="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.</langsyntaxhighlight>
 
=={{header|LSE}}==
<syntaxhighlight lang="lse">AFFICHER [U, /] 'Hello world!'</syntaxhighlight>
 
=={{header|LSE64}}==
<langsyntaxhighlight lang="lse64">"Hello world!" ,t nl</langsyntaxhighlight>
 
=={{header|Lua}}==
Function calls with either a string literal or a table constructor passed as their only argument do not require parentheses.
<langsyntaxhighlight lang="lua">print "Hello world!"</langsyntaxhighlight>
 
Harder way with a table:
<langsyntaxhighlight lang="lua">
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:
</lang>
print(table.concat(chars))
</syntaxhighlight>
 
=={{header|Luna}}==
<syntaxhighlight lang="luna">def main:
hello = "Hello, World!"
print hello</syntaxhighlight>
 
=={{header|M2000 Interpreter}}==
<syntaxhighlight lang="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
</syntaxhighlight>
 
=={{header|M4}}==
For the particular nature of m4, this is simply:
<syntaxhighlight lang ="m4">`Hello world!'</langsyntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight lang="lisp">(format t "Hello world!~%")</langsyntaxhighlight>
Or
<langsyntaxhighlight lang="lisp">(print "Hello world!")</langsyntaxhighlight>
 
=={{header|MAD}}==
 
<syntaxhighlight lang="mad"> VECTOR VALUES HELLO = $11HHELLO WORLD*$
PRINT FORMAT HELLO
END OF PROGRAM</syntaxhighlight>
 
=={{header|make}}==
Makefile contents:
<langsyntaxhighlight lang="make">
all:
$(info Hello world!)
</syntaxhighlight>
</lang>
Running make produces:
 
Line 1,798 ⟶ 2,936:
 
=={{header|Malbolge}}==
 
'''Long version:'''
<langsyntaxhighlight lang="malbolge">('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"
`CB]V?Tx<uVtT`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${z@></langsyntaxhighlight>
 
'''Short version:'''
<langsyntaxhighlight lang="malbolge">(=<`#9]~6ZY32Vx/4Rs+0No-&Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8dc</langsyntaxhighlight>
 
{{Out}}
<pre>HELLO WORLD!
</pre>
 
=={{header|MANOOL}}==
In &ldquo;applicative&rdquo; notation:
<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):
<syntaxhighlight lang="manool">{{extern "manool.org.18/std/0.3/all"} in Out.WriteLine["Hello world!"]}</syntaxhighlight>
LISPish notation (ditto):
<syntaxhighlight lang="manool">{{extern "manool.org.18/std/0.3/all"} in {WriteLine Out "Hello world!"}}</syntaxhighlight>
Using a colon punctuator (ditto):
<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:
<syntaxhighlight lang="manool">{{extern; "manool.org.18/std/0.3/all"} in: WriteLine; Out; "Hello world!"}</syntaxhighlight>
 
=={{header|Maple}}==
<syntaxhighlight lang="maple">
<lang Maple>
> printf( "Hello world!\n" ): # print without quotes
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}}==
<langsyntaxhighlight lang="mathematica">Print["Hello world!"]</langsyntaxhighlight>
 
=={{header|MATLAB}}==
<langsyntaxhighlight MATLABlang="matlab">>> disp('Hello world!')</langsyntaxhighlight>
 
 
=={{header|Maude}}==
<syntaxhighlight lang="maude">
<lang Maude>
fmod BYE-WORLD is
 
Line 1,835 ⟶ 2,993:
 
red sayBye .
</syntaxhighlight>
</lang>
 
=={{header|Maxima}}==
<langsyntaxhighlight lang="maxima">print("Hello world!");</langsyntaxhighlight>
 
=={{header|MAXScript}}==
<langsyntaxhighlight lang="maxscript">print "Hello world!"</langsyntaxhighlight>
or:
<langsyntaxhighlight lang="maxscript">format "%" "Hello world!"</langsyntaxhighlight>
 
=={{header|MDL}}==
<syntaxhighlight lang="mdl"><PRINC "Hello world!">
<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}}==
<langsyntaxhighlight lang="mecury">:- module hello.
:- interface.
:- import_module io.
Line 1,853 ⟶ 3,025:
:- implementation.
main(!IO) :-
io.write_string("Hello world!\n", !IO).</langsyntaxhighlight>
 
=={{header|Metafont}}==
<langsyntaxhighlight lang="metafont">message "Hello world!"; end</langsyntaxhighlight>
 
=={{header|Microsoft Small Basic}}==
<syntaxhighlight lang="smallbasic">TextWindow.WriteLine("Hello world!")</syntaxhighlight>
 
=={{header|min}}==
<syntaxhighlight lang="min">"Hello world!" puts</syntaxhighlight>
 
=={{header|Minimal BASIC}}==
<syntaxhighlight lang="qbasic">10 PRINT "Hello world!"
20 END</syntaxhighlight>
 
=={{header|MiniScript}}==
<syntaxhighlight lang="miniscript">print "Hello world!"</syntaxhighlight>
 
=={{header|MiniZinc}}==
<syntaxhighlight lang="minizinc">
output ["Hello World"];
</syntaxhighlight>
{{out}}
<pre>Hello World
----------</pre>
 
=={{header|MIPS Assembly}}==
{{works with|MARS}} and {{works with|SPIM}}
<langsyntaxhighlight 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.
 
Line 1,870 ⟶ 3,063:
 
li $v0, 10 # set the syscall to exit
syscall # make the system call</langsyntaxhighlight>
 
=={{header|Miranda}}==
<syntaxhighlight lang="miranda">main :: [sys_message]
main = [Stdout "Hello, world!\n"]</syntaxhighlight>
 
=={{header|mIRC Scripting Language}}==
<syntaxhighlight lang ="mirc">echo -ag Hello world!</langsyntaxhighlight>
 
=={{header|ML/I}}==
<syntaxhighlight lang ML="ml/Ii">Hello world!</langsyntaxhighlight>
 
=={{header|Modula-2}}==
<langsyntaxhighlight lang="modula2">MODULE Hello;
IMPORT InOut;
 
Line 1,885 ⟶ 3,082:
InOut.WriteString('Hello world!');
InOut.WriteLn
END Hello.</langsyntaxhighlight>
==={{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}}==
<langsyntaxhighlight lang="modula3">MODULE Goodbye EXPORTS Main;
 
IMPORT IO;
Line 1,894 ⟶ 3,108:
BEGIN
IO.Put("Hello world!\n");
END Goodbye.</langsyntaxhighlight>
 
=={{header|MontiLang}}==
<syntaxhighlight lang="montilang">|Hello, World!| PRINT .</syntaxhighlight>
 
=={{header|Morfa}}==
<langsyntaxhighlight lang="morfa">
import morfa.io.print;
func main(): void
Line 1,903 ⟶ 3,120:
println("Hello world!");
}
</syntaxhighlight>
</lang>
 
=={{header|Mosaic}}==
<syntaxhighlight lang="mosaic">proc main =
println "Hello, world"
end</syntaxhighlight>
 
Or just:
<syntaxhighlight lang="mosaic">
println "Hello, world"</syntaxhighlight>
 
=={{header|MSX Basic}}==
<syntaxhighlight lang="qbasic">10 PRINT "Hello world!"</syntaxhighlight>
 
=={{header|MUF}}==
<langsyntaxhighlight lang="muf">: main[ -- ]
me @ "Hello world!" notify
exit
;</langsyntaxhighlight>
 
=={{header|MUMPS}}==
<langsyntaxhighlight MUMPSlang="mumps">Write "Hello world!",!</langsyntaxhighlight>
 
=={{header|MyDef}}==
Run with: <pre>mydef_run hello.def</pre>
Perl:
<syntaxhighlight lang MyDef="mydef">$print Hello world</langsyntaxhighlight>
 
C:
<syntaxhighlight lang="mydef">
<lang MyDef>
module: c
$print Hello world
</syntaxhighlight>
</lang>
 
python:
<syntaxhighlight lang="mydef">
<lang MyDef>
module: python
$print Hello world
</syntaxhighlight>
</lang>
 
JavaScript
<syntaxhighlight lang="mydef">
<lang MyDef>
module: js
$print "Hello world"
</syntaxhighlight>
</lang>
 
go:
<syntaxhighlight lang="mydef">
<lang MyDef>
module: go
$print Hello world
</syntaxhighlight>
</lang>
 
=={{header|MyrtleScript}}==
<langsyntaxhighlight MyrtleScriptlang="myrtlescript">script HelloWorld {
func main returns: int {
print("Hello World!")
}
}
</syntaxhighlight>
</lang>
 
=={{header|MySQL}}==
 
<syntaxhighlight lang MySQL="mysql">SELECT 'Hello world!';</langsyntaxhighlight>
 
=={{header|Mythryl}}==
 
<langsyntaxhighlight Mythryllang="mythryl">print "Hello world!";</langsyntaxhighlight>
 
=={{header|N/t/roff}}==
Line 1,965 ⟶ 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.
 
<syntaxhighlight lang N="n/t/roff">Hello world!</langsyntaxhighlight>
 
=={{header|Nanoquery}}==
<syntaxhighlight lang="nanoquery">println "Hello world!"</syntaxhighlight>
 
=={{header|Neat}}==
 
<langsyntaxhighlight Neatlang="neat">void main() writeln "Hello world!";</langsyntaxhighlight>
 
=={{header|Neko}}==
<langsyntaxhighlight lang="neko">$print("Hello world!");</langsyntaxhighlight>
 
=={{header|Nemerle}}==
<syntaxhighlight lang="nemerle">
<lang Nemerle>
class Hello
{
Line 1,983 ⟶ 3,215:
}
}
</syntaxhighlight>
</lang>
Easier method:
<syntaxhighlight lang="nemerle">
<lang Nemerle>
System.Console.WriteLine("Hello world!");
</syntaxhighlight>
</lang>
 
=={{header|NetRexx}}==
<syntaxhighlight lang NetRexx="netrexx">say 'Hello world!'</langsyntaxhighlight>
 
=={{header|Never}}==
<syntaxhighlight lang="fsharp">func main() -> int {
prints("Hello world!\n");
0
}</syntaxhighlight>
 
{{out}}
<pre>prompt$ never -f hello.nev
Hello world!</pre>
 
=={{header|newLISP}}==
{{works with|newLisp|6.1 and after}}
<langsyntaxhighlight lang="lisp">(println "Hello world!")</langsyntaxhighlight>
 
=={{header|Nickle}}==
<syntaxhighlight lang="c">printf("Hello world!\n")</syntaxhighlight>
 
=={{header|Nim}}==
<langsyntaxhighlight pythonlang="nim">echo("Hello world!")</langsyntaxhighlight>
using <code>stdout</code>
<syntaxhighlight lang="nim">stdout.writeLine("Hello World!")</syntaxhighlight>
 
=={{header|Nit}}==
<langsyntaxhighlight lang="nit">print "Hello world!"</langsyntaxhighlight>
=={{header|Nix}}==
<syntaxhighlight lang="nix">"Hello world!"</syntaxhighlight>
 
=={{header|NLP++}}==
<syntaxhighlight lang="nlp++">
@CODE
"output.txt" << "Hello world!";
@@CODE
</syntaxhighlight>
 
=={{header|NS-HUBASIC}}==
<p>As lowercase characters are not offered in NS-HUBASIC, perhaps some flexibility in the task specification could be offered.</p>
Using <code>?</code>:
<syntaxhighlight lang="ns-hubasic">10 ? "HELLO WORLD!"</syntaxhighlight>
 
Using <code>PRINT</code>:
<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}}==
'''Interpreter:''' [[Nyquist]] (3.15)
[[Category:Nyquist Version 3.15]]
===LISP syntax===
<syntaxhighlight lang="lisp">(format t "Hello world!")</syntaxhighlight>
 
Or
 
<syntaxhighlight lang="lisp">(print "Hello world!")</syntaxhighlight>
 
===SAL syntax===
<syntaxhighlight lang="sal">print "Hello World!"</syntaxhighlight>
 
Or
 
<syntaxhighlight lang="sal">exec format(t, "Hello World!")</syntaxhighlight>
 
=={{header|Oberon-2}}==
<langsyntaxhighlight lang="oberon2">
MODULE Goodbye;
IMPORT Out;
Line 2,013 ⟶ 3,309:
World;
END Goodbye.
</syntaxhighlight>
</lang>
 
=={{header|Objeck}}==
<langsyntaxhighlight lang="objeck">
class Hello {
function : Main(args : String[]) ~ Nil {
"Hello world!"->PrintLine();
}
}</langsyntaxhighlight>
 
=={{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}}==
Line 2,028 ⟶ 3,337:
The de facto Objective-C "Hello, World!" program is most commonly illustrated as the following, using the NSLog() function:
 
<langsyntaxhighlight lang="objc">
#import <Foundation/Foundation.h>
 
Line 2,036 ⟶ 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.
Line 2,042 ⟶ 3,351:
The following code prints the message to standard output without a timestamp using exclusively Objective-C messages:
 
<langsyntaxhighlight lang="objc">
#import <Foundation/Foundation.h>
 
Line 2,052 ⟶ 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.
 
<langsyntaxhighlight lang="objc">
#import <Foundation/Foundation.h>
 
Line 2,065 ⟶ 3,374:
}
}
</syntaxhighlight>
</lang>
 
=={{header|OCaml}}==
<langsyntaxhighlight lang="ocaml">print_endline "Hello world!"</langsyntaxhighlight>
 
=={{header|Occam}}==
{{works with|kroc}}
<langsyntaxhighlight lang="occam">#USE "course.lib"
PROC main (CHAN BYTE screen!)
out.string("Hello world!*c*n", 0, screen)
:</langsyntaxhighlight>
 
=={{header|Octave}}==
<langsyntaxhighlight lang="octave">disp("Hello world!");</langsyntaxhighlight>
 
Or, using C-style function printf:
 
<langsyntaxhighlight lang="octave">printf("Hello world!");</langsyntaxhighlight>
 
=={{header|Odin}}==
<syntaxhighlight lang="odin">package main
import "core:fmt"
 
main :: proc() {
fmt.println("Hellope!");
}</syntaxhighlight>
 
=={{header|Oforth}}==
<langsyntaxhighlight Oforthlang="oforth">"Hello world!" println.</langsyntaxhighlight>
 
=={{header|Ol}}==
<syntaxhighlight lang="scheme">(print "Hello world!")</syntaxhighlight>
 
=={{header|Onyx}}==
<langsyntaxhighlight lang="onyx">`Hello world!\n' print flush</langsyntaxhighlight>
 
=={{header|Onyx (wasm)}}==
<syntaxhighlight lang="TS">
use core {printf}
main :: () {
printf("Hello world!");
}
</syntaxhighlight>
{{out}}
<pre>
Hello world!
</pre>
 
=={{header|OOC}}==
To print a String, either call its println() method:
<langsyntaxhighlight lang="ooc">main: func {
"Hello world!" println()
}</langsyntaxhighlight>
Or call the free println() function with the String as the argument.
<langsyntaxhighlight lang="ooc">main: func {
println("Hello world!")
}</langsyntaxhighlight>
 
=={{header|ooRexx}}==
Refer also to the [[#REXX|Rexx]] and [[#NetRexx|NetRexx]] solutions. Simple output is common to most Rexx dialects.
<langsyntaxhighlight ooRexxlang="oorexx">/* Rexx */
say 'Hello world!'
</syntaxhighlight>
</lang>
 
=={{header|OpenLisp}}==
We can use the same code as the Common Lisp example, but as a shell script.
<langsyntaxhighlight lang="openlisp">
#!/openlisp/uxlisp -shell
(format t "Hello world!~%")
(print "Hello world!")
</syntaxhighlight>
</lang>
 
Output:
Line 2,119 ⟶ 3,451:
 
=={{header|Openscad}}==
<langsyntaxhighlight lang="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
</syntaxhighlight>
</lang>
 
=={{header|Owl Lisp}}==
<syntaxhighlight lang="scheme">
(print "Hello world!")
</syntaxhighlight>
 
{{out}}
<pre>$ ol hello-Owl.scm
Hello world!</pre>
 
 
=={{header|Oxygene}}==
From [[wp:Oxygene (programming language)]]
<syntaxhighlight lang="pascal">
<lang oxygene>
namespace HelloWorld;
Line 2,142 ⟶ 3,484:
class method HelloClass.Main;
begin
System.Console.WriteLinewriteLn('Hello world!');
end;
end.
</syntaxhighlight>
</lang>
{{out}}
<pre>
>HelloWorld.exe
Hello world!
</pre>
 
=={{header|Oz}}==
<langsyntaxhighlight lang="oz">{Show "Hello world!"}</langsyntaxhighlight>
 
=={{header|PARI/GP}}==
 
<langsyntaxhighlight lang="parigp">print("Hello world!")</langsyntaxhighlight>
 
=={{header|Pascal}}==
{{works with|Free Pascal}}
<langsyntaxhighlight lang="pascal">program byeworld;
begin
writeln('Hello world!');
end.</langsyntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight lang="pasm">print "Hello world!\n"
end</langsyntaxhighlight>
 
=={{header|PDP-1 Assembly}}==
This can be assembled with macro1.c distributed with SIMH and then run on the SIMH PDP-1 simulator.
<langsyntaxhighlight lang="assembly">
hello
/ above: title line - was punched in human readable letters on paper tape
Line 2,192 ⟶ 3,545:
end, . / sentinel for end of message
start 100 / tells assembler where program starts
</syntaxhighlight>
</lang>
 
=={{header|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|7}}
 
{{works with|UNIX|1}} to {{works with|UNIX|7}}
This is tested on Unix v7
Prints "Hello world!" to stdout:
 
<langsyntaxhighlight lang="assembly">.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
sys 1
rts pc / in case exit returns
rts pc
 
.data
outtext: <Hello world!\n>
outlen = . - outtext</langsyntaxhighlight>
 
=={{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}}==
{{works with|Perl|5.8.8}}
<langsyntaxhighlight lang="perl">print "Hello world!\n";</langsyntaxhighlight>
 
{{works with|Perl|5.10.x}}
Backported from Perl 6Raku:
<langsyntaxhighlight lang="perl">use feature 'say';
say 'Hello world!';</langsyntaxhighlight>
 
or:
<langsyntaxhighlight lang="perl">use 5.010;
say 'Hello world!';</langsyntaxhighlight>
 
=={{header|Perl 6Peylang}}==
<syntaxhighlight lang perl6="peylang">saychaap 'Hello world!';</langsyntaxhighlight>
{{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}}==
{{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}}==
<langsyntaxhighlight lang="phl">module helloworld;
extern printf;
 
Line 2,238 ⟶ 3,639:
printf("Hello world!");
return 0;
]</langsyntaxhighlight>
 
=={{header|PHP}}==
<langsyntaxhighlight lang="php"><?php
echo "Hello world!\n";
?></langsyntaxhighlight>
Alternatively, any text outside of the <code><?php ?></code> tags will be automatically echoed:
<syntaxhighlight lang ="php">Hello world!</langsyntaxhighlight>
 
=={{header|Picat}}==
<syntaxhighlight lang="picat">println("Hello, world!")</syntaxhighlight>
 
=={{header|PicoLisp}}==
<langsyntaxhighlight PicoLisplang="picolisp">(prinl "Hello world!")</langsyntaxhighlight>
 
=={{header|Pict}}==
Using the syntax sugared version:
<langsyntaxhighlight lang="pict">(prNL "Hello World!");</langsyntaxhighlight>
Using the channel syntax:
<langsyntaxhighlight lang="pict">new done: ^[]
run ( prNL!["Hello World!" (rchan done)]
| done?_ = () )</langsyntaxhighlight>
 
=={{header|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 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</syntaxhighlight>
 
=={{header|Pike}}==
<langsyntaxhighlight lang="pike">int main(){
write("Hello world!\n");
}</langsyntaxhighlight>
 
=={{header|PILOT}}==
<syntaxhighlight lang ="pilot">T:Hello world!</langsyntaxhighlight>
 
=={{header|PIR}}==
<langsyntaxhighlight lang="pir">.sub hello_world_text :main
print "Hello world!\n"
.end</langsyntaxhighlight>
 
=={{header|Pixilang}}==
<syntaxhighlight lang="pixilang">fputs("Hello world!\n")</syntaxhighlight>
 
=={{header|PL/I}}==
<langsyntaxhighlight lang="pli">goodbye:proc options(main);
put list('Hello world!');
end goodbye;</langsyntaxhighlight>
 
=={{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 ICP/OM BDOS SYSTEM routinesCALL */
WRITE$STRINGBDOS: PROCEDURE( SFN, )ARG EXTERNAL); DECLARE SFN POINTERBYTE, ARG ADDRESS; ENDGOTO WRITE$STRING5; END;
/* endPRINT A $ externalTERMINATED routinesSTRING */
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}}==
{{works with|Oracle}}
<langsyntaxhighlight lang="plsql">
set serveroutput on
 
Line 2,297 ⟶ 3,732:
END;
/
</syntaxhighlight>
</lang>
 
<pre>
Line 2,310 ⟶ 3,745:
PL/SQL procedure successfully completed.
</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}}==
<langsyntaxhighlight lang="pony">actor Main
new create(env: Env) =>
env.out.print("Hello world!")</langsyntaxhighlight>
 
=={{header|Pop11}}==
<langsyntaxhighlight lang="pop11">printf('Hello world!\n');</langsyntaxhighlight>
 
=={{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}}==
Line 2,323 ⟶ 3,801:
To generate a document that shows the text "Hello world!":
 
<langsyntaxhighlight lang="postscript">%!PS
/Helvetica 20 selectfont
70 700 moveto
(Hello world!) show
showpage</langsyntaxhighlight>
 
If the viewer has a console, then there are the following ways to display the topmost element of the stack:
 
<langsyntaxhighlight lang="postscript">(Hello world!) ==</langsyntaxhighlight>
 
will display the <i>string</i> "(Hello world!)";
 
<langsyntaxhighlight lang="postscript">(Hello world!) =</langsyntaxhighlight>
 
will display the <i>content</i> of the string "(Hello world!)"; that is, "Hello world!";
 
<syntaxhighlight lang ="postscript">(Hello world!) print</langsyntaxhighlight>
 
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:
 
<langsyntaxhighlight lang="postscript">%!PS
/Helvetica 20 selectfont
70 700 moveto
Line 2,350 ⟶ 3,828:
show % prints to document
1 0 div % provokes error message
showpage</langsyntaxhighlight>
 
=={{header|Potion}}==
<langsyntaxhighlight lang="potion">"Hello world!\n" print</langsyntaxhighlight>
 
=={{header|PowerShellPowerBASIC}}==
<syntaxhighlight lang="powerbasic">#COMPILE EXE
<lang powershell>'Hello world!'
#COMPILER PBCC 6
 
FUNCTION PBMAIN () AS LONG
#It's considered good practice to use Write-Host, although it works just fine without too
Write-Host ' CON.PRINT "Hello world!'"
CON.WAITKEY$
END FUNCTION</syntaxhighlight>
 
=={{header|PowerShell}}==
# For extra flair, you can specify colored output
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.
Write-Host 'Hello world!' -foregroundcolor red</lang>
 
See http://www.jsnover.com/blog/2013/12/07/write-host-considered-harmful/ (Jeffrey Snover is one of the creators of PowerShell).
<syntaxhighlight lang="powershell">'Hello world!'</syntaxhighlight>
 
=={{header|Processing}}==
<langsyntaxhighlight lang="processing">println("Hello world!");</langsyntaxhighlight>
 
=={{header|ProDOS}}==
<syntaxhighlight lang ProDOS="prodos">printline Hello world!</langsyntaxhighlight>
 
=={{header|Programming Language}}==
For typing:
<syntaxhighlight lang="programming language">print(Hello world!)</syntaxhighlight>
For importing:
 
[print(Hello world!)]
 
=={{header|Prolog}}==
<langsyntaxhighlight lang="prolog">:- write('Hello world!'), nl.</langsyntaxhighlight>
 
=={{header|PROMAL}}==
<syntaxhighlight lang="promal">
program hello
include library
begin
output "Hello world!"
end
</syntaxhighlight>
 
=={{header|PSQL}}==
Line 2,383 ⟶ 3,883:
 
=={{header|Pure}}==
<langsyntaxhighlight lang="pure">
using system;
 
puts "Hello world!\n" ;
</syntaxhighlight>
</lang>
 
=={{header|PureBasic}}==
<langsyntaxhighlight PureBasiclang="purebasic">OpenConsole()
PrintN("Hello world!")
Input() ; Wait for enter</langsyntaxhighlight>
using <code>Debug</code>
<syntaxhighlight lang="purebasic">Debug("Hello world!")</syntaxhighlight>
 
=={{header|Python}}==
{{works with|Python|2.4}}
<langsyntaxhighlight lang="python">print "Hello world!"</langsyntaxhighlight>
 
The same using sys.stdout
<langsyntaxhighlight lang="python">import sys
sys.stdout.write("Hello world!\n")</langsyntaxhighlight>
 
In Python 3.0, print is changed from a statement to a function.
 
{{works with|Python|3.0}} (And version 2.X too).
<langsyntaxhighlight lang="python">print("Hello world!")</langsyntaxhighlight>
 
'''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>
 
<syntaxhighlight lang ="python">import __phello__</langsyntaxhighlight>
 
<syntaxhighlight lang ="python">import __phello__.spam</langsyntaxhighlight>
 
=={{header|QB64}}==
Source file [http://svn.python.org/view/python/trunk/Python/frozen.c?view=markup] containing the easter egg
<syntaxhighlight lang="qbasic">PRINT "Hello world!"</syntaxhighlight>
 
=={{header|Quackery}}==
<syntaxhighlight lang="quackery">say "Hello world!"</syntaxhighlight>
 
=={{header|Quill}}==
<langsyntaxhighlight lang="quill">"Hello world!" print</langsyntaxhighlight>
 
=={{header|Quite BASIC}}==
<syntaxhighlight lang="quite basic">10 print "Hello world!"</syntaxhighlight>
 
=={{header|R}}==
<langsyntaxhighlight Rlang="r"> cat("Hello world!\n")</langsyntaxhighlight>
or
<syntaxhighlight lang="r"> message("Hello world!")</syntaxhighlight>
or
<syntaxhighlight lang="r"> print("Hello world!")</syntaxhighlight>
 
=={{header|Ra}}==
<syntaxhighlight lang="ra">
<lang Ra>
class HelloWorld
**Prints "Hello world!"**
Line 2,430 ⟶ 3,944:
 
print "Hello world!"
</syntaxhighlight>
</lang>
 
=={{header|Racket}}==
<syntaxhighlight lang="racket">
<lang Racket>
(printf "Hello world!\n")
</syntaxhighlight>
</lang>
 
=={{header|Raku}}==
(formerly Perl 6)
<syntaxhighlight lang="raku" line>say 'Hello world!';</syntaxhighlight>
In an object-oriented approach, the string is treated as an object calling its '''say()''' method:
<syntaxhighlight lang="raku" line>"Hello, World!".say();</syntaxhighlight>
 
=={{header|Raven}}==
<syntaxhighlight lang ="raven">'Hello world!' print</langsyntaxhighlight>
 
=={{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}}==
Line 2,444 ⟶ 3,980:
This requires a console application.
 
<langsyntaxhighlight lang="realbasic">Function Run(args() as String) As Integer
Print "Hello world!"
Quit
End Function</langsyntaxhighlight>
 
=={{header|REBOL}}==
<langsyntaxhighlight REBOLlang="rebol">print "Hello world!"</langsyntaxhighlight>
 
=={{header|RED}}==
<langsyntaxhighlight REDlang="red">print "Hello world!"</langsyntaxhighlight>
 
=={{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}}==
 
<syntaxhighlight lang="retro">
<lang Retro>
'Hello_world! s:put
"Hello world!" puts
</syntaxhighlight>
</lang>
 
=={{header|REXX}}==
===using SAY===
<langsyntaxhighlight lang="rexx">/*REXX program to show a line of text. */
say 'Hello world!'</langsyntaxhighlight>
 
===using SAY variable===
<langsyntaxhighlight lang="rexx">/*REXX program to show a line of text. */
yyy = 'Hello world!'
say yyy</langsyntaxhighlight>
 
===using LINEOUT===
<langsyntaxhighlight lang="rexx">/*REXX program to show a line of text. */
 
call lineout ,"Hello world!"</langsyntaxhighlight>
 
=={{header|Rhovas}}==
 
<syntaxhighlight lang="360 assembly">
print("Hello world!");
</syntaxhighlight>
 
=={{header|Ring}}==
<syntaxhighlight lang="ring">See "Hello world!"</syntaxhighlight>
 
=={{header|RISC-V Assembly}}==
<syntaxhighlight lang="risc-v">.data
hello:
.string "Hello World!\n\0"
.text
main:
la a0, hello
li a7, 4
ecall
li a7, 10
ecall
</syntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight RTLlang="rtl/2">TITLE Goodbye World;
 
LET NL=10;
Line 2,488 ⟶ 4,089:
RETURN(1);
 
ENDPROC;</langsyntaxhighlight>
 
=={{header|Ring}}==
<lang ring>See "Hello world!"</lang>
 
=={{header|Ruby}}==
{{works with|Ruby|1.8.4}}
<langsyntaxhighlight lang="ruby">puts "Hello world!"</langsyntaxhighlight>
or
<langsyntaxhighlight lang="ruby">$stdout.puts "Hello world!"</langsyntaxhighlight>
or even
<langsyntaxhighlight lang="ruby"> STDOUT.write "Hello world!\n"</langsyntaxhighlight>
 
 
'''Using the > global'''
<langsyntaxhighlight lang="ruby">$>.puts "Hello world!"</langsyntaxhighlight>
<langsyntaxhighlight lang="ruby">$>.write "Hello world!\n"</langsyntaxhighlight>
 
=={{header|Run BASIC}}==
<langsyntaxhighlight Runbasiclang="runbasic">print "Hello world!"</langsyntaxhighlight>
 
=={{header|Rust}}==
<langsyntaxhighlight lang="rust">
fn main () {
print!("Hello world!");
}
</syntaxhighlight>
 
or
 
<syntaxhighlight lang="rust">
fn main() {
println!("Hello world!");
}
</syntaxhighlight>
</lang>
 
=={{header|Salmon}}==
<langsyntaxhighlight Salmonlang="salmon">"Hello world!"!</langsyntaxhighlight>
 
or
 
<langsyntaxhighlight Salmonlang="salmon">print("Hello world!\n");</langsyntaxhighlight>
 
or
 
<langsyntaxhighlight Salmonlang="salmon">standard_output.print("Hello world!\n");</langsyntaxhighlight>
 
=={{header|SAS}}==
<langsyntaxhighlight lang="sas">/* Using a data step. Will print the string in the log window */
data _null_;
put "Hello world!";
run;</langsyntaxhighlight>
 
=={{header|SASL}}==
Note that a string starts with a single and ends with a double quote
<syntaxhighlight lang="sasl">
'Hello World!",nl
</syntaxhighlight>
 
=={{header|Sather}}==
<langsyntaxhighlight lang="sather">class GOODBYE_WORLD is
main is
#OUT+"Hello world!\n";
end;
end;</langsyntaxhighlight>
 
=={{header|Scala}}==
Line 2,544 ⟶ 4,156:
===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:
<langsyntaxhighlight Scalalang="scala">println("Hello world!")</langsyntaxhighlight>
===Via Java runtime===
This is a call to the Java run-time library. '''Not recommendatedrecommended'''.
<langsyntaxhighlight Scalalang="scala">System.out.println("Hello world!")</langsyntaxhighlight>
 
===Via Scala Console API===
This is a call to the Scala run-time library. '''RecommendatedRecommended'''.
<langsyntaxhighlight Scalalang="scala">println("Hello world!")</langsyntaxhighlight>
 
===Short term deviation to out===
<langsyntaxhighlight Scalalang="scala">Console.withErr(Console.out) { Console.err.println("This goes to default _out_") }</langsyntaxhighlight>
===Long term deviation to out===
<langsyntaxhighlight Scalalang="scala"> Console.err.println ("Err not deviated")
Console.setErr(Console.out)
Console.err.println ("Err deviated")
Console.setErr(Console.err) // Reset to normal</langsyntaxhighlight>
 
=={{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))
(display "Hello world!")
(newline)</langsyntaxhighlight>
 
=={{header|Scilab}}==
<langsyntaxhighlight Scilablang="scilab">disp("Hello world!");</langsyntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight lang="sed">i\
Hello world!
q</langsyntaxhighlight>
 
=={{header|Seed7}}==
<langsyntaxhighlight lang="seed7">$ include "seed7_05.s7i";
 
const proc: main is func
begin
writeln("Hello world!");
end func;</langsyntaxhighlight>
 
=={{header|Self}}==
<syntaxhighlight lang ="self">'Hello world!' printLine.</langsyntaxhighlight>
 
=={{header|SenseTalk}}==
<syntaxhighlight lang="sensetalk">put "Hello world!"</syntaxhighlight>
 
=={{header|Set lang}}==
<langsyntaxhighlight lang="set_lang">set ! H
set ! E
set ! L
Line 2,609 ⟶ 4,236:
set ! L
set ! D
set ! 33</langsyntaxhighlight>
 
=={{header|SETL}}==
<langsyntaxhighlight SETLlang="setl">print("Hello world!");</langsyntaxhighlight>
 
=={{header|SETL4}}==
<langsyntaxhighlight SETL4lang="setl4">out("Hello world!");end</langsyntaxhighlight>
 
=={{header|Shen}}==
<langsyntaxhighlight Shenlang="shen">(output "Hello world!~%")</langsyntaxhighlight>
 
=={{header|Shiny}}==
<syntaxhighlight lang ="shiny">say 'Hello world!'</langsyntaxhighlight>
 
=={{header|Sidef}}==
<syntaxhighlight lang ="sidef">„Hello world!”.say;</langsyntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight lang="simpol">function main()
end function "Hello world!{d}{a}"</langsyntaxhighlight>
 
=={{header|Simula}}==
{{works with|SIMULA-67}}
<langsyntaxhighlight lang="simula">BEGIN
OUTTEXT("Hello world!");
OUTIMAGE
END</langsyntaxhighlight>
 
=={{header|Sing}}==
<syntaxhighlight lang="sing">requires "sio";
 
public fn singmain(argv [*]string) i32
{
sio.print("hello world !\r\n");
return(0);
}</syntaxhighlight>
 
=={{header|Sisal}}==
<langsyntaxhighlight lang="sisal">define main
 
% Sisal doesn't yet have a string built-in.
Line 2,647 ⟶ 4,288:
function main(returns string)
"Hello world!"
end function</langsyntaxhighlight>
 
=={{header|Skew}}==
{{works with|skewc|0.9.19}}
 
<syntaxhighlight lang="skew">
@entry
def main {
dynamic.console.log("Hello world!")
}
</syntaxhighlight>
 
=={{header|SkookumScript}}==
<langsyntaxhighlight lang="javascript">print("Hello world!")</langsyntaxhighlight>
Alternatively if just typing in the SkookumIDE [http://skookumscript.com/docs/v3.0/ide/console/workspace/ REPL]:
<langsyntaxhighlight lang="javascript">"Hello world!"</langsyntaxhighlight>
 
=={{header|Slate}}==
<syntaxhighlight lang ="slate">inform: 'Hello world!'.</langsyntaxhighlight>
 
=={{header|Slope}}==
<syntaxhighlight lang="slope">(write "Hello, world!")</syntaxhighlight>
 
=={{header|SmallBASIC}}==
<syntaxhighlight lang="smallbasic">PRINT "Hello world!"</syntaxhighlight>
 
=={{header|Smalltalk}}==
<langsyntaxhighlight lang="smalltalk">Transcript show: 'Hello world!'; cr.</langsyntaxhighlight>
 
{{works with|GNU Smalltalk}} (as does the above code)
<syntaxhighlight lang ="smalltalk">'Hello world!' printNl.</langsyntaxhighlight>
 
=={{header|smart BASIC}}==
<syntaxhighlight lang="qbasic">PRINT "Hello world!"</syntaxhighlight>
-- [http://rosettacode.org/wiki/User:Sarossell Scott A. Rossell, 12-26-16]
 
<lang qbasic>PRINT "Hello world!"</lang>
[https://s23.postimg.org/4q8mgtwrv/goofy_face1.jpg Goofy Pic]
 
=={{header|SmileBASIC}}==
<langsyntaxhighlight lang="smilebasic">PRINT "Hello world!"</langsyntaxhighlight>
 
=={{header|SNOBOL4}}==
Using CSnobol4 dialect
<langsyntaxhighlight lang="snobol4"> OUTPUT = "Hello world!"
END</langsyntaxhighlight>
 
=={{header|SNUSP}}==
===Core SNUSP===
<langsyntaxhighlight lang="snusp">/++++!/===========?\>++.>+.+++++++..+++\
\+++\ | /+>+++++++>/ /++++++++++<<.++>./
$+++/ | \+++++++++>\ \+++++.>.+++.-----\
\==-<<<<+>+++/ /=.>.+>.--------.-/</langsyntaxhighlight>
 
===Modular SNUSP===
<langsyntaxhighlight lang="snusp">@\G.@\o.o.@\d.--b.@\y.@\e.>@\comma.@\.<-@\W.+@\o.+++r.------l.@\d.>+.! #
| | \@------|# | \@@+@@++|+++#- \\ -
| \@@@@=+++++# | \===--------!\===!\-----|-------#-------/
\@@+@@@+++++# \!#+++++++++++++++++++++++#!/</langsyntaxhighlight>
 
=={{header|Soda}}==
<syntaxhighlight lang="soda">
class Main
 
main (arguments : Array [String] ) : Unit =
println ("Hello world!")
 
end
</syntaxhighlight>
 
=={{header|SoneKing Assembly}}==
<langsyntaxhighlight lang="soneking assembly">
extern print
 
Line 2,700 ⟶ 4,364:
call print
pop
</syntaxhighlight>
</lang>
 
=={{header|SPARC Assembly}}==
<langsyntaxhighlight lang="sparc">
.section ".text"
.global _start
Line 2,720 ⟶ 4,384:
.ascii "Hello world!\n"
.msgend:
</syntaxhighlight>
</lang>
 
=={{header|Sparkling}}==
<langsyntaxhighlight lang="sparkling">print("Hello world!");</langsyntaxhighlight>
 
=={{header|SPL}}==
<langsyntaxhighlight lang="spl">#.output("Hello world!")</langsyntaxhighlight>
 
=={{header|SQL}}==
{{works with|Oracle}}
{{works with|Db2 LUW}}
<lang sql>
<syntaxhighlight lang="sql">
select 'Hello world!' text from dual;
</syntaxhighlight>
</lang>
 
<pre>
SQL>select 'Hello world!' text from dual;
SQL> SQL> SQL>
TEXT
------------
Hello world!
</pre>
 
=={{header|SQL PL}}==
{{works with|Db2 LUW}}
With SQL only:
<syntaxhighlight lang="sql pl">
SELECT 'Hello world!' AS text FROM sysibm.sysdummy1;
</syntaxhighlight>
Output:
<pre>
db2 -t
db2 => SELECT 'Hello world!' AS text FROM sysibm.sysdummy1;
 
TEXT
------------
Hello world!
 
1 record(s) selected.
</pre>
 
{{works with|Db2 LUW}} version 9.7 or higher.
With SQL PL:
<syntaxhighlight lang="sql pl">
SET SERVEROUTPUT ON;
 
CALL DBMS_OUTPUT.PUT_LINE('Hello world!');
</syntaxhighlight>
Output:
<pre>
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!
</pre>
 
=={{header|Standard ML}}==
<langsyntaxhighlight lang="sml">print "Hello world!\n"</langsyntaxhighlight>
 
=={{header|Stata}}==
<langsyntaxhighlight lang="stata">display "Hello world!"</langsyntaxhighlight>
 
=={{header|Suneido}}==
<langsyntaxhighlight Suneidolang="suneido">Print("Hello world!")</langsyntaxhighlight>
 
=={{header|Swahili}}==
<syntaxhighlight lang="swahili">andika("Hello world!")</syntaxhighlight>
 
=={{header|Swift}}==
{{works with|Swift|2.x+}}
<langsyntaxhighlight lang="swift">print("Hello world!")</langsyntaxhighlight>
{{works with|Swift|1.x}}
<langsyntaxhighlight lang="swift">println("Hello world!")</langsyntaxhighlight>
 
=={{header|Symsyn}}==
<langsyntaxhighlight lang="symsyn">
'hello world' []
</syntaxhighlight>
</lang>
=={{header|TailDot}}==
<syntaxhighlight lang=taildot>c,x,Hello World!,v,x</syntaxhighlight>
=={{header|Tailspin}}==
<syntaxhighlight lang="tailspin">'Hello World' -> !OUT::write</syntaxhighlight>
 
=={{header|Tcl}}==
Output to terminal:
<langsyntaxhighlight lang="tcl">puts "stdout {Hello world!"}</langsyntaxhighlight>
 
Output to arbitrary open, writable file:
<syntaxhighlight lang ="tcl">puts $fileID "{Hello world!"}</langsyntaxhighlight>
 
=={{header|Teco}}==
Outputting to terminal. Please note that ^A means control-A, not a caret followed by 'A', and that $ represent the ESC key.
<syntaxhighlight lang ="teco">^AHello world!^A$$</langsyntaxhighlight>
 
=={{header|Tern}}==
<syntaxhighlight lang="tern">println("Hello world!");</syntaxhighlight>
 
=={{header|Terra}}==
<langsyntaxhighlight lang="terra">C = terralib.includec("stdio.h")
 
terra hello(argc : int, argv : &rawstring)
C.printf("Hello world!\n")
return 0
end</langsyntaxhighlight>
 
=={{header|Terraform}}==
<syntaxhighlight lang="hcl">output "result" {
value = "Hello world!"
}</syntaxhighlight>
{{Out}}
<pre>$ terraform init
$ terraform apply
 
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
 
Outputs:
 
result = Hello world!
$ terraform output result
Hello world!</pre>
 
=={{header|TestML}}==
<langsyntaxhighlight TestMLlang="testml">%TestML 0.1.0
Print("Hello world!")</langsyntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight lang="ti83b">Disp "Hello world!</langsyntaxhighlight>
(Lowercase letters DO exist in TI-BASIC, though you need an assembly program to enable them.)
 
=={{header|TI-89 BASIC}}==
<langsyntaxhighlight lang="ti89b">Disp "Hello world!"</langsyntaxhighlight>
 
=={{header|Tiny BASIC}}==
{{works with|TinyBasic}}
<syntaxhighlight lang="basic">
10 PRINT "Hello, World!"
20 END
</syntaxhighlight>
 
=={{header|TMG}}==
Unix TMG:
<syntaxhighlight lang="tqs">begin: parse(( = { <Hello, World!> * } ));</syntaxhighlight>
 
=={{header|TorqueScript}}==
<langsyntaxhighlight lang="tqs">echo("Hello world!");</langsyntaxhighlight>
 
=={{header|TPP}}==
<syntaxhighlight lang ="tpp">Hello world!</langsyntaxhighlight>
 
=={{header|Transact-SQL}}==
 
<langsyntaxhighlight lang="sql">PRINT "Hello world!"</langsyntaxhighlight>
 
=={{header|Transd}}==
 
<syntaxhighlight lang="scheme">(textout "Hello, World!")</syntaxhighlight>
 
=={{header|TransFORTH}}==
<langsyntaxhighlight lang="forth">PRINT " Hello world! "</langsyntaxhighlight>
 
=={{header|Trith}}==
<langsyntaxhighlight lang="trith">"Hello world!" print</langsyntaxhighlight>
 
=={{header|True BASIC}}==
<langsyntaxhighlight lang="truebasic">
! In True BASIC all programs run in their own window. So this is almost a graphical version.
PRINT "Hello world!"
END
</syntaxhighlight>
</lang>
 
=={{header|TUSCRIPT}}==
<langsyntaxhighlight lang="tuscript">
$$ MODE TUSCRIPT
PRINT "Hello world!"
</syntaxhighlight>
</lang>
Output:
<pre>
Line 2,824 ⟶ 4,571:
</pre>
 
=={{header|uBasic/4tH}}==
<syntaxhighlight lang="text">Print "Hello world!"</syntaxhighlight>
=={{header|Uniface}}==
<syntaxhighlight lang="uniface">
<lang Uniface>
message "Hello world!"
</syntaxhighlight>
</lang>
 
=={{header|Unison}}==
<syntaxhighlight lang="unison">
main = '(printLine "Hello world!")
</syntaxhighlight>
 
=={{header|UNIX Shell}}==
{{works with|Bourne Shell}}
<langsyntaxhighlight lang="bash">#!/bin/sh
echo "Hello world!"</langsyntaxhighlight>
 
==={{header|C Shell}}===
<langsyntaxhighlight lang="csh">#!/bin/csh -f
echo "Hello world!\!"</langsyntaxhighlight>
 
We use \! to prevent history substitution. Plain ! at end of string seems to be safe, but we use \! to be sure.
 
=={{header|Unlambda}}==
<langsyntaxhighlight lang="unlambda">`r```````````````.G.o.o.d.b.y.e.,. .W.o.r.l.d.!i</langsyntaxhighlight>
 
=={{header|Ursa}}==
<langsyntaxhighlight lang="ursa">out "hello world!" endl console</langsyntaxhighlight>
 
=={{header|Ursala}}==
output as a side effect of compilation
<langsyntaxhighlight Ursalalang="ursala">#show+
 
main = -[Hello world!]-</langsyntaxhighlight>
output by a compiled executable
<langsyntaxhighlight Ursalalang="ursala">#import std
 
#executable ('parameterized','')
 
main = <file[contents: -[Hello world!]-]>!</langsyntaxhighlight>
 
=={{header|Ursalang}}==
<syntaxhighlight lang="ursa">print("hello woods!")</syntaxhighlight>
 
=={{header|உயிர்/Uyir}}==
<langsyntaxhighlight lang="உயிர்/Uyiruyir">முதன்மை என்பதின் வகை எண் பணி {{
("உலகத்தோருக்கு வணக்கம்") என்பதை திரை.இடு;
 
முதன்மை = 0;
}};</langsyntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight lang="v">"Hello world!" puts</langsyntaxhighlight>
 
=={{header|Vala}}==
<langsyntaxhighlight lang="vala">void main(){
stdout.printf("Hello world!\n");
}</langsyntaxhighlight>
 
=={{header|Vale}}==
{{works with|Vale|0.2.0}}
<syntaxhighlight lang="vale">
import stdlib.*;
 
exported func main() {
println("Hello world!");
}
</syntaxhighlight>
 
=={{header|VAX Assembly}}==
 
<syntaxhighlight lang="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
</syntaxhighlight>
 
=={{header|VBA}}==
<syntaxhighlight lang="vb">
Public Sub hello_world_text
Debug.Print "Hello World!"
End Sub
</syntaxhighlight>
 
 
=={{header|VBScript}}==
{{works with|Windows Script Host|5.7}}
<langsyntaxhighlight VBScriptlang="vbscript">WScript.Echo( "Hello world!")</langsyntaxhighlight>
 
=={{header|Vedit macro language}}==
<langsyntaxhighlight lang="vedit">Message("Hello world!")</langsyntaxhighlight>
 
=={{header|Verbexx}}==
<langsyntaxhighlight Verbexxlang="verbexx">@SAY "Hello world!";</langsyntaxhighlight>
 
 
=={{header|Verilog}}==
<syntaxhighlight lang="verilog">
module main;
initial begin
$display("Hello world!");
$finish ;
end
endmodule
</syntaxhighlight>
 
=={{header|VHDL}}==
<langsyntaxhighlight VHDLlang="vhdl">LIBRARY std;
USE std.TEXTIO.all;
 
Line 2,899 ⟶ 4,722:
wait; -- needed to stop the execution
end process;
end architecture beh;</langsyntaxhighlight>
 
=={{header|Vim Script}}==
<langsyntaxhighlight lang="vim">echo "Hello world!\n"</langsyntaxhighlight>
 
=={{header|Visual Basic}}==
{{Libheader|Microsoft.Scripting}}
{{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.
<syntaxhighlight lang="vb">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</syntaxhighlight>
 
=={{header|Visual Basic .NET}}==
<syntaxhighlight lang="vb">Imports System
 
Module HelloWorld
Sub Main()
Console.WriteLine("Hello world!")
End Sub
End Module</syntaxhighlight>
 
=={{header|Viua VM assembly}}==
<syntaxhighlight lang="text">.function: main/0
text %1 local "Hello World!"
print %1 local
izero %0 local
return
.end</langsyntaxhighlight>
 
=={{header|V (Vlang)}}==
<syntaxhighlight lang="go">fn main() {
println('Hello World!')
}</syntaxhighlight>
 
=={{header|VTL-2}}==
<syntaxhighlight lang="vtl-2">10 ?="Hello world!"</syntaxhighlight>
=={{header|Waduzitdo}}==
<syntaxhighlight lang="waduzitdo">T:Hello world!
S:</syntaxhighlight>
 
=={{header|Wart}}==
 
<langsyntaxhighlight lang="wart">prn "Hello world!"</langsyntaxhighlight>
 
=={{header|WDTE}}==
<langsyntaxhighlight WDTElang="wdte">io.writeln io.stdout 'Hello world!';</langsyntaxhighlight>
 
=={{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}}==
<syntaxhighlight lang="wee basic">print 1 "Hello world!"
end</syntaxhighlight>
 
=={{header|Whenever}}==
 
<langsyntaxhighlight lang="whenever">1 print("Hello world!");</langsyntaxhighlight>
 
=={{header|Whiley}}==
 
<langsyntaxhighlight lang="whiley">import whiley.lang.System
 
method main(System.Console console):
console.out.println("Hello world!")</langsyntaxhighlight>
 
=={{header|Whitespace}}==
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}}==
<langsyntaxhighlight lang="wolfram">Print["Hello world!"]</langsyntaxhighlight>
 
=={{header|Wren}}==
<langsyntaxhighlight lang="wren">System.print("Hello world!")</langsyntaxhighlight>
 
=={{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}}==
Line 2,946 ⟶ 4,876:
 
Prints "Hello world!" to stdout (and there is probably an even simpler version):
<langsyntaxhighlight lang="asm">section .data
msg db 'Hello world!', 0AH
len equ $-msg
Line 2,960 ⟶ 4,890:
mov ebx, 0
mov eax, 1
int 80h</langsyntaxhighlight>
 
'''AT&T syntax:''' works with gcc (version 4.9.2) and gas (version 2.5):
 
<langsyntaxhighlight lang="asm">.section .text
 
.globl main
Line 2,977 ⟶ 4,907:
 
.section .data
str: .ascii "Hello world!\12"</langsyntaxhighlight>
 
=={{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`
#define SYS_WRITE $1
Line 3,002 ⟶ 4,953:
.data
message: .ascii "Hello, world!\n"</langsyntaxhighlight>
 
=={{header|XBasic}}==
{{works with|Windows XBasic}}
<syntaxhighlight lang="xbasic">
PROGRAM "hello"
VERSION "0.0003"
 
DECLARE FUNCTION Entry()
 
FUNCTION Entry()
PRINT "Hello World"
END FUNCTION
END PROGRAM
</syntaxhighlight>
 
=={{header|xEec}}==
<syntaxhighlight lang="xeec">
<lang 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
</syntaxhighlight>
</lang>
 
=={{header|XL}}==
<langsyntaxhighlight XLlang="xl">use XL.UI.CONSOLE
WriteLn "Hello world!"</langsyntaxhighlight>
 
=={{header|XLISP}}==
<langsyntaxhighlight lang="xlisp">(DISPLAY "Hello world!")
(NEWLINE)</langsyntaxhighlight>
 
=={{header|XPL0}}==
<langsyntaxhighlight XPL0lang="xpl0">code Text=12;
Text(0, "Hello world!
")</langsyntaxhighlight>
 
=={{header|XPath}}==
<syntaxhighlight lang="xpath">'Hello world&#xA;'</syntaxhighlight>
 
=={{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}}==
<langsyntaxhighlight lang="yorick">write, "Hello world!"</langsyntaxhighlight>
 
=={{header|Z80 Assembly}}==
Line 3,034 ⟶ 5,040:
Using the Amstrad CPC firmware:
 
<langsyntaxhighlight lang="z80">org $4000
 
txt_output: equ $bb5a
Line 3,051 ⟶ 5,057:
ret
 
world: defm "Hello world!\r\n\0"</langsyntaxhighlight>
 
=={{header|zkl}}==
<langsyntaxhighlight lang="zkl">println("Hello world!");</langsyntaxhighlight>
{{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}}==
For typing:
<syntaxhighlight lang="zoomscript">print "Hello world!"</syntaxhighlight>
For importing:
 
¶0¶print "Hello world!"
 
=={{header|ZX Spectrum Basic}}==
<syntaxhighlight lang="zxbasic">10 print "Hello world!"</syntaxhighlight>
61

edits