You are encouraged to solve this task according to the task description, using any language you may know.
- Task
Display the string Hello world! on a text console.
- Related tasks
- Hello world/Graphical
- Hello world/Line Printer
- Hello world/Newbie
- Hello world/Newline omission
- Hello world/Standard error
- Hello world/Web server
Contents
- 1 0815
- 2 11l
- 3 360 Assembly
- 4 4DOS Batch
- 5 6502 Assembly
- 6 6800 Assembly
- 7 8080 Assembly
- 8 8086 Assembly
- 9 8th
- 10 AArch64 Assembly
- 11 ABAP
- 12 ACL2
- 13 ActionScript
- 14 Ada
- 15 Agena
- 16 Aime
- 17 Algae
- 18 ALGOL 60
- 19 ALGOL 68
- 20 ALGOL W
- 21 ALGOL-M
- 22 Alore
- 23 AmbientTalk
- 24 AmigaE
- 25 AntLang
- 26 Anyways
- 27 APL
- 28 AppleScript
- 29 Applesoft BASIC
- 30 Apricot
- 31 Arc
- 32 Arendelle
- 33 Argile
- 34 ARM Assembly
- 35 ArnoldC
- 36 Arturo
- 37 AsciiDots
- 38 Astro
- 39 Asymptote
- 40 ATS
- 41 AutoHotkey
- 42 AutoIt
- 43 AutoLISP
- 44 Avail
- 45 AWK
- 46 Axe
- 47 B
- 48 B4X
- 49 Babel
- 50 bash
- 51 BASIC
- 52 Basic Casio
- 53 BASIC256
- 54 Batch File
- 55 Battlestar
- 56 BBC BASIC
- 57 bc
- 58 BCPL
- 59 beeswax
- 60 Befunge
- 61 Bird
- 62 Blast
- 63 blz
- 64 BML
- 65 Boo
- 66 bootBASIC
- 67 Brace
- 68 Bracmat
- 69 Brainf***
- 70 Brat
- 71 Brlcad
- 72 Burlesque
- 73 C
- 74 C#
- 75 C++
- 76 C++/CLI
- 77 C1R
- 78 C2
- 79 Cat
- 80 Cduce
- 81 Chapel
- 82 Chef
- 83 ChucK
- 84 Cind
- 85 Clay
- 86 Clean
- 87 Clio
- 88 Clipper
- 89 CLIPS
- 90 Clojure
- 91 CMake
- 92 COBOL
- 93 Cobra
- 94 CoffeeScript
- 95 ColdFusion
- 96 Comal
- 97 Comefrom0x10
- 98 Commodore BASIC
- 99 Common Lisp
- 100 Component Pascal
- 101 Corescript
- 102 Cowgol
- 103 Crack
- 104 Creative Basic
- 105 Crystal
- 106 D
- 107 Dafny
- 108 Dao
- 109 Dart
- 110 DataWeave
- 111 Dc
- 112 DCL
- 113 DDNC
- 114 Delphi
- 115 DeviousYarn
- 116 DIBOL-11
- 117 DIV Games Studio
- 118 DM
- 119 Dragon
- 120 DWScript
- 121 Dyalect
- 122 Dylan
- 123 Dylan.NET
- 124 Déjà Vu
- 125 E
- 126 EasyLang
- 127 eC
- 128 EchoLisp
- 129 ECL
- 130 EDSAC order code
- 131 Efene
- 132 Egel
- 133 Egison
- 134 EGL
- 135 Eiffel
- 136 Ela
- 137 elastiC
- 138 Elena
- 139 Elisa
- 140 Elixir
- 141 Elm
- 142 Emacs Lisp
- 143 Emojicode
- 144 Erlang
- 145 ERRE
- 146 Euler Math Toolbox
- 147 Extended BrainF***
- 148 Ezhil
- 149 F#
- 150 Factor
- 151 Falcon
- 152 FALSE
- 153 Fantom
- 154 ferite
- 155 Fexl
- 156 Fish
- 157 FOCAL
- 158 Forth
- 159 Fortran
- 160 Fortress
- 161 FreeBASIC
- 162 Frege
- 163 friendly interactive shell
- 164 Frink
- 165 FunL
- 166 Furor
- 167 FUZE BASIC
- 168 Gambas
- 169 GAP
- 170 GB BASIC
- 171 gecho
- 172 Gema
- 173 Genie
- 174 Gentee
- 175 GFA Basic
- 176 GLBasic
- 177 Glee
- 178 Global Script
- 179 GlovePIE
- 180 GML
- 181 Go
- 182 Golfscript
- 183 Gosu
- 184 Groovy
- 185 GW-BASIC
- 186 Hack
- 187 Halon
- 188 Harbour
- 189 Haskell
- 190 Haxe
- 191 hexiscript
- 192 HicEst
- 193 HLA
- 194 HolyC
- 195 Hoon
- 196 HPPPL
- 197 HQ9+
- 198 Huginn
- 199 Hy
- 200 i
- 201 Icon and Unicon
- 202 IDL
- 203 Inform 6
- 204 Inko
- 205 Integer BASIC
- 206 Io
- 207 Ioke
- 208 IS-BASIC
- 209 Isabelle
- 210 IWBASIC
- 211 J
- 212 Jack
- 213 Jacquard Loom
- 214 Java
- 215 JavaScript
- 216 JCL
- 217 Joy
- 218 jq
- 219 Jsish
- 220 Julia
- 221 K
- 222 Kabap
- 223 Kaya
- 224 Kdf9 Usercode
- 225 Keg
- 226 Kite
- 227 Kitten
- 228 KonsolScript
- 229 Kotlin
- 230 KQL
- 231 Lambdatalk
- 232 Lang5
- 233 langur
- 234 Lasso
- 235 LaTeX
- 236 Latitude
- 237 LC3 Assembly
- 238 LDPL
- 239 LFE
- 240 Liberty BASIC
- 241 LIL
- 242 Lily
- 243 Lilypond
- 244 Limbo
- 245 Lingo
- 246 Lisaac
- 247 Little
- 248 LiveCode
- 249 LLVM
- 250 Lobster
- 251 Logo
- 252 Logtalk
- 253 LOLCODE
- 254 LotusScript
- 255 LSE
- 256 LSE64
- 257 Lua
- 258 Luna
- 259 M2000 Interpreter
- 260 M4
- 261 Maclisp
- 262 MAD
- 263 make
- 264 Malbolge
- 265 MANOOL
- 266 Maple
- 267 Mathcad
- 268 Mathematica / Wolfram Language
- 269 MATLAB
- 270 Maude
- 271 Maxima
- 272 MAXScript
- 273 MDL
- 274 MelonBasic
- 275 Mercury
- 276 Metafont
- 277 min
- 278 MiniScript
- 279 MiniZinc
- 280 MIPS Assembly
- 281 mIRC Scripting Language
- 282 ML/I
- 283 Modula-2
- 284 Modula-3
- 285 MontiLang
- 286 Morfa
- 287 Mosaic
- 288 MUF
- 289 MUMPS
- 290 MyDef
- 291 MyrtleScript
- 292 MySQL
- 293 Mythryl
- 294 N/t/roff
- 295 Nanoquery
- 296 Neat
- 297 Neko
- 298 Nemerle
- 299 NetRexx
- 300 Never
- 301 newLISP
- 302 Nickle
- 303 Nim
- 304 Nit
- 305 NS-HUBASIC
- 306 Nyquist
- 307 Oberon-2
- 308 Objeck
- 309 Objective-C
- 310 OCaml
- 311 Occam
- 312 Octave
- 313 Oforth
- 314 Ol
- 315 Onyx
- 316 OOC
- 317 ooRexx
- 318 OpenLisp
- 319 Openscad
- 320 Oxygene
- 321 Oz
- 322 PARI/GP
- 323 Pascal
- 324 PASM
- 325 PDP-1 Assembly
- 326 PDP-11 Assembly
- 327 PepsiScript
- 328 Perl
- 329 Pharo
- 330 Phix
- 331 PHL
- 332 PHP
- 333 PicoLisp
- 334 Pict
- 335 Pikachu
- 336 Pike
- 337 PILOT
- 338 PIR
- 339 Pixilang
- 340 PL/I
- 341 PL/M
- 342 PL/SQL
- 343 Plain English
- 344 Plan
- 345 Pony
- 346 Pop11
- 347 PostScript
- 348 Potion
- 349 PowerBASIC
- 350 PowerShell
- 351 Processing
- 352 ProDOS
- 353 Programming Language
- 354 Prolog
- 355 PSQL
- 356 Pure
- 357 PureBasic
- 358 Python
- 359 QB64
- 360 Quackery
- 361 Quill
- 362 Quite BASIC
- 363 R
- 364 Ra
- 365 Racket
- 366 Raku
- 367 Raven
- 368 REALbasic
- 369 REBOL
- 370 RED
- 371 Retro
- 372 Relation
- 373 REXX
- 374 Ring
- 375 Risc-V
- 376 RTL/2
- 377 Ruby
- 378 Run BASIC
- 379 Rust
- 380 Salmon
- 381 SAS
- 382 SASL
- 383 Sather
- 384 Scala
- 385 Scheme
- 386 Scilab
- 387 ScratchScript
- 388 sed
- 389 Seed7
- 390 Self
- 391 SenseTalk
- 392 Set lang
- 393 SETL
- 394 SETL4
- 395 Shen
- 396 Shiny
- 397 Sidef
- 398 SimpleCode
- 399 SIMPOL
- 400 Simula
- 401 Sisal
- 402 SkookumScript
- 403 Slate
- 404 Smalltalk
- 405 smart BASIC
- 406 SmileBASIC
- 407 SNOBOL4
- 408 SNUSP
- 409 SoneKing Assembly
- 410 SPARC Assembly
- 411 Sparkling
- 412 SPL
- 413 SQL
- 414 SQL PL
- 415 Standard ML
- 416 Stata
- 417 Suneido
- 418 Swahili
- 419 Swift
- 420 Symsyn
- 421 Tailspin
- 422 Tcl
- 423 Teco
- 424 Tern
- 425 Terra
- 426 Terraform
- 427 TestML
- 428 TI-83 BASIC
- 429 TI-89 BASIC
- 430 Tiny BASIC
- 431 TMG
- 432 TorqueScript
- 433 TPP
- 434 Transact-SQL
- 435 Transd
- 436 TransFORTH
- 437 Trith
- 438 True BASIC
- 439 TUSCRIPT
- 440 Uniface
- 441 Unison
- 442 UNIX Shell
- 443 Unlambda
- 444 Ursa
- 445 Ursala
- 446 உயிர்/Uyir
- 447 V
- 448 Vala
- 449 VAX Assembly
- 450 VBScript
- 451 Vedit macro language
- 452 Verbexx
- 453 VHDL
- 454 Vim Script
- 455 Visual Basic
- 456 Visual Basic .NET
- 457 Viua VM assembly
- 458 Vlang
- 459 Wart
- 460 WDTE
- 461 WebAssembly
- 462 Wee Basic
- 463 Whenever
- 464 Whiley
- 465 Whitespace
- 466 Wolfram Language
- 467 Wren
- 468 X86 Assembly
- 469 XBasic
- 470 xEec
- 471 XL
- 472 XLISP
- 473 XPL0
- 474 XSLT
- 475 Yorick
- 476 Z80 Assembly
- 477 zkl
- 478 Zoea
- 479 Zoomscript
- 480 ZX Spectrum Basic
0815[edit]
<:48:x<:65:=<:6C:$=$=$$~<:03:+
$~<:ffffffffffffffb1:+$<:77:~$
~<:fffffffffffff8:x+$~<:03:+$~
<:06:x-$x<:0e:x-$=x<:43:x-$
11l[edit]
print(‘Hello world!’)
360 Assembly[edit]
Using native SVC (Supervisor Call) to write to system console:
HELLO CSECT
USING HELLO,15
LA 1,MSGAREA Point Register 1 to message area
SVC 35 Invoke SVC 35 (Write to Operator)
BR 14 Return
MSGAREA EQU * Message Area
DC AL2(19) Total area length = 19 (Prefix length:4 + Data Length:15)
DC XL2'00' 2 bytes binary of zeros
DC C'Hello world!' Text to be written to system console
END
Using WTO Macro to generate SVC 35 and message area:
WTO 'Hello world!'
BR 14 Return
END
4DOS Batch[edit]
echo Hello world!
6502 Assembly[edit]
; goodbyeworld.s for C= 8-bit machines, ca65 assembler format.
; String printing limited to strings of 256 characters or less.
a_cr = $0d ; Carriage return.
bsout = $ffd2 ; C64 KERNEL ROM, output a character to current device.
; use $fded for Apple 2
.code
ldx #0 ; Starting index 0 in X register.
printnext:
lda text,x ; Get character from string.
beq done ; If we read a 0 we're done.
jsr bsout ; Output character.
inx ; Increment index to next character.
bne printnext ; Repeat if index doesn't overflow to 0.
done:
rts ; Return from subroutine.
.rodata
text:
.byte "Hello world!", a_cr, 0
6800 Assembly[edit]
.cr 6800
.tf gbye6800.obj,AP1
.lf gbye6800
;=====================================================;
; Hello world! for the Motorola 6800 ;
; by barrym 2013-03-17 ;
;-----------------------------------------------------;
; Prints the message "Hello world!" to an ascii ;
; terminal (console) connected to a 1970s vintage ;
; SWTPC 6800 system, which is the target device for ;
; this assembly. ;
; Many thanks to: ;
; swtpc.com for hosting Michael Holley's documents! ;
; sbprojects.com for a very nice assembler! ;
; swtpcemu.com for a very capable emulator! ;
; reg x is the string pointer ;
; reg a holds the ascii char to be output ;
;-----------------------------------------------------;
outeee = $e1d1 ;ROM: console putchar routine
.or $0f00
;-----------------------------------------------------;
main ldx #string ;Point to the string
bra puts ; and print it
outs jsr outeee ;Emit a as ascii
inx ;Advance the string pointer
puts ldaa ,x ;Load a string character
bne outs ;Print it if non-null
swi ; else return to the monitor
;=====================================================;
string .as "Hello world!",#13,#10,#0
.en
8080 Assembly[edit]
; This is Hello World, written in 8080 assembly to run under CP/M
; As you can see, it is similar to the 8086, and CP/M is very
; similar to DOS in the way it is called.
org 100h ; CP/M .COM entry point is 100h - like DOS
mvi c,9 ; C holds the syscall, 9 = print string - like DOS
lxi d,msg ; DE holds a pointer to the string
jmp 5 ; CP/M calls are accessed through the jump at 05h
; Normally you'd CALL it, but since you'd end the program by RETurning,
; JMP saves a byte (if you've only got 64k of address space you want to
; save bytes).
msg: db 'Hello world!$'
8086 Assembly[edit]
DOSSEG
.MODEL TINY
.DATA
TXT DB "Hello world!$"
.CODE
START:
MOV ax, @DATA
MOV ds, ax
MOV ah, 09h ; prepare output function
MOV dx, OFFSET TXT ; set offset
INT 21h ; output string TXT
MOV AX, 4C00h ; go back to DOS
INT 21h
END START
With A86 or NASM syntax:
org 100h mov dx, msg mov ah, 9 int 21h mov ax, 4c00h int 21h msg: db "Hello world!$"
8th[edit]
"Hello world!\n" . bye
AArch64 Assembly[edit]
.equ STDOUT, 1
.equ SVC_WRITE, 64
.equ SVC_EXIT, 93
.text
.global _start
_start:
stp x29, x30, [sp, -16]!
mov x0, #STDOUT
ldr x1, =msg
mov x2, 13
mov x8, #SVC_WRITE
mov x29, sp
svc #0 // write(stdout, msg, 13);
ldp x29, x30, [sp], 16
mov x0, #0
mov x8, #SVC_EXIT
svc #0 // exit(0);
msg: .ascii "Hello World!\n"
.align 4
ABAP[edit]
REPORT zgoodbyeworld.
WRITE 'Hello world!'.
ACL2[edit]
(cw "Hello world!~%")
ActionScript[edit]
trace("Hello world!");
Ada[edit]
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
begin
Put_Line ("Hello world!");
end Main;
Agena[edit]
print( "Hello world!" )
Aime[edit]
o_text("Hello world!\n");
or:
integer
main(void)
{
o_text("Hello world!\n");
return 0;
}
Algae[edit]
printf("Hello world!\n");
ALGOL 60[edit]
'BEGIN'
OUTSTRING(1,'('Hello world!')');
SYSACT(1,14,1)
'END'
ALGOL 68[edit]
main: (
printf($"Hello world!"l$)
)
ALGOL W[edit]
begin
write( "Hello world!" )
end.
ALGOL-M[edit]
BEGIN
WRITE( "Hello world!" );
END
Alore[edit]
Print('Hello world!')
AmbientTalk[edit]
system.println("Hello world!")
AmigaE[edit]
PROC main()
WriteF('Hello world!\n')
ENDPROC
AntLang[edit]
Note, that "Hello, World!" prints twice in interactive mode. One time as side-effect and one as the return value of echo.
echo["Hello, World!"]
Anyways[edit]
There was a guy called Hello World
"Ow!" it said.
That's all folks!
APL[edit]
'Hello world!'
AppleScript[edit]
To show in Script Editor Result pane:
"Hello world!"
To show in Script Editor Event Log pane:
log "Hello world!"
Applesoft BASIC[edit]
Important Note: Although Applesoft BASIC allowed the storage and output of mixed-case strings, the ability to enter mixed-case via the keyboard and to output mixed-case on the default display was not offered as standard equipment on the original Apple II/II+. Since Applesoft WAS the default programming language for the Apple II+, perhaps some flexibility in the task specification could be offered, for this and for other systems that lacked proper mixed-case I/O capabilities in at least one popular configuration.
PRINT "Hello world!"
Apricot[edit]
(puts "Hello world!")
Arc[edit]
(prn "Hello world!")
Arendelle[edit]
"Hello world!"
Argile[edit]
use std
print "Hello world!"
compile with: arc hello_world.arg -o hello_world.c && gcc -o hello_world hello_world.c
ARM Assembly[edit]
.global main
message:
.asciz "Hello world!\n"
.align 4
main:
ldr r0, =message
bl printf
mov r7, #1
swi 0
ArnoldC[edit]
IT'S SHOWTIME
TALK TO THE HAND "Hello world!"
YOU HAVE BEEN TERMINATED
Arturo[edit]
print "Hello world!"
AsciiDots[edit]
.-$'Hello, World!'
Astro[edit]
print "Hello world!"
Asymptote[edit]
write('Hello world!');
ATS[edit]
implement main0 () = print "Hello world!\n"
AutoHotkey[edit]
script launched from windows explorer
DllCall("AllocConsole")
FileAppend, Goodbye`, World!, CONOUT$
FileReadLine, _, CONIN$, 1
scripts run from shell [requires Windows XP or higher; older Versions of Windows don´t have the "AttachConsole" function]
DllCall("AttachConsole", "int", -1)
FileAppend, Goodbye`, World!, CONOUT$
SendInput Hello world!{!}
AutoIt[edit]
ConsoleWrite("Hello world!" & @CRLF)
AutoLISP[edit]
(printc "Hello World!")
Avail[edit]
Print: "Hello World!";
AWK[edit]
BEGIN{print "Hello world!"}
"BEGIN" is a "special pattern" - code within "{}" is executed before the input file is read, even if there is no input. "END" is a similar pattern, for after completion of main processing.
END {
print "Hello world!"
}
For a file containing data, the work can be done in the "body". The "//" is "match anything" so gets the first data, the "exit" halts processing the file (any "END" would then be executed). Or instead of //, simply 1 is true.
// {
print "Hello world!"
exit
}
For a "single record" file.
// {
print "Hello world!"
}
For a "single record" file containing - Hello world! -. The "default" action for a "pattern match" (the "/" and "/" define a "pattern" to match data) is to "print" the record.
//
Axe[edit]
Note that the i here is the imaginary i, not the lowercase letter i.
Disp "Hello world!",i
B[edit]
main()
{
putstr("Hello world!*n");
return(0);
}
B4X[edit]
Log("Hello world!")
Babel[edit]
"Hello world!" <<
bash[edit]
echo "Hello world!"
BASIC[edit]
10 PRINT "Hello world!"
PRINT "Hello world!"
Basic Casio[edit]
Locate 1,1,"Hello World!"
or just
"Hello World!"
BASIC256[edit]
PRINT "Hello world!"
Batch File[edit]
Under normal circumstances, when delayed expansion is disabled
echo Hello world!
If delayed expansion is enabled, then the ! must be escaped twice
setlocal enableDelayedExpansion
echo Hello world!^^!
Battlestar[edit]
const hello = "Hello world!\n"
print(hello)
BBC BASIC[edit]
PRINT "Hello world!"
bc[edit]
"Hello world!
"
BCPL[edit]
GET "libhdr"
LET start() = VALOF
{ writef("Hello world!")
RESULTIS 0
}
beeswax[edit]
Straightforward:
*`Hello, World!
Less obvious way:
>`ld!
`
r
o
W
`
b` ,olleH`_
Even less obvious, demonstrating the creation and execution order of instruction pointers, and the hexagonal layout of beeswax programs:
r l
l o
``
ol`*`,d!
``
e H
W
Befunge[edit]
52*"!dlroW ,eybdooG">:#,[email protected]
Bird[edit]
It's not possible to print exclamation marks in Bird which is why it is not used in this example.
use Console
define Main
Console.Println "Hello world"
end
Blast[edit]
# This will display a goodbye message on the terminal screen
.begin
display "Hello world!"
return
# This is the end of the script.
blz[edit]
print("Hello world!")
BML[edit]
display "Hello world!"
Boo[edit]
print "Hello world!"
bootBASIC[edit]
10 print "Hello world!"
Brace[edit]
#!/usr/bin/env bx
use b
Main:
say("Hello world!")
Bracmat[edit]
put$"Hello world!"
Brainf***[edit]
To print text, we need the ascii-value of each character to output.
So, we wanna make a series of round numbers going like:
10 close to newline and carriage return 30 close to ! and SPACE 40 close to COMMA 70 close to G 80 close to W 90 close to b 100 is d and close to e and l 110 close to o 120 close to y
forming all the letters we need if we just add up a bit
Commented version:
+++++ +++++ First cell 10 (its a counter and we will be "multiplying")
[
>+ 10 times 1 is 10
>+++ 10 times 3 is 30
>++++ etc etc
>+++++ ++
>+++++ +++
>+++++ ++++
>+++++ +++++
>+++++ ++++++
>+++++ +++++++
<<<<<<<<< - go back to counter and subtract 1
]
printing G
>>>> + .
o twice
>>>> + ..
d
< .
b
< +++++ +++ .
y
>>> + .
e
<< + .
COMMA
<<<< ++++ .
SPACE
< ++ .
W
>>> +++++ ++ .
o
>>> .
r
+++ .
l
< +++++ ++ .
d
----- --- .
!
<<<<< + .
CRLF
< +++ . --- .
Uncommented:
++++++++++[>+>+++>++++>+++++++>++++++++>+++++++++>++
++++++++>+++++++++++>++++++++++++<<<<<<<<<-]>>>>+.>>>
>+..<.<++++++++.>>>+.<<+.<<<<++++.<++.>>>+++++++.>>>.+++.
<+++++++.--------.<<<<<+.<+++.---.
It can most likely be optimized, but this is a nice way to show how character printing works in Brainf*** :)
Brat[edit]
p "Hello world!"
Brlcad[edit]
The mged utility can output text to the terminal:
echo Hello world!
Burlesque[edit]
"Hello world!"sh
Although please note that sh actually does not print anything.
C[edit]
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
printf("Hello world!\n");
return EXIT_SUCCESS;
}
Or:
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
puts("Hello world!");
return EXIT_SUCCESS;
}
Or, the eternal favourite :)
#include<stdio.h>
int main()
{
printf("\nHello world!");
return 0;
}
or better yet...
#include<stdio.h>
int main()
{
return printf("\nHello World!");
}
C#[edit]
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
System.Console.WriteLine("Hello world!");
}
}
}
C++[edit]
#include <iostream>
int main () {
std::cout << "Hello world!" << std::endl;
}
C++/CLI[edit]
using namespace System;
int main()
{
Console::WriteLine("Hello world!");
}
C1R[edit]
Hello_world/Text
- Output:
$ echo Hello_world/Text >hw.c1r $ ./c1r hw.c1r $ ./a.out Hello world!
C2[edit]
module hello_world;
import stdio as io;
func i32 main(i32 argc, char** argv) {
io.printf("Hello World!\n");
return 0;
}
Cat[edit]
"Hello world!" writeln
Cduce[edit]
print "Hello world!";;
Chapel[edit]
writeln("Hello world!");
Chef[edit]
Goodbye World Souffle.
Ingredients.
71 g green beans
111 cups oil
98 g butter
121 ml yogurt
101 eggs
44 g wheat flour
32 zucchinis
119 ml water
114 g red salmon
108 g lard
100 g dijon mustard
33 potatoes
Method.
Put potatoes into the mixing bowl.
Put dijon mustard into the mixing bowl.
Put lard into the mixing bowl.
Put red salmon into the mixing bowl.
Put oil into the mixing bowl.
Put water into the mixing bowl.
Put zucchinis into the mixing bowl.
Put wheat flour into the mixing bowl.
Put eggs into the mixing bowl.
Put yogurt into the mixing bowl.
Put butter into the mixing bowl.
Put dijon mustard into the mixing bowl.
Put oil into the mixing bowl.
Put oil into the mixing bowl.
Put green beans into the mixing bowl.
Liquefy contents of the mixing bowl.
Pour contents of the mixing bowl into the baking dish.
Serves 1.
ChucK[edit]
<<< "Hello world!">>>;
Cind[edit]
execute() {
host.println("Hello world!");
}
Clay[edit]
main() {
println("Hello world!");
}
Clean[edit]
Start = "Hello world!"
Clio[edit]
'hello world!' -> print
Clipper[edit]
? "Hello world!"
CLIPS[edit]
(printout t "Hello world!" crlf)
Clojure[edit]
(println "Hello world!")
CMake[edit]
message(STATUS "Hello world!")
This outputs
-- Hello world!
COBOL[edit]
Using fixed format.
program-id. hello.
procedure division.
display "Hello world!".
stop run.
Using relaxed compilation rules, the hello program can become a single DISPLAY statement.
display"Hello, world".
prompt$ cobc -x -frelax-syntax -free hello.cob hello.cob: 1: Warning: PROGRAM-ID header missing - assumed hello.cob: 1: Warning: PROCEDURE DIVISION header missing - assumed prompt$ ./hello Hello, world
Note how COBOL can handle the DISPLAY reserved word without a space before the quoted string, the quote being a compile time scan delimiter. The full stop period after the single statement is still mandatory, at least for GnuCOBOL and a clean compile to executable.
Cobra[edit]
class Hello
def main
print 'Hello world!'
CoffeeScript[edit]
console.log "Hello world!"
print "Hello world!"
ColdFusion[edit]
<cfoutput>Hello world!</cfoutput>
Comal[edit]
PRINT "Hello world!"
Comefrom0x10[edit]
'Hello world!'
"Hello world!"
Commodore BASIC[edit]
By default some Commodore computers boot into uppercase/graphics mode (C64, C128, VIC-20, Plus 4, etc.) while others (PET, CBM etc.) boot into lowercase/uppercase mode. Therefore, depending on machine used, the CHR$(14) may or may not be required to switch into mixed-case mode.
10 print chr$(147);chr$(14);:REM 147=clear screen, 14=switch to lowercase mode
20 print "Hello world!"
30 end
- Output:
Hello world!
Common Lisp[edit]
(format t "Hello world!~%")
Or
(print "Hello world!")
Alternate solution[edit]
I use Allegro CL 10.1
;; Project : Hello world/Text
(format t "~a" "Hello world!")
Output:
Hello world!
Component Pascal[edit]
MODULE Hello;
IMPORT Out;
PROCEDURE Do*;
BEGIN
Out.String("Hello world!"); Out.Ln
END Do;
END Hello.
Run command Hello.Do by commander.
Corescript[edit]
print Hello world!
Cowgol[edit]
include "cowgol.coh";
print("Hello world!");
print_nl();
Crack[edit]
import crack.io cout;
cout `Hello world!\n`;
Creative Basic[edit]
OPENCONSOLE
PRINT"Hello world!"
'This line could be left out.
PRINT:PRINT:PRINT"Press any key to end."
'Keep the console from closing right away so the text can be read.
DO:UNTIL INKEY$<>""
CLOSECONSOLE
END
Crystal[edit]
puts "Hello world!"
D[edit]
import std.stdio;
void main() {
writeln("Hello world!");
}
Dafny[edit]
method Main() {
print "hello, world!\n";
assert 10 < 2;
}
Dao[edit]
io.writeln( 'Hello world!' )
Dart[edit]
main() {
var bye = 'Hello world!';
print("$bye");
}
DataWeave[edit]
"Hello world!"
Dc[edit]
[Hello world!]p
...or print a numerically represented string.
5735816763073014741799356604682 P
DCL[edit]
$ write sys$output "Hello world!"
DDNC[edit]
DDNC can only output to a single 7-segment LED display digit, so first we must convert each character into its 7-segment equivalent numerical value.
The three horizontal bars are assigned bits 6, 3, and 0 from top to bottom. The top two vertical bars are assigned bits 5 and 4 while the bottom two vertical bars are assigned bits 2 and 1 from left to right.
Because DDNC can only interpret literals in decimal, each binary number was converted and stored in consecutive memory cells starting at cell 10.
The code can be divided into three sections. The first stores the character numbers in order in an array. The second sets up the loop by loading a delay of 500 milliseconds to slot 3, the start address of the character array in memory to slot 2, and the number of times to loop (14) plus one to slot 5. The third section starts the loop of displaying the characters, waiting for the delay time, incrementing the pointer, decrementing the counter, and checking if the counter is negative to know whether to continue the loop.
0 111 10
0 15 11
0 15 12
0 31 13
0 47 14
0 59 15
0 125 16
0 3 17
0 0 18
0 63 19
0 15 20
0 12 21
0 36 22
0 31 23
0 17 24
0 500 3
0 10 2
0 15 5
60 4
2 2 1
80 1
72 3
30 2
31 5
62 5
61 4
64
Delphi[edit]
program ProjectGoodbye;
{$APPTYPE CONSOLE}
begin
WriteLn('Hello world!');
end.
DeviousYarn[edit]
o:"Hello world!
DIBOL-11[edit]
START ;Hello World
RECORD HELLO
, A11, 'Hello World'
PROC
XCALL FLAGS (0007000000,1) ;Suppress STOP message
OPEN(8,O,'TT:')
WRITES(8,HELLO)
END
DIV Games Studio[edit]
PROGRAM HELLOWORLD;
BEGIN
WRITE_TEXT(0,160,100,4,"HELLO WORLD!");
LOOP
FRAME;
END
END
DM[edit]
/client/New()
..()
src << "Hello world!"
Dragon[edit]
showln "Hello world!"
DWScript[edit]
PrintLn('Hello world!');
Dyalect[edit]
print("Hello world!")
Dylan[edit]
module: hello-world
format-out("%s\n", "Hello world!");
Dylan.NET[edit]
One Line version:
Console::WriteLine("Hello world!")
Hello World Program:
//compile using the new dylan.NET v, 11.5.1.2 or later
//use mono to run the compiler
#refstdasm mscorlib.dll
import System
assembly helloworld exe
ver 1.2.0.0
class public Program
method public static void main()
Console::WriteLine("Hello world!")
end method
end class
Déjà Vu[edit]
!print "Hello world!"
E[edit]
println("Hello world!")
stdout.println("Hello world!")
EasyLang[edit]
print "Hello world!"
eC[edit]
class GoodByeApp : Application
{
void Main()
{
PrintLn("Hello world!");
}
}
EchoLisp[edit]
(display "Hello world!" "color:blue")
ECL[edit]
OUTPUT('Hello world!');
EDSAC order code[edit]
The EDSAC did not support lower-case letters. The method used here is to include a separate O
order to print each character: for short messages and labels this is quite adequate. A more general (though slightly more involved) solution for printing strings is given at Hello world/Line printer#EDSAC order code.
[ Print HELLO WORLD ]
[ A program for the EDSAC ]
[ Works with Initial Orders 2 ]
T64K [ Set load point: address 64 ]
GK [ Set base address ]
[email protected] [ Each O order outputs one ]
[email protected] [ character. The numerical ]
[email protected] [ parameter gives the offset ]
[email protected] [ (from the base address) where ]
[email protected] [ the character to print is ]
[email protected] [ stored ]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
ZF [ Stop ]
*F [ Shift to print letters ]
HF [ Character literals ]
EF
LF
LF
OF
!F [ Space character ]
WF
OF
RF
LF
DF
EZPF [ Start program beginning at
the load point ]
- Output:
HELLO WORLD
Efene[edit]
short version (without a function)
io.format("Hello world!~n")
complete version (put this in a file and compile it)
@public
run = fn () {
io.format("Hello world!~n")
}
Egel[edit]
def main = "Hello World!"
Egison[edit]
(define $main
(lambda [$argv]
(write-string "Hello world!\n")))
EGL[edit]
program HelloWorld
function main()
SysLib.writeStdout("Hello world!");
end
end
Eiffel[edit]
This page uses content from Wikipedia. The original article was at Eiffel (programming language). The list of authors can be seen in the page history. As with Rosetta Code, the text of Wikipedia is available under the GNU FDL. (See links for details on variance) |
class
HELLO_WORLD
create
make
feature
make
do
print ("Hello world!%N")
end
end
Ela[edit]
open monad io
do putStrLn "Hello world!" ::: IO
elastiC[edit]
From the elastiC Manual.
package hello;
// Import the `basic' package
import basic;
// Define a simple function
function hello()
{
// Print hello world
basic.print( "Hello world!\n" );
}
/*
* Here we start to execute package code
*/
// Invoke the `hello' function
hello();
Elena[edit]
ELENA 4.x:
public program()
{
console.writeLine:"Hello world!"
}
Elisa[edit]
"Hello world!"?
Elixir[edit]
IO.puts "Hello world!"
Elm[edit]
main = text "Goodbye World!"
Emacs Lisp[edit]
(insert "Hello world!")
Emojicode[edit]
🏁 🍇
😀 🔤Hello world!🔤
🍉
Erlang[edit]
io:format("Hello world!~n").
ERRE[edit]
! Hello World in ERRE language
PROGRAM HELLO
BEGIN
PRINT("Hello world!")
END PROGRAM
Euler Math Toolbox[edit]
"Hello world!"
Extended BrainF***[edit]
[.>]@Hello world!
Ezhil[edit]
பதிப்பி"வணக்கம் உலகம்!"
பதிப்பி "Hello world!"
பதிப்பி"******* வணக்கம்! மீண்டும் சந்திப்போம் *******"
exit()
F#[edit]
printfn "%s" "Hello world!"
or using .Net classes directly
System.Console.WriteLine("Hello world!")
Factor[edit]
"Hello world!" print
Falcon[edit]
With the printl() function:
printl("Hello world!")
Or via "fast print":
> "Hello world!"
FALSE[edit]
"Hello world!
"
Fantom[edit]
class HelloText
{
public static Void main ()
{
echo ("Hello world!")
}
}
ferite[edit]
word.}}
uses "console";
Console.println( "Goodby, World!" );
Fexl[edit]
say "Hello world!"
Fish[edit]
Standard Hello, world example, modified for this task:
!v"Hello world!"r!
>l?!;o
Explanation of the code:
!v" jumps over the v character with the ! sign, then starts the string mode with " .
Then the characters Hello world! are added, and string mode is closed with ".
The stack is reversed for printing (r), and a jump (!) is executed to jump over the ! at the beginning of the line and execute the v. (Fish is torical)
After going down by v, it goes rightwards again by > and this line is being executed.
This line pushes the stack size (l), and stops (;) if the top item on the stack is equal to 0 (?). Else it executes the ! directly after it and jumps to the o, which outputs the top item in ASCII. Then the line is executed again. It effectively prints the stack until it's empty, then it terminates.
FOCAL[edit]
TYPE "Hello, world" !
Forth[edit]
." Hello world!"
Or as a whole program:
: goodbye ( -- ) ." Hello world!" CR ;
Fortran[edit]
Simplest case - display using default formatting:
print *,"Hello world!"
Use explicit output format:
100 format (5X,A,"!")
print 100,"Hello world!"
Output to channels other than stdout goes like this:
write (89,100) "Hello world!"
uses the format given at label 100 to output to unit 89. If output unit with this number exists yet (no "OPEN" statement or processor-specific external unit setting), a new file will be created and the output sent there. On most UNIX/Linux systems that file will be named "fort.89". Template:7*7
Fortress[edit]
export Executable
run() = println("Hello world!")
FreeBASIC[edit]
? "Hello world!"
sleep
Frege[edit]
module HelloWorld where
main _ = println "Hello world!"
friendly interactive shell[edit]
Unlike other UNIX shell languages, fish doesn't support history substitution, so !
is safe to use without quoting.
echo Hello world!
Frink[edit]
println["Hello world!"]
FunL[edit]
println( 'Hello world!' )
Furor[edit]
."Hello, World!\n"
FUZE BASIC[edit]
PRINT "Hello world!"
Gambas[edit]
Click this link to run this code
Public Sub Main()
PRINT "Hello world!"
End
GAP[edit]
# Several ways to do it
"Hello world!";
Print("Hello world!\n"); # No EOL appended
Display("Hello world!");
f := OutputTextUser();
WriteLine(f, "Hello world!\n");
CloseStream(f);
GB BASIC[edit]
10 print "Hello world!"
gecho[edit]
'Hello, <> 'World! print
Gema[edit]
Gema ia a preprocessor that reads an input file and writes an output file. This code will write "Hello world!' no matter what input is given.
*= ! ignore off content of input
\B=Hello world!\! ! Start output with this text.
Genie[edit]
init
print "Hello world!"
Gentee[edit]
func hello <main>
{
print("Hello world!")
}
GFA Basic[edit]
PRINT "Hello World"
GLBasic[edit]
STDOUT "Hello world!"
Glee[edit]
"Hello world!"
or
'Hello world!'
or to display with double quotes
'"Goodbye,World!"'
or to display with single quotes
"'Goodbye,World!'"
Global Script[edit]
This uses the gsio
I/O operations, which are designed to be simple to implement on top of Haskell and simple to use.
λ _. print qq{Hello world!\n}
GlovePIE[edit]
debug="Hello world!"
GML[edit]
show_message("Hello world!"); // displays a pop-up message
show_debug_message("Hello world!"); // sends text to the debug log or IDE
Go[edit]
package main
import "fmt"
func main() { fmt.Println("Hello world!") }
Golfscript[edit]
"Hello world!"
Gosu[edit]
print("Hello world!")
Groovy[edit]
println "Hello world!"
GW-BASIC[edit]
10 PRINT "Hello world!"
Hack[edit]
<?hh echo 'Hello world!'; ?>
Halon[edit]
If the code in run in the REPL the output will be to stdout otherwise syslog LOG_DEBUG will be used.
echo "Hello world!";
Harbour[edit]
? "Hello world!"
Haskell[edit]
main = putStrLn "Hello world!"
Haxe[edit]
trace("Hello world!");
hexiscript[edit]
println "Hello world!"
HicEst[edit]
WRITE() 'Hello world!'
HLA[edit]
program goodbyeWorld;
#include("stdlib.hhf")
begin goodbyeWorld;
stdout.put( "Hello world!" nl );
end goodbyeWorld;
HolyC[edit]
"Hello world!\n";
Hoon[edit]
~& "Hello world!" ~
HPPPL[edit]
PRINT("Hello world!");
HQ9+[edit]
H
- Technically, HQ9+ can't print "Hello world!" text because of its specification.
- H : Print 'Hello World!'
- Q : Quine
- 9 : Print '99 Bottles of Beer'
- + : Increase Pointer (useless!)
Huginn[edit]
#! /bin/sh
exec huginn --no-argv -E "${0}" "${@}"
#! huginn
main() {
print( "Hello World!\n" );
return ( 0 );
}
Hy[edit]
(print "Hello world!")
i[edit]
software {
print("Hello world!")
}
Icon and Unicon[edit]
procedure main()
write( "Hello world!" )
end
IDL[edit]
print,'Hello world!'
Inform 6[edit]
[Main;
print "Hello world!^";
];
Inko[edit]
import std::stdio::stdout
stdout.print('Hello, world!')
Integer BASIC[edit]
NOTE: Integer BASIC was written (and hand-assembled by Woz himself) for the Apple 1 and original Apple 2. The Apple 1 has NO support for lower-case letters, and it was an expensive (and later) option on the Apple 2. This example accurately represents the only reasonable solution for those target devices, and therefore cannot be "fixed", only deleted.
10 PRINT "Hello world!"
20 END
Io[edit]
"Hello world!" println
Ioke[edit]
"Hello world!" println
IS-BASIC[edit]
PRINT "Hello world!"
Isabelle[edit]
theory Scratch
imports Main
begin
value ‹''Hello world!''›
end
IWBASIC[edit]
OPENCONSOLE
PRINT"Hello world!"
'This line could be left out.
PRINT:PRINT:PRINT"Press any key to end."
'Keep the console from closing right away so the text can be read.
DO:UNTIL INKEY$<>""
CLOSECONSOLE
END
J[edit]
'Hello world!'
Hello world!
Here are some redundant alternatives:
[data=. 'Hello world!'
Hello world!
data
Hello world!
smoutput data
Hello world!
NB. unassigned names are verbs of infinite rank awaiting definition.
NB. j pretty prints the train.
Hello World!
Hello World !
NB. j is glorious, and you should know this!
i. 2 3 NB. an array of integers
0 1 2
3 4 5
verb_with_infinite_rank =: 'Hello world!'"_
verb_with_infinite_rank i. 2 3
Hello world!
verb_with_atomic_rank =: 'Hello world!'"0
verb_with_atomic_rank i. 2 3
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
Jack[edit]
class Main {
function void main () {
do Output.printString("Hello world!");
do Output.println();
return;
}
}
Jacquard Loom[edit]
This weaves the string "Hello world!"
+---------------+
| |
| * * |
|* * * * |
|* * *|
|* * *|
|* * * |
| * * * |
| * |
+---------------+
+---------------+
| |
|* * * |
|* * * |
| * *|
| * *|
|* * * |
|* * * * |
| * |
+---------------+
+---------------+
| |
|* ** * * |
|******* *** * |
| **** * * ***|
| **** * ******|
| ****** ** * |
| * * * * |
| * |
+---------------+
+---------------+
| |
|******* *** * |
|******* *** * |
| ** *|
|* * * *|
|******* ** * |
|******* *** * |
| * |
+---------------+
+---------------+
| |
|******* *** * |
|******* *** * |
| * * * *|
| * * * *|
|******* ** * |
|******* ** * |
| * |
+---------------+
+---------------+
| |
|***** * *** * |
|******* *** * |
| * * * * |
| * * * |
|****** ** * |
|****** ** * |
| * |
+---------------+
+---------------+
| |
| * * * |
|***** * ***** |
|***** ** * ***|
|***** ** * ***|
|******* * ** |
| * * * * |
| * |
+---------------+
+---------------+
| |
| |
| * * |
| * * |
| * |
| * |
| |
| |
+---------------+
Java[edit]
public class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Hello world!");
}
}
JavaScript[edit]
document.write("Hello world!");
print('Hello world!');
WScript.Echo("Hello world!");
console.log("Hello world!")
JCL[edit]
/*MESSAGE Hello world!
Joy[edit]
"Hello world!" putchars.
jq[edit]
"Hello world!"
Jsish[edit]
puts("Hello world!")
Julia[edit]
println("Hello world!")
K[edit]
"Hello world!"
Some of the other ways this task can be attached are:
`0: "Hello world!\n"
s: "Hello world!"
s
\echo "Hello world!"
Kabap[edit]
return = "Hello world!";
Kaya[edit]
program hello;
Void main() {
// My first program!
putStrLn("Hello world!");
}
Kdf9 Usercode[edit]
V2; W0;
RESTART; J999; J999;
PROGRAM; (main program);
V0 = Q0/AV1/AV2;
V1 = B0750064554545700; ("Hello" in Flexowriter code);
V2 = B0767065762544477; ("World" in Flexowriter code);
V0; =Q9; POAQ9; (write "Hello World" to Flexowriter);
999; OUT;
FINISH;
Keg[edit]
Hello world\!
Kite[edit]
simply a single line
"#!/usr/local/bin/kite
"Hello world!"|print;
Kitten[edit]
"Hello world!" say
KonsolScript[edit]
Displays it in a text file or console/terminal.
function main() {
Konsol:Log("Hello world!")
}
Kotlin[edit]
fun main() {
println("Hello world!")
}
KQL[edit]
print 'Hello world!'
Lambdatalk[edit]
Hello world!
{h1 Hello world!}
_h1 Hello world!\n
Lang5[edit]
"Hello world!\n" .
langur[edit]
writeln "yo, peeps"
Lasso[edit]
A plain string is output automatically.
'Hello world!'
LaTeX[edit]
\documentclass{scrartcl}
\begin{document}
Hello World!
\end{document}
Latitude[edit]
putln "Hello world!".
LC3 Assembly[edit]
.orig x3000
LEA R0, hello ; R0 = &hello
TRAP x22 ; PUTS (print char array at addr in R0)
HALT
hello .stringz "Hello World!"
.end
Or (without PUTS)
.orig x3000
LEA R1, hello ; R1 = &hello
TOP LDR R0, R1, #0 ; R0 = R1[0]
BRz END ; if R0 is string terminator (x0000) go to END
TRAP x21 ; else OUT (write char in R0)
ADD R1, R1, #1 ; increment R1
BR TOP ; go to TOP
END HALT
hello .stringz "Hello World!"
.end
LDPL[edit]
procedure:
display "Hello World!" crlf
LFE[edit]
(: io format '"Hello world!~n")
Liberty BASIC[edit]
print "Hello world!"
LIL[edit]
#
# Hello world in lil
#
print "Hello, world!"
Lily[edit]
There are two ways to do this. First, with the builtin print:
print("Hello world!")
Second, by using stdout directly:
stdout.print("Hello world!\n")
Lilypond[edit]
\version "2.18.2"
global = {
\time 4/4
\key c \major
\tempo 4=100
}
\relative c''{ g e e( g2)
}
\addlyrics {
Hel -- lo, World!
}
Limbo[edit]
implement Command;
include "sys.m";
sys: Sys;
include "draw.m";
include "sh.m";
init(nil: ref Draw->Context, nil: list of string)
{
sys = load Sys Sys->PATH;
sys->print("Hello world!\n");
}
Lingo[edit]
put "Hello world!"
or:
trace("Hello world!")
Lisaac[edit]
You can print to standard output in Lisaac by calling STRING.print or INTEGER.print:
Section Header // The Header section is required.
+ name := GOODBYE; // Define the name of this object.
Section Public
- main <- ("Hello world!\n".print;);
However, it may be more straightforward to use IO.print_string instead:
Section Header // The Header section is required.
+ name := GOODBYE2; // Define the name of this object.
Section Public
- main <- (IO.put_string "Hello world!\n";);
Little[edit]
Output to terminal:
puts("Hello world!");
Without the newline terminator:
puts(nonewline: "Hello world!");
Output to arbitrary open, writable file, for example the standard error channel:
puts(stderr, "Hello world!");
LiveCode[edit]
Example on OS X using livecode-server in shell script
#! /usr/local/bin/livecode-serverLivecode also supports stdout as a device to write to
set the outputLineEndings to "lf"
put "Hello world!" & return
write "Hello world!" & return to stdout
LLVM[edit]
; const char str[14] = "Hello World!\00"
@.str = private unnamed_addr constant [14 x i8] c"Hello, world!\00"
; declare extern `puts` method
declare i32 @puts(i8*) nounwind
define i32 @main()
{
call i32 @puts( i8* getelementptr ([14 x i8]* @str, i32 0,i32 0))
ret i32 0
}
Lobster[edit]
print "Hello world!"
Logo[edit]
Print includes a line feed:
print [Hello world!]
Type does not:
type [Hello world!]
Logtalk[edit]
:- object(hello_world).
% the initialization/1 directive argument is automatically executed
% when the object is loaded into memory:
:- initialization(write('Hello world!\n')).
:- end_object.
LOLCODE[edit]
HAI
CAN HAS STDIO?
VISIBLE "Hello world!"
KTHXBYE
LotusScript[edit]
:- object(hello_world).
'This will send the output to the status bar at the bottom of the Notes client screen
print "Hello world!"
:- end_object.
LSE[edit]
AFFICHER [U, /] 'Hello world!'
LSE64[edit]
"Hello world!" ,t nl
Lua[edit]
Function calls with either a string literal or a table constructor passed as their only argument do not require parentheses.
print "Hello world!"
Harder way with a table:
local chars = {"G","o","o","d","b","y","e",","," ","W","o","r","l","d","!"}
for i = 1, #chars do
write(chars[i])
end
Luna[edit]
def main:
hello = "Hello, World!"
print hello
M2000 Interpreter[edit]
Print "Hello World!" \\ printing on columns, in various ways defined by last $() for specific layer
Print $(4),"Hello World!" \\ proportional printing using columns, expanded to a number of columns as the length of string indicates.
Report "Hello World!" \\ proportional printing with word wrap, for text, can apply justification and rendering a range of text lines
M4[edit]
For the particular nature of m4, this is simply:
`Hello world!'
Maclisp[edit]
(format t "Hello world!~%")
Or
(print "Hello world!")
MAD[edit]
VECTOR VALUES HELLO = $11HHELLO WORLD*$
PRINT FORMAT HELLO
END OF PROGRAM
make[edit]
Makefile contents:
all:
$(info Hello world!)
Running make produces:
Hello world!
make: Nothing to be done for `all'.
Malbolge[edit]
Long version:
('&%:9]!~}|z2Vxwv-,POqponl$Hjig%[email protected]@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"
`CB]V?Tx<uVtT`[email protected]?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${[email protected]>
Short version:
(=<`#9]~6ZY32Vx/4Rs+0No-&Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8dc
- Output:
HELLO WORLD!
MANOOL[edit]
In “applicative” notation:
{{extern "manool.org.18/std/0.3/all"} in WriteLine[Out; "Hello world!"]}
OOPish notation (equivalent to the above, up to Abstract Syntax Tree):
{{extern "manool.org.18/std/0.3/all"} in Out.WriteLine["Hello world!"]}
LISPish notation (ditto):
{{extern "manool.org.18/std/0.3/all"} in {WriteLine Out "Hello world!"}}
Using a colon punctuator (ditto):
{{extern "manool.org.18/std/0.3/all"} in: WriteLine Out "Hello world!"}
Note that all semicolons, wherever allowed, are optional. The above example with all possible semicolons:
{{extern; "manool.org.18/std/0.3/all"} in: WriteLine; Out; "Hello world!"}
Maple[edit]
> printf( "Hello world!\n" ): # print without quotes
Hello world!
Mathcad[edit]
Simply type the following directly onto a Mathcad worksheet (A worksheet is Mathcad's combined source code file & console).
"Hello, World!"
Applies to Mathcad Prime, Mathcad Prime Express and Mathcad 15 (and earlier)
Mathematica / Wolfram Language[edit]
Print["Hello world!"]
MATLAB[edit]
>> disp('Hello world!')
Maude[edit]
fmod BYE-WORLD is
protecting STRING .
op sayBye : -> String .
eq sayBye = "Hello world!" .
endfm
red sayBye .
Maxima[edit]
print("Hello world!");
MAXScript[edit]
print "Hello world!"
or:
format "%" "Hello world!"
MDL[edit]
<PRINC "Hello world!">
<CRLF>
MelonBasic[edit]
Say:Hello world!
Mercury[edit]
:- module hello.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
main(!IO) :-
io.write_string("Hello world!\n", !IO).
Metafont[edit]
message "Hello world!"; end
min[edit]
"Hello world!" puts
MiniScript[edit]
print "Hello world!"
MiniZinc[edit]
output ["Hello World"];
- Output:
Hello World ----------
MIPS Assembly[edit]
and.data #section for declaring variables
hello: .asciiz "Hello world!" #asciiz automatically adds the null terminator. If it's .ascii it doesn't have it.
.text # beginning of code
main: # a label, which can be used with jump and branching instructions.
la $a0, hello # load the address of hello into $a0
li $v0, 4 # set the syscall to print the string at the address $a0
syscall # make the system call
li $v0, 10 # set the syscall to exit
syscall # make the system call
mIRC Scripting Language[edit]
echo -ag Hello world!
ML/I[edit]
Hello world!
Modula-2[edit]
MODULE Hello;
IMPORT InOut;
BEGIN
InOut.WriteString('Hello world!');
InOut.WriteLn
END Hello.
Modula-3[edit]
MODULE Goodbye EXPORTS Main;
IMPORT IO;
BEGIN
IO.Put("Hello world!\n");
END Goodbye.
MontiLang[edit]
|Hello, World!| PRINT .
Morfa[edit]
import morfa.io.print;
func main(): void
{
println("Hello world!");
}
Mosaic[edit]
proc start =
println "Hello, world"
end
MUF[edit]
: main[ -- ]
me @ "Hello world!" notify
exit
;
MUMPS[edit]
Write "Hello world!",!
MyDef[edit]
Run with:mydef_run hello.def
Perl:
$print Hello world
C:
module: c
$print Hello world
python:
module: python
$print Hello world
JavaScript
module: js
$print "Hello world"
go:
module: go
$print Hello world
MyrtleScript[edit]
script HelloWorld {
func main returns: int {
print("Hello World!")
}
}
MySQL[edit]
SELECT 'Hello world!';
Mythryl[edit]
print "Hello world!";
N/t/roff[edit]
To get text output, compile the source file using NROFF and set output to the text terminal. If you compile using TROFF, you will get graphical output suitable for typesetting on a graphical typesetter/printer instead.
Because /.ROFF/ is a document formatting language, the majority of input is expected to be text to output onto a medium. Therefore, there are no routines to explicitly call to print text.
Hello world!
Nanoquery[edit]
println "Hello world!"
Neat[edit]
void main() writeln "Hello world!";
Neko[edit]
$print("Hello world!");
Nemerle[edit]
class Hello
{
static Main () : void
{
System.Console.WriteLine ("Hello world!");
}
}
Easier method:
System.Console.WriteLine("Hello world!");
NetRexx[edit]
say 'Hello world!'
Never[edit]
func main() -> int {
prints("Hello world!\n");
0
}
- Output:
prompt$ never -f hello.nev Hello world!
newLISP[edit]
(println "Hello world!")
Nickle[edit]
printf("Hello world!\n")
Nim[edit]
echo("Hello world!")
Nit[edit]
print "Hello world!"
NS-HUBASIC[edit]
As lowercase characters are not offered in NS-HUBASIC, perhaps some flexibility in the task specification could be offered.
Using ?
:
10 ? "HELLO WORLD!"
Using PRINT
:
10 PRINT "HELLO WORLD!"
Nyquist[edit]
Interpreter: Nyquist (3.15)
LISP syntax[edit]
(format t "Hello world!")
Or
(print "Hello world!")
SAL syntax[edit]
print "Hello World!"
Or
exec format(t, "Hello World!")
Oberon-2[edit]
MODULE Goodbye;
IMPORT Out;
PROCEDURE World*;
BEGIN
Out.String("Hello world!");Out.Ln
END World;
BEGIN
World;
END Goodbye.
Objeck[edit]
class Hello {
function : Main(args : String[]) ~ Nil {
"Hello world!"->PrintLine();
}
}
Objective-C[edit]
The de facto Objective-C "Hello, World!" program is most commonly illustrated as the following, using the NSLog() function:
#import <Foundation/Foundation.h>
int main() {
@autoreleasepool {
NSLog(@"Hello, World!");
}
}
However the purpose of the NSLog() function is to print a message to standard error prefixed with a timestamp, which does not meet the most common criteria of a "Hello, World!" program of displaying only the requested message to standard output.
The following code prints the message to standard output without a timestamp using exclusively Objective-C messages:
#import <Foundation/Foundation.h>
int main() {
@autoreleasepool {
NSFileHandle *standardOutput = [NSFileHandle fileHandleWithStandardOutput];
NSString *message = @"Hello, World!\n";
[standardOutput writeData:[message dataUsingEncoding:NSUTF8StringEncoding]];
}
}
Objective-C also supports functions contained within the C standard library. However, Objective-C's NSString objects must be converted into a UTF-8 string in order to be supported by the C language's I/O functions.
#import <Foundation/Foundation.h>
int main() {
@autoreleasepool {
NSString *message = @"Hello, World!\n";
printf("%s", message.UTF8String);
}
}
OCaml[edit]
print_endline "Hello world!"
Occam[edit]
#USE "course.lib"
PROC main (CHAN BYTE screen!)
out.string("Hello world!*c*n", 0, screen)
:
Octave[edit]
disp("Hello world!");
Or, using C-style function printf:
printf("Hello world!");
Oforth[edit]
"Hello world!" .
Ol[edit]
(print "Hello world!")
Onyx[edit]
`Hello world!\n' print flush
OOC[edit]
To print a String, either call its println() method:
main: func {
"Hello world!" println()
}
Or call the free println() function with the String as the argument.
main: func {
println("Hello world!")
}
ooRexx[edit]
Refer also to the Rexx and NetRexx solutions. Simple output is common to most Rexx dialects.
/* Rexx */
say 'Hello world!'
OpenLisp[edit]
We can use the same code as the Common Lisp example, but as a shell script.
#!/openlisp/uxlisp -shell
(format t "Hello world!~%")
(print "Hello world!")
Output: Hello world! "Hello world!"
Openscad[edit]
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
Oxygene[edit]
From wp:Oxygene (programming language)
namespace HelloWorld;
interface
type
HelloClass = class
public
class method Main;
end;
implementation
class method HelloClass.Main;
begin
System.Console.WriteLine('Hello world!');
end;
end.
>HelloWorld.exe Hello world!
Oz[edit]
{Show "Hello world!"}
PARI/GP[edit]
print("Hello world!")
Pascal[edit]
program byeworld;
begin
writeln('Hello world!');
end.
PASM[edit]
print "Hello world!\n"
end
PDP-1 Assembly[edit]
This can be assembled with macro1.c distributed with SIMH and then run on the SIMH PDP-1 simulator.
hello
/ above: title line - was punched in human readable letters on paper tape
/ below: location specifier - told assembler what address to assemble to
100/
lup, lac i ptr / load ac from address stored in pointer
cli / clear io register
lu2, rcl 6s / rotate combined ac + io reg 6 bits to the left
/ left 6 bits in ac move into right 6 bits of io reg
tyo / type out character in 6 right-most bits of io reg
sza / skip next instr if accumulator is zero
jmp lu2 / otherwise do next character in current word
idx ptr / increment pointer to next word in message
sas end / skip next instr if pointer passes the end of message
jmp lup / otherwise do next word in message
hlt / halt machine
ptr, msg / pointer to current word in message
msg, text "hello, world" / 3 6-bit fiodec chars packed into each 18-bit word
end, . / sentinel for end of message
start 100 / tells assembler where program starts
PDP-11 Assembly[edit]
This is Dennis Ritchie's Unix Assembly ("as"). Other PDP-11 assembly languages include PAL-11R, PAL-11S and MACRO-11.
.globl start
.text
start:
mov $1,r0
sys 4; outtext; outlen
sys 1
rts pc
.data
outtext: <Hello world!\n>
outlen = . - outtext
PepsiScript[edit]
The letters are only outputted in uppercase in the running program. However, lowercase characters can be used in the code instead.
For typing:
#include default-libraries
#author Childishbeat
class Hello world/Text:
function Hello world/Text:
print "Hello world!"
end
For importing:
•dl◘Childishbeat◙♦Hello world/Text♪♣Hello_world!♠
Perl[edit]
print "Hello world!\n";
Backported from Raku:
use feature 'say';
say 'Hello world!';
or:
use 5.010;
say 'Hello world!';
Pharo[edit]
"Comments are in double quotes"
"Sending message printString to 'Hello World' string"
'Hello World' printString
Phix[edit]
puts(1,"Hello world!")
PHL[edit]
module helloworld;
extern printf;
@Integer main [
printf("Hello world!");
return 0;
]
PHP[edit]
<?php
echo "Hello world!\n";
?>
Alternatively, any text outside of the <?php ?>
tags will be automatically echoed:
Hello world!
PicoLisp[edit]
(prinl "Hello world!")
Pict[edit]
Using the syntax sugared version:
(prNL "Hello World!");
Using the channel syntax:
new done: ^[]
run ( prNL!["Hello World!" (rchan done)]
| done?_ = () )
Pikachu[edit]
pikachu pika pikachu pika pika pi pi pika pikachu pika pikachu pi pikachu pi pikachu pi pika pi pikachu pikachu pi pi pika pika pikachu pika pikachu pikachu pi pika pi pika pika pi pikachu pikachu pi pikachu pi pika pikachu pi pikachu pika pikachu pi pikachu pikachu pi pikachu pika pika pikachu pi pikachu pi pi pikachu pikachu pika pikachu pi pika pi pi pika pika pikachu pikachu pi pi pikachu pi pikachu
pikachu pikachu pi pikachu
pikachu pika pika pikachu pika pikachu pikachu pika pika pikachu pikachu pi pi pikachu pika pikachu pika pika pi pika pikachu pikachu pi pika pika pikachu pi pika pi pika pi pikachu pi pikachu pika pika pi pi pika pi pika pika pikachu pikachu pika pikachu pikachu pika pi pikachu pika pi pikachu pi pika pika pi pikachu pika pi pika pikachu pi pi pikachu pika pika pi pika pi pikachu
pikachu pikachu pi pikachu
pikachu pika pi pika pika pikachu pika pikachu pi pikachu pi pi pika pi pikachu pika pi pi pika pikachu pi pikachu pi pi pikachu pikachu pika pikachu pikachu pika pi pikachu pi pika pikachu pi pikachu pika pika pikachu pika pi pi pikachu pikachu pika pika pikachu pi pika pikachu pikachu pi pika pikachu pikachu pika pi pi pikachu pikachu pi pikachu pi pikachu pi pikachu pi pika pikachu pi pikachu pika pikachu pi pika pi pikachu
pi pika
pikachu pikachu pi pikachu
pika pi
pikachu pikachu pi pikachu
pikachu pi pikachu pi pi pikachu pi pikachu pika pikachu pikachu pi pikachu pikachu pika pi pi pika pikachu pika pikachu pi pi pikachu pika pi pi pikachu pika pika pi pika pika pikachu pika pikachu pi pi pika pikachu pika pi pikachu pikachu pi pikachu pika pikachu pikachu pika pi pi pikachu pikachu pi pika pikachu pi pikachu pika pikachu pikachu pika pi pikachu pikachu pika pikachu pi pikachu pika pika pi pikachu pi pika pi pikachu pikachu pi pikachu
pi pika
pikachu pikachu pi pikachu
pikachu pikachu pi pika pikachu pi pika pika pi pi pika pi pikachu pi pika pi pika pi pika pikachu pika pi pi pikachu pi pikachu pi pika pi pika pika pikachu pi pikachu
pikachu pikachu pi pikachu
pikachu pi pikachu pika pikachu pi pika pi pikachu pikachu pika pika pi pi pikachu pi pika pi pikachu pi pika pikachu pi pika pi pi pikachu pikachu pika pika pikachu pikachu pi pi pikachu pi pikachu pi pikachu pi pi pikachu pikachu pi pikachu pi pikachu pi pika pika pikachu pikachu pika pi pika pikachu pi pikachu pi pi pika pikachu pika pi pikachu pi pika pi pi pikachu pikachu pika pika pikachu pika pika pikachu pi pika pi pika pikachu pi pika pikachu pika pi pika pikachu
pikachu pikachu pika pikachu
pikachu pikachu pika pikachu
pi pi pikachu pi pikachu pika pika pi pikachu pika pika pi pi pika pika pikachu pi pi pikachu pi pika pi pika pikachu pi pikachu pi pikachu pikachu pi pi pika pika pi pika pika pi pika pikachu pikachu pi pikachu pika pi pi pika pi pi pikachu pikachu pika pi pi pika pika pi pika pikachu pi pikachu pi pi pika pi pika pika pikachu pika pi pika pikachu pi pikachu pikachu pi pi pika pi pika pika pikachu pikachu pi pikachu
pikachu pikachu pi pikachu
pikachu pi pikachu pikachu pika pikachu pikachu pika pika pikachu pikachu pika pikachu pi pika pikachu pika pika pi pikachu pi pi pika pi pi pikachu pika pika pikachu pikachu pika pikachu pikachu pi pika pi pi pikachu pikachu pika pi pi pikachu pikachu pika pikachu pika pi pikachu pi pika pi pika pikachu pika pi pikachu pi pikachu pikachu pi pika pikachu pi pikachu pikachu pi pika pi pikachu pikachu pi pikachu pika pika pi pi pikachu
pikachu pi pi pika pi pi pikachu pika pikachu pikachu pika pika pi pi pika pikachu pi pikachu pi pi pika pi pika pi pi pika pikachu pi pika pi pikachu pika pikachu pika pi pi pika pi pi pikachu pi pikachu pikachu pika pi pikachu pi pi pika pi pikachu pi pi pika pi pi pikachu pika pikachu pika pikachu pika pi pikachu pikachu pi pi pika pika pikachu
pikachu pikachu pi pikachu
pikachu pikachu pika pikachu
Pike[edit]
int main(){
write("Hello world!\n");
}
PILOT[edit]
T:Hello world!
PIR[edit]
.sub hello_world_text :main
print "Hello world!\n"
.end
Pixilang[edit]
fputs("Hello world!\n")
PL/I[edit]
goodbye:proc options(main);
put list('Hello world!');
end goodbye;
PL/M[edit]
Assuming the existence of a WRITE$STRING library routine.
HELLO_WORLD: DO;
/* external I/O routines */
WRITE$STRING: PROCEDURE( S ) EXTERNAL; DECLARE S POINTER; END WRITE$STRING;
/* end external routines */
MAIN: PROCEDURE;
CALL WRITE$STRING( @( 'Hello world!', 0AH, 0 ) );
END MAIN;
END HELLO_WORLD;
PL/SQL[edit]
SET serveroutput ON
BEGIN
DBMS_OUTPUT.PUT_LINE('Hello world!');
END;
/
SQL> set serveroutput on SQL> SQL> BEGIN 2 DBMS_OUTPUT.PUT_LINE('Hello world!'); 3 END; 4 / Hello world! PL/SQL procedure successfully completed.
Plain English[edit]
\This prints Hello World within the CAL-4700 IDE.
\...and backslashes are comments!
To run:
Start up.
Write "Hello World!" to the console.
Wait for the escape key.
Shut down.
Plan[edit]
This prints HELLO WORLD on operator's console.
#STEER LIST,BINARY
#PROGRAM HLWD
#LOWER
MSG1A 11HHELLO WORLD
MSG1B 11/MSG1A
#PROGRAM
#ENTRY 0
DISTY MSG1B
SUSWT 2HHH
#END
#FINISH
#STOP
Pony[edit]
actor Main
new create(env: Env) =>
env.out.print("Hello world!")
Pop11[edit]
printf('Hello world!\n');
PostScript[edit]
To generate a document that shows the text "Hello world!":
%!PS
/Helvetica 20 selectfont
70 700 moveto
(Hello world!) show
showpage
If the viewer has a console, then there are the following ways to display the topmost element of the stack:
(Hello world!) ==
will display the string "(Hello world!)";
(Hello world!) =
will display the content of the string "(Hello world!)"; that is, "Hello world!";
(Hello world!) print
will do the same, without printing a newline. It may be necessary to provoke an error message to make the console pop up. The following program combines all four above variants:
%!PS
/Helvetica 20 selectfont
70 700 moveto
(Hello world!) dup dup dup
= print == % prints three times to the console
show % prints to document
1 0 div % provokes error message
showpage
Potion[edit]
"Hello world!\n" print
PowerBASIC[edit]
#COMPILE EXE
#COMPILER PBCC 6
FUNCTION PBMAIN () AS LONG
CON.PRINT "Hello world!"
CON.WAITKEY$
END FUNCTION
PowerShell[edit]
This example used to say that using Write-Host was good practice. This is not true - it should in fact be avoided in most cases.
See http://www.jsnover.com/blog/2013/12/07/write-host-considered-harmful/ (Jeffrey Snover is one of the creators of PowerShell).
'Hello world!'
Processing[edit]
println("Hello world!");
ProDOS[edit]
printline Hello world!
Programming Language[edit]
For typing:
print(Hello world!)
For importing:
[print(Hello world!)]
Prolog[edit]
:- write('Hello world!'), nl.
PSQL[edit]
EXECUTE BLOCK RETURNS(S VARCHAR(40)) AS BEGIN S = 'Hello world!'; SUSPEND; END
Pure[edit]
using system;
puts "Hello world!\n" ;
PureBasic[edit]
OpenConsole()
PrintN("Hello world!")
Input() ; Wait for enter
Python[edit]
print "Hello world!"
The same using sys.stdout
import sys
sys.stdout.write("Hello world!\n")
In Python 3.0, print is changed from a statement to a function.
(And version 2.X too).print("Hello world!")
An easter egg
The first two examples print Hello, world!
once, and the last one prints it twice.
import __hello__
import __phello__
import __phello__.spam
QB64[edit]
PRINT "Hello world!"
Quackery[edit]
say "Hello world!"
Quill[edit]
"Hello world!" print
Quite BASIC[edit]
10 print "Hello world!"
R[edit]
cat("Hello world!\n")
or
message("Hello world!")
or
print("Hello world!")
Ra[edit]
class HelloWorld
**Prints "Hello world!"**
on start
print "Hello world!"
Racket[edit]
(printf "Hello world!\n")
Raku[edit]
(formerly Perl 6)
say 'Hello world!';
In an object-oriented approach, the string is treated as an object calling its say() method:
"Hello, World!".say();
Raven[edit]
'Hello world!' print
REALbasic[edit]
This requires a console application.
Function Run(args() as String) As Integer
Print "Hello world!"
Quit
End Function
REBOL[edit]
print "Hello world!"
RED[edit]
print "Hello world!"
Retro[edit]
'Hello_world! s:put
Relation[edit]
' Hello world!
REXX[edit]
using SAY[edit]
/*REXX program to show a line of text. */
say 'Hello world!'
using SAY variable[edit]
/*REXX program to show a line of text. */
yyy = 'Hello world!'
say yyy
using LINEOUT[edit]
/*REXX program to show a line of text. */
call lineout ,"Hello world!"
Ring[edit]
See "Hello world!"
Risc-V[edit]
.data
hello:
.string "Hello World!\n\0"
.text
main:
la a0, hello
li a7, 4
ecall
li a7, 10
ecall
RTL/2[edit]
TITLE Goodbye World;
LET NL=10;
EXT PROC(REF ARRAY BYTE) TWRT;
ENT PROC INT RRJOB();
TWRT("Hello world!#NL#");
RETURN(1);
ENDPROC;
Ruby[edit]
puts "Hello world!"
or
$stdout.puts "Hello world!"
or even
STDOUT.write "Hello world!\n"
Using the > global
$>.puts "Hello world!"
$>.write "Hello world!\n"
Run BASIC[edit]
print "Hello world!"
Rust[edit]
fn main() {
print!("Hello world!");
}
or
fn main() {
println!("Hello world!");
}
Salmon[edit]
"Hello world!"!
or
print("Hello world!\n");
or
standard_output.print("Hello world!\n");
SAS[edit]
/* Using a data step. Will print the string in the log window */
data _null_;
put "Hello world!";
run;
SASL[edit]
Note that a string starts with a single and ends with a double quote
'Hello World!",nl
Sather[edit]
class GOODBYE_WORLD is
main is
#OUT+"Hello world!\n";
end;
end;
Scala[edit]
Ad hoc REPL solution[edit]
Ad hoc solution as REPL script. Type this in a REPL session:
println("Hello world!")
Via Java runtime[edit]
This is a call to the Java run-time library. Not recommended.
System.out.println("Hello world!")
Via Scala Console API[edit]
This is a call to the Scala run-time library. Recommended.
println("Hello world!")
Short term deviation to out[edit]
Console.withErr(Console.out) { Console.err.println("This goes to default _out_") }
Long term deviation to out[edit]
Console.err.println ("Err not deviated")
Console.setErr(Console.out)
Console.err.println ("Err deviated")
Console.setErr(Console.err) // Reset to normal
Scheme[edit]
All Scheme implementations display the value of the last evaluated expression before the program terminates.
"Hello world!"
The display and newline procedures are found in specific modules of the standard library in R6RS and R7RS. The previous standards have no concept of modules and the entirety of the standard library is loaded by default.
R5RS[edit]
(display "Hello world!")
(newline)
R6RS[edit]
(import (rnrs base (6))
(rnrs io simple (6)))
(display "Hello world!")
(newline)
R7RS[edit]
(import (scheme base)
(scheme write))
(display "Hello world!")
(newline)
Scilab[edit]
disp("Hello world!");
ScratchScript[edit]
print "Hello world!"
This example waits until the mouse is clicked for the program to end. This can be useful if the program executes too fast for "Hello world!" to be visible on the screen long enough for it to be comfortable.
print "Hello world!"
delayOnClick
sed[edit]
i\
Hello world!
q
Seed7[edit]
$ include "seed7_05.s7i";
const proc: main is func
begin
writeln("Hello world!");
end func;
Self[edit]
'Hello world!' printLine.
SenseTalk[edit]
put "Hello world!"
Set lang[edit]
set ! H
set ! E
set ! L
set ! L
set ! O
set ! 32
set ! W
set ! O
set ! R
set ! L
set ! D
set ! 33
SETL[edit]
print("Hello world!");
SETL4[edit]
out("Hello world!");end
Shen[edit]
(output "Hello world!~%")
Shiny[edit]
say 'Hello world!'
Sidef[edit]
„Hello world!”.say;
SimpleCode[edit]
The letters are only outputted in uppercase in the running program. However, lowercase characters can be used in the code instead.
dtxt
Hello world!
SIMPOL[edit]
function main()
end function "Hello world!{d}{a}"
Simula[edit]
BEGIN
OUTTEXT("Hello world!");
OUTIMAGE
END
Sisal[edit]
define main
% Sisal doesn't yet have a string built-in.
% Let's define one as an array of characters.
type string = array[character];
function main(returns string)
"Hello world!"
end function
SkookumScript[edit]
print("Hello world!")
Alternatively if just typing in the SkookumIDE REPL:
"Hello world!"
Slate[edit]
inform: 'Hello world!'.
Smalltalk[edit]
Transcript show: 'Hello world!'; cr.(as does the above code)
'Hello world!' printNl.
smart BASIC[edit]
PRINT "Hello world!"
SmileBASIC[edit]
PRINT "Hello world!"
SNOBOL4[edit]
Using CSnobol4 dialect
OUTPUT = "Hello world!"
END
SNUSP[edit]
Core SNUSP[edit]
/++++!/===========?\>++.>+.+++++++..+++\
\+++\ | /+>+++++++>/ /++++++++++<<.++>./
$+++/ | \+++++++++>\ \+++++.>.+++.-----\
\==-<<<<+>+++/ /=.>.+>.--------.-/
Modular SNUSP[edit]
@\[email protected]\[email protected]\[email protected]\[email protected]\e.>@\[email protected]\.<[email protected]\[email protected]\[email protected]\d.>+.! #
| | \@------|# | \@@[email protected]@++|+++#- \\ -
| \@@@@=+++++# | \===--------!\===!\-----|-------#-------/
\@@[email protected]@@+++++# \!#+++++++++++++++++++++++#!/
SoneKing Assembly[edit]
extern print
dv Msg Goodbye,World!
mov eax Msg
push
call print
pop
SPARC Assembly[edit]
.section ".text"
.global _start
_start:
mov 4,%g1 ! 4 is SYS_write
mov 1,%o0 ! 1 is stdout
set .msg,%o1 ! pointer to buffer
mov (.msgend-.msg),%o2 ! length
ta 8
mov 1,%g1 ! 1 is SYS_exit
clr %o0 ! return status is 0
ta 8
.msg:
.ascii "Hello world!\n"
.msgend:
Sparkling[edit]
print("Hello world!");
SPL[edit]
#.output("Hello world!")
SQL[edit]
SELECT 'Hello world!' text FROM dual;
SQL>select 'Hello world!' text from dual; TEXT ------------ Hello world!
SQL PL[edit]
With SQL only:
SELECT 'Hello world!' AS text FROM sysibm.sysdummy1;
Output:
db2 -t db2 => SELECT 'Hello world!' AS text FROM sysibm.sysdummy1; TEXT ------------ Hello world! 1 record(s) selected.version 9.7 or higher.
With SQL PL:
SET SERVEROUTPUT ON;
CALL DBMS_OUTPUT.PUT_LINE('Hello world!');
Output:
db2 -t db2 => SET SERVEROUTPUT ON DB20000I The SET SERVEROUTPUT command completed successfully. db2 => CALL DBMS_OUTPUT.PUT_LINE('Hello world!') Return Status = 0 Hello world!
Standard ML[edit]
print "Hello world!\n"
Stata[edit]
display "Hello world!"
Suneido[edit]
Print("Hello world!")
Swahili[edit]
andika("Hello world!")
Swift[edit]
print("Hello world!")
println("Hello world!")
Symsyn[edit]
'hello world' []
Tailspin[edit]
'Hello World' -> !OUT::write
Tcl[edit]
Output to terminal:
puts "Hello world!"
Output to arbitrary open, writable file:
puts $fileID "Hello world!"
Teco[edit]
Outputting to terminal. Please note that ^A means control-A, not a caret followed by 'A', and that $ represent the ESC key.
^AHello world!^A$$
Tern[edit]
println("Hello world!");
Terra[edit]
C = terralib.includec("stdio.h")
terra hello(argc : int, argv : &rawstring)
C.printf("Hello world!\n")
return 0
end
Terraform[edit]
output "result" {
value = "Hello world!"
}
- Output:
$ terraform init $ terraform apply Apply complete! Resources: 0 added, 0 changed, 0 destroyed. Outputs: result = Hello world! $ terraform output result Hello world!
TestML[edit]
%TestML 0.1.0
Print("Hello world!")
TI-83 BASIC[edit]
Disp "Hello world!
(Lowercase letters DO exist in TI-BASIC, though you need an assembly program to enable them.)
TI-89 BASIC[edit]
Disp "Hello world!"
Tiny BASIC[edit]
10 PRINT "Hello, World!"
TMG[edit]
Unix TMG:
begin: parse(( = { <Hello, World!> * } ));
TorqueScript[edit]
echo("Hello world!");
TPP[edit]
Hello world!
Transact-SQL[edit]
PRINT "Hello world!"
Transd[edit]
(textout "Hello, World!")
TransFORTH[edit]
PRINT " Hello world! "
Trith[edit]
"Hello world!" print
True BASIC[edit]
! In True BASIC all programs run in their own window. So this is almost a graphical version.
PRINT "Hello world!"
END
TUSCRIPT[edit]
$$ MODE TUSCRIPT
PRINT "Hello world!"
Output:
Hello world!
Uniface[edit]
message "Hello world!"
Unison[edit]
main = '(printLine "Hello world!")
UNIX Shell[edit]
#!/bin/sh
echo "Hello world!"
C Shell[edit]
#!/bin/csh -f
echo "Hello world!\!"
We use \! to prevent history substitution. Plain ! at end of string seems to be safe, but we use \! to be sure.
Unlambda[edit]
`r```````````````.G.o.o.d.b.y.e.,. .W.o.r.l.d.!i
Ursa[edit]
out "hello world!" endl console
Ursala[edit]
output as a side effect of compilation
#show+
main = -[Hello world!]-
output by a compiled executable
#import std
#executable ('parameterized','')
main = <file[contents: -[Hello world!]-]>!
உயிர்/Uyir[edit]
முதன்மை என்பதின் வகை எண் பணி {{
("உலகத்தோருக்கு வணக்கம்") என்பதை திரை.இடு;
முதன்மை = 0;
}};
V[edit]
"Hello world!" puts
Vala[edit]
void main(){
stdout.printf("Hello world!\n");
}
VAX Assembly[edit]
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
VBScript[edit]
WScript.Echo "Hello world!"
Vedit macro language[edit]
Message("Hello world!")
Verbexx[edit]
@SAY "Hello world!";
VHDL[edit]
LIBRARY std;
USE std.TEXTIO.all;
entity test is
end entity test;
architecture beh of test is
begin
process
variable line_out : line;
begin
write(line_out, string'("Hello world!"));
writeline(OUTPUT, line_out);
wait; -- needed to stop the execution
end process;
end architecture beh;
Vim Script[edit]
echo "Hello world!\n"
Visual Basic[edit]
Visual Basic 6 is actually designed to create GUI applications, however with a little help from the Microsoft.Scripting Library it is fairly easy to write a simple console application.
Option Explicit
Private Declare Function AllocConsole Lib "kernel32.dll" () As Long
Private Declare Function FreeConsole Lib "kernel32.dll" () As Long
'needs a reference set to "Microsoft Scripting Runtime" (scrrun.dll)
Sub Main()
Call AllocConsole
Dim mFSO As Scripting.FileSystemObject
Dim mStdIn As Scripting.TextStream
Dim mStdOut As Scripting.TextStream
Set mFSO = New Scripting.FileSystemObject
Set mStdIn = mFSO.GetStandardStream(StdIn)
Set mStdOut = mFSO.GetStandardStream(StdOut)
mStdOut.Write "Hello world!" & vbNewLine
mStdOut.Write "press enter to quit program."
mStdIn.Read 1
Call FreeConsole
End Sub
Visual Basic .NET[edit]
Imports System
Module HelloWorld
Sub Main()
Console.WriteLine("Hello world!")
End Sub
End Module
Viua VM assembly[edit]
.function: main/0
text %1 local "Hello World!"
print %1 local
izero %0 local
return
.end
Vlang[edit]
fn main() {
println('Hello World!')
}
Wart[edit]
prn "Hello world!"
WDTE[edit]
io.writeln io.stdout 'Hello world!';
WebAssembly[edit]
(module $helloworld
;;Import fd_write from WASI, declaring that it takes 4 i32 inputs and returns 1 i32 value
(import "wasi_unstable" "fd_write"
(func $fd_write (param i32 i32 i32 i32) (result i32))
)
;;Declare initial memory size of 32 bytes
(memory 32)
;;Export memory so external functions can see it
(export "memory" (memory 0))
;;Declare test data starting at address 8
(data (i32.const 8) "Hello world!\n")
;;The entry point for WASI is called _start
(func $main (export "_start")
;;Write the start address of the string to address 0
(i32.store (i32.const 0) (i32.const 8))
;;Write the length of the string to address 4
(i32.store (i32.const 4) (i32.const 13))
;;Call fd_write to print to console
(call $fd_write
(i32.const 1) ;;Value of 1 corresponds to stdout
(i32.const 0) ;;The location in memory of the string pointer
(i32.const 1) ;;Number of strings to output
(i32.const 24) ;;Address to write number of bytes written
)
drop ;;Ignore return code
)
)
Wee Basic[edit]
print 1 "Hello world!"
end
Whenever[edit]
1 print("Hello world!");
Whiley[edit]
import whiley.lang.System
method main(System.Console console):
console.out.println("Hello world!")
Whitespace[edit]
There is a "Hello World" - example-program on the Whitespace-website
Wolfram Language[edit]
Print["Hello world!"]
Wren[edit]
System.print("Hello world!")
X86 Assembly[edit]
This is known to work on Linux, it may or may not work on other Unix-like systems
Prints "Hello world!" to stdout (and there is probably an even simpler version):
section .data
msg db 'Hello world!', 0AH
len equ $-msg
section .text
global _start
_start: mov edx, len
mov ecx, msg
mov ebx, 1
mov eax, 4
int 80h
mov ebx, 0
mov eax, 1
int 80h
AT&T syntax: works with gcc (version 4.9.2) and gas (version 2.5):
.section .text
.globl main
main:
movl $4,%eax #syscall number 4
movl $1,%ebx #number 1 for stdout
movl $str,%ecx #string pointer
movl $16,%edx #number of bytes
int $0x80 #syscall interrupt
ret
.section .data
str: .ascii "Hello world!\12"
AT&T syntax (x64):
// No "main" used
// compile with `gcc -nostdlib`
#define SYS_WRITE $1
#define STDOUT $1
#define SYS_EXIT $60
#define MSGLEN $14
.global _start
.text
_start:
movq $message, %rsi // char *
movq SYS_WRITE, %rax
movq STDOUT, %rdi
movq MSGLEN, %rdx
syscall // sys_write(message, stdout, 0x14);
movq SYS_EXIT, %rax
xorq %rdi, %rdi // The exit code.
syscall // exit(0)
.data
message: .ascii "Hello, world!\n"
XBasic[edit]
PROGRAM "hello"
VERSION "0.0003"
DECLARE FUNCTION Entry()
FUNCTION Entry()
PRINT "Hello World"
END FUNCTION
END PROGRAM
xEec[edit]
h#10 h$! h$d h$l h$r h$o h$w h#32
h$o h$l h$l h$e h$H >o o$ p jno
XL[edit]
use XL.UI.CONSOLE
WriteLn "Hello world!"
XLISP[edit]
(DISPLAY "Hello world!")
(NEWLINE)
XPL0[edit]
code Text=12;
Text(0, "Hello world!
")
XSLT[edit]
<xsl:text>Hello world!
</xsl:text>
Yorick[edit]
write, "Hello world!"
Z80 Assembly[edit]
Using the Amstrad CPC firmware:
org $4000
txt_output: equ $bb5a
push hl
ld hl,world
print: ld a,(hl)
cp 0
jr z,end
call txt_output
inc hl
jr print
end: pop hl
ret
world: defm "Hello world!\r\n\0"
zkl[edit]
println("Hello world!");
Zoea[edit]
program: hello_world
output: "Hello world!"
Zoomscript[edit]
For typing:
print "Hello world!"
For importing:
¶0¶print "Hello world!"
ZX Spectrum Basic[edit]
10 PRINT "Hello world!"
- Programming Tasks
- Basic language learning
- Selection/Short Circuit/Console Program Basics
- Simple
- 0815
- 11l
- 360 Assembly
- 4DOS Batch
- 6502 Assembly
- 6800 Assembly
- 8080 Assembly
- 8086 Assembly
- 8th
- AArch64 Assembly
- ABAP
- ACL2
- ActionScript
- Ada
- Agena
- Aime
- Algae
- ALGOL 60
- ALGOL 68
- ALGOL W
- ALGOL-M
- Alore
- AmbientTalk
- AmigaE
- AntLang
- Anyways
- APL
- AppleScript
- Applesoft BASIC
- Apricot
- Arc
- Arendelle
- Argile
- ARM Assembly
- ArnoldC
- Arturo
- AsciiDots
- Astro
- Asymptote
- ATS
- AutoHotkey
- AutoIt
- AutoLISP
- Avail
- AWK
- Axe
- B
- B4X
- Babel
- Bash
- BASIC
- BaCon
- Basic Casio
- BASIC256
- Batch File
- Battlestar
- BBC BASIC
- Bc
- BCPL
- Beeswax
- Befunge
- Bird
- Blast
- Blz
- BML
- Boo
- BootBASIC
- Brace
- Bracmat
- Brainf***
- Brat
- Brlcad
- Burlesque
- C
- C sharp
- C++
- C++/CLI
- C1R
- C2
- Cat
- Cduce
- Chapel
- Chef
- ChucK
- Cind
- Clay
- Clean
- Clio
- Clipper
- CLIPS
- Clojure
- CMake
- COBOL
- Cobra
- CoffeeScript
- ColdFusion
- Comal
- Comefrom0x10
- Commodore BASIC
- Common Lisp
- Component Pascal
- Corescript
- Cowgol
- Crack
- Creative Basic
- Crystal
- D
- Dafny
- Dao
- Dart
- DataWeave
- Dc
- DCL
- DDNC
- Delphi
- DeviousYarn
- DIBOL-11
- DIV Games Studio
- DM
- Dragon
- DWScript
- Dyalect
- Dylan
- Dylan.NET
- Déjà Vu
- E
- EasyLang
- EC
- EchoLisp
- ECL
- EDSAC order code
- Efene
- Egel
- Egison
- EGL
- Eiffel
- WikipediaSourced
- Ela
- ElastiC
- Elena
- Elisa
- Elixir
- Elm
- Emacs Lisp
- Emojicode
- Erlang
- ERRE
- Euler Math Toolbox
- Extended BrainF***
- Ezhil
- F Sharp
- Factor
- Falcon
- FALSE
- Fantom
- Ferite
- Fexl
- Fish
- FOCAL
- Forth
- Fortran
- Fortress
- FreeBASIC
- Frege
- Friendly interactive shell
- Frink
- FunL
- Furor
- FUZE BASIC
- Gambas
- GAP
- GB BASIC
- Gecho
- Gema
- Genie
- Gentee
- GFA Basic
- GLBasic
- Glee
- Global Script
- GlovePIE
- GML
- Go
- Golfscript
- Gosu
- Groovy
- GW-BASIC
- Hack
- Halon
- Harbour
- Haskell
- Haxe
- Hexiscript
- HicEst
- HLA
- HolyC
- Hoon
- HPPPL
- HQ9+
- HQ9+ examples needing attention
- Examples needing attention
- Huginn
- Hy
- I
- Icon
- Unicon
- IDL
- Inform 6
- Inko
- Integer BASIC
- Io
- Ioke
- IS-BASIC
- Isabelle
- IWBASIC
- J
- Jack
- Jacquard Loom
- Java
- JavaScript
- JCL
- Joy
- Jq
- Jsish
- Julia
- K
- Kabap
- Kaya
- Kdf9 Usercode
- Kdf9 examples needing attention
- Keg
- Kite
- Kitten
- KonsolScript
- Kotlin
- KQL
- Lambdatalk
- Lang5
- Langur
- Lasso
- LaTeX
- Latitude
- LC3 Assembly
- LDPL
- LFE
- Liberty BASIC
- LIL
- Lily
- Lilypond
- Limbo
- Lingo
- Lisaac
- Little
- LiveCode
- LLVM
- Lobster
- Logo
- Logtalk
- LOLCODE
- LotusScript
- LSE
- LSE64
- Lua
- Luna
- M2000 Interpreter
- M4
- Maclisp
- MAD
- Make
- Malbolge
- MANOOL
- Maple
- Mathcad
- Mathematica
- Wolfram Language
- MATLAB
- Maude
- Maxima
- MAXScript
- MDL
- MelonBasic
- Mercury
- Metafont
- Min
- MiniScript
- MiniZinc
- MIPS Assembly
- MIRC Scripting Language
- ML/I
- Modula-2
- Modula-3
- MontiLang
- Morfa
- Mosaic
- MUF
- MUMPS
- MyDef
- MyrtleScript
- MySQL
- Mythryl
- N/t/roff
- Nanoquery
- Neat
- Neko
- Nemerle
- NetRexx
- Never
- NewLISP
- Nickle
- Nim
- Nit
- NS-HUBASIC
- Nyquist
- Nyquist Version 3.15
- Oberon-2
- Objeck
- Objective-C
- OCaml
- Occam
- Octave
- Oforth
- Ol
- Onyx
- OOC
- OoRexx
- OpenLisp
- Openscad
- Oxygene
- Oz
- PARI/GP
- Pascal
- PASM
- PDP-1 Assembly
- PDP-11 Assembly
- PepsiScript
- Perl
- Pharo
- Phix
- PHL
- PHP
- PicoLisp
- Pict
- Pikachu
- Pike
- PILOT
- PIR
- Pixilang
- PL/I
- PL/M
- PL/SQL
- Plain English
- Plan
- Pony
- Pop11
- PostScript
- Potion
- PowerBASIC
- PowerShell
- Processing
- ProDOS
- Programming Language
- Prolog
- PSQL
- Pure
- PureBasic
- Python
- QB64
- Quackery
- Quill
- Quite BASIC
- R
- Ra
- Racket
- Raku
- Raven
- REALbasic
- REBOL
- RED
- Retro
- Relation
- REXX
- Ring
- Risc-V
- RTL/2
- Ruby
- Run BASIC
- Rust
- Salmon
- SAS
- SASL
- Sather
- Scala
- Console
- Scheme
- Scilab
- ScratchScript
- Sed
- Seed7
- Self
- SenseTalk
- Set lang
- SETL
- SETL4
- Shen
- Shiny
- Sidef
- SimpleCode
- SIMPOL
- Simula
- Sisal
- SkookumScript
- Slate
- Smalltalk
- Smart BASIC
- SmileBASIC
- SNOBOL4
- SNUSP
- SoneKing Assembly
- SPARC Assembly
- Sparkling
- SPL
- SQL
- SQL PL
- Standard ML
- Stata
- Suneido
- Swahili
- Swift
- Symsyn
- Tailspin
- Tcl
- Teco
- Tern
- Terra
- Terraform
- TestML
- TI-83 BASIC
- TI-89 BASIC
- Tiny BASIC
- TMG
- TorqueScript
- TPP
- Transact-SQL
- Transd
- TransFORTH
- Trith
- True BASIC
- TUSCRIPT
- Uniface
- Unison
- UNIX Shell
- C Shell
- Unlambda
- Ursa
- Ursala
- உயிர்/Uyir
- V
- Vala
- VAX Assembly
- VBScript
- Vedit macro language
- Verbexx
- VHDL
- Vim Script
- Visual Basic
- Microsoft.Scripting
- Visual Basic .NET
- Viua VM assembly
- Vlang
- Wart
- WDTE
- WebAssembly
- WASI
- Wee Basic
- Whenever
- Whiley
- Whitespace
- Wren
- X86 Assembly
- XBasic
- XEec
- XL
- XLISP
- XPL0
- XSLT
- Yorick
- Z80 Assembly
- Zkl
- VBA/Omit
- Zoea
- Zoomscript
- ZX Spectrum Basic