Hello, world! Programs are usually written to make the text “Hello, world!” appear on a computer screen. This is also a basic sanity check for an installation of a new programming language. The first Hello World program in C appeared in chapter 1.1 of the first edition of Kernighan & Ritchie’s original book about C, ‘The C Programming Language‘, in 1978. This is considered to be the first ever “Hello World!” program.
This is a complete list of “Hello World!” programs written in more than 300 existing programming languages including Assembly language, Low-level, High-level, Object Oriented, Document formats, Page description languages and Scripting languages.
List of the following 16 programming languages are added on December 19, 2017.
swift, go, chill, nomad (4GL), Hack, Ring, Crystal, Julia, Elixir, Red, Kotlin, Elm, Dart, Ceylon, Rust, Chapel
4DOS Batch
1 | @echo Hello, world |
4GL
1 | message "Hello, World!" with style = popup; |
4Test
1 2 3 | // Hello World in 4Test testcase printHelloWorld() print("Hello World!") |
A+
1 | []<-’Hello World!’ |
Abap – SAP AG
1 | WRITE 'Hello, World!'. |
ABC
1 | WRITE "Hello, world!" |
ActionScript
1 | trace("Hello, World!"); |
1 2 | this.createTextField("hello_txt",0,10,10,100,20); this.hello_txt.text="Hello, World!"; |
ActionScript 3
1 2 3 4 5 6 7 8 | package{ import flash.display.Sprite; public class HelloWorld extends Sprite{ public function HelloWorld(){ trace("Hello, world!"); } } } |
Ada
1 2 3 4 5 | with TEXT_IO; procedure HELLO is begin TEXT_IO.PUT_LINE ("Hello, World!"); end HELLO; |
Adobe Flex MXML
1 2 3 4 | <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Label text="Hello, world!"/> </mx:Application> |
Algol 60
1 2 3 4 | 'BEGIN' 'COMMENT' In Algol 60; OUTPUT(4,'(''('Hello World!')',/')') 'END |
Algol 68
1 2 3 | BEGIN print(("Hello, World!", newline)) END |
1 | ( print("Hello, World!") ) |
Alma-0
1 | Hello, World! |
AmigaE
1 2 3 | PROC main() WriteF('Hello, World!'); ENDPROC |
AMX NetLinx
1 2 3 | program_name = 'Hello' define_start send_string 0,'Hello World!' |
Apl
1 | 'Hello, World!' |
AppleScript
1 | return "Hello, World!" |
1 | -- "Hello World!" |
1 | display dialog "Hello World!" buttons {"OK"} default button 1 |
Ascii
1 | 48 65 6C 6C 6F 2C 20 77 6F 72 6C 64 21 0D 0A |
Asp
1 2 3 | <% Response.Write("Hello, World!") %> |
1 | <%="Hello, World!" %> |
Asp.Net
1 | Response.Write("Hello, World!") |
AspectJ
1 2 3 4 5 6 | public aspect HelloWorld{ pointcut mainCall() : call(public static void *.main(String[] args)); before() : mainCall(){ System.out.println( "Hello World!" ); } } |
Assembly Languages
Aassembler – 6502
1 2 3 4 5 6 7 | MSG: .ASCIIZ "Hello, World!" START: LDX #0 LOOP: LDA MSG,X ; load character JSR $FFD2 ; output to current output device INX BNE @LOOP RTS |
Assembler – Intel x86, Dos, Tasm
1 2 3 | MODEL SMALL IDEAL STACK 100H |
1 2 | DATASEG MSG DB 'Hello, World!', 13, ' |
1 2 3 4 5 6 7 8 9 10 | CODESEG Start: MOV AX, @data MOV DS, AX MOV DX, OFFSET MSG MOV AH, 09H ; output ascii string INT 21H MOV AX, 4C00H INT 21H END Start |
Assembler – Intel x86, Linux
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | SECTION .data msg: db "Hello, World!\n" len equ $ - msg SECTION .text global start start: mov edx,len mov ecx,msg mov ebx,1 mov eax,4 int 0x80 mov ebx,0 mov eax,1 int 0x80 |
Assembler 68000:
1 2 3 4 5 6 7 8 | move.l #helloworld,-(A7) move #9,-(A7) trap #1 addq.l #6,A7 move #0,-(A7) trap #1 helloworld: dc.b "Hello World!",$0d,$0a,0 |
Assembler – General-purpose fictional computer: MIX, MIXAL
1 2 3 4 5 6 7 8 9 10 | General-purpose fictional computer: MIX, MIXAL TERM EQU 19 console device no. (19 = typewriter) ORIG 1000 start address START OUT MSG(TERM) output data at address MSG HLT halt execution MSG ALF "HELLO" ALF " WORL" ALF "D " END START end of program |
RISC processor: MIPS architecture
1 2 3 4 5 6 7 8 9 10 | .data msg: .asciiz "Hello, world!" .align 2 .text .globl main main: la $a0,msg li $v0,4 syscall jr $ra |
Arm, Risc OS:
1 2 3 4 5 6 7 8 | .program ADR R0,message SWI "OS_Write0" SWI "OS_Exit" .message DCS "Hello, World!" DCB 0 ALIGN |
1 | SWI"OS_WriteS":EQUS"Hello, World!":EQUB0:ALIGN:MOVPC,R14 |
AutoHotkey
1 | MsgBox, "Hello, World!" |
Autoit
1 | MsgBox(1,'','Hello, World!') |
Avenue – Scripting language for ArcView GIS
1 | MsgBox("Hello, World!","aTitle") |
AviSynth
1 2 | BlankClip() Subtitle("Hello, world!") |
Awk
1 2 3 | # Hello BEGIN { print "Hello, World!" } |
B
1 2 3 4 5 6 7 8 9 | /* Hello */ main() { extern a, b, c; putchar (a); putchar (b); putchar (c); putchar ('!*n'); } a 'hell' ; b 'o, w' ; c 'orld' ; |
Baan Tools
1 2 3 4 | function main() { message("Hello, world!") } |
Ball
1 | write Hello, *s world *n |
Bash or sh
1 | #!/bin/sh echo "Hello, World!" |
1 | printf 'Hello, world!\n' |
Basic
1 2 | 10 PRINT "Hello, World!" 20 END |
1 2 | PRINT "Hello, World!" ? "Hello, World!" |
1 2 | PRINT "Hello, World!" END |
BlitzBasic
1 2 | Print "Hello, world!" WaitKey |
DarkBasic
1 2 3 | PRINT "HELLO WORLD" TEXT 0,0,"Hello, World!" WAIT KEY |
Liberty BASIC
1 | print "Hello, world" |
1 2 3 4 5 6 | nomainwin open "Hello, world!" for graphics as #main print #main, "place 50 50" print #main, "\Hello, world!" print #main, "flush" wait |
PBasic
1 | DEBUG "Hello, World!", CR |
1 2 3 4 5 6 7 | DO HIGH 7 'Make the 7th pin go high (turn the LED on) PAUSE 500 'Sleep for half a second LOW 7 ' Make the 7th pin go low (turn the LED off) PAUSE 500 'Sleep for half a second LOOP END |
Basic – StarOffice/OpenOffice
1 2 3 | sub main print "Hello, World!" end sub |
TI-BASIC
1 2 3 4 | :hellowld() :Prgm :Disp "Hello, world!" :EndPrgm |
Visual Basic
1 2 3 | Sub Main() Print "Hello, World!" End Sub |
Visual Basic .Net
1 2 3 4 5 | Module HelloWorldApp Sub Main() System.Console.WriteLine("Hello, World!") End Sub End Module |
1 2 3 4 5 | Class HelloWorldApp Shared Sub Main() System.Console.WriteLine("Hello, World!") End Sub End Class |
bc
1 | "Hello, world!" |
1 | print "Hello, world!\n" |
Bcpl
1 2 3 4 5 6 | // Hello GET "LIBHDR" LET START () BE $( WRITES ("Hello, World!*N") $) |
Beta
1 2 3 4 5 | { *** Hello ***} (# do 'Hello World!'->putLine #) |
BITGGAL AgileDog
1 2 3 | T 1 "Hellow, World" 0 |
BITGGAL Jihwaja
1 | J( 1 TM 5 ZV 3 "Hellow, world" ) |
Bliss
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | %TITLE 'HELLO_WORLD' MODULE HELLO_WORLD (IDENT='V1.0', MAIN=HELLO_WORLD, ADDRESSING_MODE (EXTERNAL=GENERAL)) = BEGIN LIBRARY 'SYS$LIBRARY:STARLET'; EXTERNAL ROUTINE LIB$PUT_OUTPUT; GLOBAL ROUTINE HELLO_WORLD = BEGIN LIB$PUT_OUTPUT(%ASCID %STRING('Hello, World!')) END; END ELUDOM |
Boo
1 | print "Hello, World!" |
Burning Sand 2
1 | WRITE ELEMENT:Earth 210 230 40 CENTER TEXT "Hello World!" |
C
1 2 3 4 5 | #include <stdio.h> int main(void){ printf("Hello, world!\n"); return 0; } |
C#
1 2 3 4 5 6 | using System; class HelloWorld{ static void Main(){ System.Console.WriteLine("Hello, World!"); } } |
C++ (ISO)
1 2 3 4 5 | #include <iostream> int main(){ std::cout << "Hello, World!\n"; } |
C++ / Cli
1 2 3 | int main(){ System::Console::WriteLine("Hello, World!"); } |
C++ Managed (.Net)
1 2 3 4 5 6 | #using <mscorlib.dll> using namespace System; int wmain(){ Console::WriteLine("Hello, World!"); } |
C#
1 2 3 4 5 | class HelloWorldApp{ static void Main(){ System.Console.WriteLine("Hello, world!"); } } |
Caché Server Pages (CSP)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Class Test.Hello Extends %CSP.Page [ ProcedureBlock ] { ClassMethod OnPage() As %Status { &html<<html> <head> </head> <body>> Write "Hello, world!",! &html<</body> </html>> Quit $$OK } } |
Caml light
1 2 3 4 5 | (* Hello World *) let hello = print_string "Hello World!"; ;; |
CCL
1 | call echo("Hello, world!") |
Ceylon
1 2 3 | shared void run() { print("Hello, World!"); } |
Ch
1 | printf("Hello, world!\n"); |
Chapel
1 | writeln("Hello, world!"); |
CHILL
1 2 3 4 5 6 | Hello: MODULE WRITETEXT(STDOUT, "Hello World!%/"); END Hello; |
Chuck
1 | <<<"Hello World">>> |
Chrome
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | namespace HelloWorld; interface type HelloClass = class public class method Main; end; implementation class method HelloClass.Main; begin System.Console.WriteLine('Hello, world!'); end; end. |
Cil
1 2 3 4 5 6 7 | .method public static void Main() cil managed{ .entrypoint .maxstack 8 ldstr "Hello, World!" call void [mscorlib]System.Console::WriteLine(string) ret } |
Clarion
1 2 3 4 5 6 | PROGRAM MAP END CODE MESSAGE('Hello, world!!','Clarion') RETURN |
Clean
1 2 3 | module hello Start = "Hello, World!" |
Clist
1 2 | PROC 0 WRITE Hello, World! |
Clipper
1 | ? "Hello, World!" |
Clu
1 2 3 4 | start_up = proc () po: stream := stream$primary_output () stream$putl (po, "Hello, World!") end start_up |
Cobol
1 2 3 4 5 6 7 8 9 10 | IDENTIFICATION DIVISION. PROGRAM-ID. HELLO-WORLD. ENVIRONMENT DIVISION. DATA DIVISION. PROCEDURE DIVISION. DISPLAY "Hello, World!". STOP RUN. |
Cocoa or GnuStep (Objective C)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #import <Cocoa/Cocoa.h> @interface hello : NSObject { } @end @implementation hello -(void)awakeFromNib { NSRunAlertPanel(@"Message from your Computer", @"Hello, World!", @"Hi!", nil, nil); } @end |
ColdFusion
1 | <cfoutput>Hello, World!</cfoutput> |
Comal
1 | PRINT "Hello, World!" |
ConTeXt
1 2 3 | \starttext Hello, world! \stoptext |
Crystal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | puts "Hello World!" #Object Oriented Style class Greeter def initialize(@name : String) end def salute puts "Hello #{@name}!" end end g = Greeter.new("world") g.salute |
Curl
1 2 3 4 | {curl 3.0, 4.0 applet} {curl-file-attributes character-encoding = "utf-8"} Hello, World! |
D
1 2 3 4 5 | import std.stdio ; void main () { writef("Hello, World!"); } |
D++
1 2 3 4 | function main() { screenput "Hello, World!"; } |
Dart
1 2 3 | main() { print('Hello World!'); } |
Dataflex
1 2 3 4 5 | /tela Hello world /* clearscreen page tela |
dBase
1 2 | * Hello World in dBase IV ? "Hello World!" |
DC an arbitrary precision calculator
1 | [Hello, world!]p |
Dcl batch
1 | $ write sys$output "Hello, World!" |
DIV
1 2 3 4 5 6 7 | PROGRAM hello; BEGIN write(0, 0, 0, 0, "Hello, world!"); LOOP FRAME; END END |
Delphi, Kylix
1 2 3 4 5 6 7 8 | program Hello_World; uses Windows; begin ShowMessage("Hello, World!"); end. |
Doll
1 2 3 4 5 | this::operator() { import system.cstdio; puts("Hello, World!"); } |
Dream Maker
1 2 3 4 | mob Login() ..() world << "Hello, world!" |
Dylan
1 2 | module: hello format-out("Hello, world!\n"); |
EAS 0.0.1.*
1 2 3 | set disp to "Hello, world!" set dispto to item unit 5 //5 = default screen release disp into dispto. |
1 2 | import system ea.helloworld wait |
Ed and Ex (Ed extended)
1 2 3 4 | a hello World! . p |
Eiffel
1 2 3 4 5 6 7 8 | class HELLO_WORLD create make feature make is do io.put_string("Hello, world!%N") end -- make end -- class HELLO_WORLD |
Elan
1 2 | (* Elan *) putline ("Hello World!"); |
Elixir
1 | iex> IO.puts "Hello World!" |
Elm
1 2 | main = text "Hello" |
Erlang
1 2 3 4 | -module(hello). -export([hello_world/0]). hello_world() -> io:fwrite("Hello, World!\n"). |
Euphoria
1 | puts(1, "Hello, World!") |
F#
1 | print_endline "Hello, World!" |
1 | printfn "Hello, world! |
Factor
1 | "Hello, World!" print |
Ferite
1 2 | uses "console"; Console.println("Hello, world!"); |
filePro
1 2 | @once: mesgbox "Hello, world!" ; exit |
Fjölnir
1 2 3 4 5 6 7 8 9 10 11 | "halló" < main { main -> stef(;) stofn skrifastreng(;"Halló, veröld!"), stofnlok } * "GRUNNUR" ; |
Focal
1 | type "Hello, World!",! |
1 | t "Hello, world!",! |
Focus
1 | -TYPE Hello world |
Forte TOOL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | begin TOOL HelloWorld; includes Framework; HAS PROPERTY IsLibrary = FALSE; forward Hello; -- START CLASS DEFINITIONS class Hello inherits from Framework.Object has public method Init; has property shared=(allow=off, override=on); transactional=(allow=off, override=on); monitored=(allow=off, override=on); distributed=(allow=off, override=on); end class; -- END CLASS DEFINITIONS -- START METHOD DEFINITIONS ------------------------------------------------------------ method Hello.Init begin super.Init(); task.Part.LogMgr.PutLine('Hello, world!'); end method; -- END METHOD DEFINITIONS HAS PROPERTY CompatibilityLevel = 0; ProjectType = APPLICATION; Restricted = FALSE; MultiThreaded = TRUE; Internal = FALSE; LibraryName = 'hellowor'; StartingMethod = (class = Hello, method = Init); end HelloWorld; |
Forth
1 2 | : HELLO ( -- ) ." Hello, World!" CR ; HELLO |
1 | CR ." Hello, world!" CR |
Fortran
1 2 3 | PROGRAM HELLO PRINT *, 'Hello, World!' END |
FreeBasic
1 2 3 | PRINT "Hello World" SLEEP END |
Fril
1 | ?((pp "Hello, World!")) |
Frink
1 | println["Hello, World!"] |
Gambas
1 2 3 | PUBLIC SUB Main() Print "Hello, World!" END |
1 2 3 | PUBLIC SUB Main() Message.Info("Hello, World!") END |
Game Maker
1 | draw_text(x,y,"Hello, world!") |
1 | show_message("Hello, world!") |
GEMBase 4GL
1 2 3 4 5 | procedure_form hello begin_block world print "Hello, world!" end_block end_form |
Go Language
1 2 3 4 5 6 7 | package main import "fmt" func main() { fmt.Println("Hello World") } |
GraalScript 1
1 2 3 | if (created){ echo Hello, world!; } |
GraalScript 2
1 2 3 | function onCreated() { echo("Hello, world!"); } |
Groovy
1 | println "Hello, world!" |
Gtk+ in C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #include <iostream> #include <gtkmm/main.h> #include <gtkmm/button.h> #include <gtkmm/window.h> using namespace std; class HelloWorld : public Gtk::Window { public: HelloWorld(); virtual ~HelloWorld(); protected: Gtk::Button m_button; virtual void on_button_clicked(); }; HelloWorld::HelloWorld() : m_button("Hello, World!") { set_border_width(10); m_button.signal_clicked().connect(SigC::slot(*this, &HelloWorld::on_button_clicked)); add(m_button); m_button.show(); } HelloWorld::~HelloWorld() {} void HelloWorld::on_button_clicked() { cout << "Hello, World!" << endl; } int main (int argc, char *argv[]) { Gtk::Main kit(argc, argv); HelloWorld helloworld; Gtk::Main::run(helloworld); return 0; } |
Gtk# in C#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | using Gtk; using GtkSharp; using System; class Hello { static void Main() { Application.Init (); Window window = new Window(""); window.DeleteEvent += cls_evn; Button close = new Button ("Hello world"); close.Clicked += new EventHandler(cls_evn); window.Add(close); window.ShowAll(); Application.Run (); } static void cls_evn(object obj, EventArgs args) { Application.Quit(); } } |
Haskell
1 | main = putStrLn "Hello, world!" |
1 2 3 | module Main (main) where main = putStrLn "Hello, World!" |
Hack
1 2 | <?hh echo 'Hello World'; |
haXe
1 2 3 4 5 6 7 | class HelloWorldApp { static function main() { trace("Hello, world!"); } } |
Heron
1 2 3 4 5 6 7 | program HelloWorld; functions { _main() { print_string("Hello, world!"); } } end |
HLA (High Level Assembly)
1 2 3 4 5 6 7 | program helloWorld; #include("stdlib.hhf") #begin helloWorld; stdout.put( "Hello World" nl ); end helloWorld; |
HP 33s
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | LBL H SF 10 EQN RCL H RCL E RCL L RCL L RCL O R/S RCL W RCL O RCL R RCL L RDL D ENTER R/S |
HP-41, HP-42S
1 2 3 | 01 LBLTHELLO 02 THELLO, WORLD 03 PROMPT |
Html
1 2 3 4 5 | <html> <body> Hello, World! </body> </html> |
HTML 4.01 Strict
1 2 3 4 5 6 7 8 9 10 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Hello, World!</title> </head> <body> <p>Hello, World!</p> </body> </html> |
HyperTalk
1 | put "Hello, World!" |
1 | Answer "Hello, World!" |
Icon
1 2 3 4 | # In Icon rocedure main() write("Hello world") end |
IDL
1 | print,"Hello World!" |
Inform 5/6
1 2 3 | [ Main; "Hello, World!"; ]; |
Inform 7
1 | Hello World is a room. The printed name is "Hello, world!" |
Intercal
1 2 | IN INTERCAL HELLO WORLD |
Io
1 | "Hello, world!" println |
1 | writeln("Hello, world!") |
Iptscrae
1 2 3 | ON ENTER { "Hello, " "World!" & SAY } |
J
1 | 'Hello world' |
1 | 'Hello, world!' NB. echoes the string in interactive mode, doesn't work in script |
1 | 'Hello World!' 1!:2(2) NB. prints it to (2) - screen, (4) - stdout |
Jal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | include 16f877_20 include hd447804 hd44780_clear hd44780 = "H" hd44780 = "e" hd44780 = "l" hd44780 = "l" hd44780 = "o" hd44780 = " " hd44780 = "W" hd44780 = "o" hd44780 = "r" hd44780 = "l" hd44780 = "d" hd44780 = "!" |
Java
1 2 3 4 5 6 7 | public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, world!"); } } |
Java byte-code
1 2 3 4 5 6 7 8 9 10 11 12 | public class HelloWorld extends java.lang.Object{ public HelloWorld(); Code: 0: aload_0 1: invokespecial #1; //Method java/lang/Object."<init>":()V 4: return public static void main(java.lang.String[]); Code: 0: getstatic #2; //Field java/lang/System.out:Ljava/io/PrintStream; 3: ldc #3; //String Hello, world! 5: invokevirtual #4; //Method java/io/PrintStream.println:(Ljava/lang/String;)V 8: return } |
JavaFX
1 2 3 4 5 6 7 8 | Frame { title: "Hello World JavaFX" width: 200 content: Label { text: "Hello World" } visible: true } |
1 2 3 4 5 6 7 | var win = new Frame(); win.title = "Hello World JavaFX"; win.width = 200; var label = new Label(); label.text = "Hello World"; win.content = label; win.visible = true; |
1 2 | import java.lang.System; System.out.println("Hello World"); |
1 | println("Hello World"); |
Java Swing
1 2 3 4 5 6 7 8 9 | import javax.swing.JOptionPane; public class Hello { public static void main(String[] args) { JOptionPane.showMessageDialog(null, "Hello, World!"); } } |
Java SWT
1 2 3 4 5 | import org.eclipse.swt.SWT; import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Label; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | public class SWTHello { public static void main (String [] args) { Display display = new Display (); final Shell shell = new Shell(display); RowLayout layout = new RowLayout(); layout.justify = true; layout.pack = true; shell.setLayout(layout); shell.setText("Hello, World!"); Label label = new Label(shell, SWT.CENTER); label.setText("Hello, World!"); shell.pack(); shell.open (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); } } |
Java applet
1 2 3 4 5 6 7 8 9 10 11 12 13 | <HTML> <HEAD> <TITLE>Hello world</TITLE> </HEAD> <BODY> HelloWorld Program says: <APPLET CODE="HelloWorld.class" WIDTH=600 HEIGHT=100> </APPLET> </BODY> </HTML> |
1 2 3 4 5 6 7 8 | import java.applet.*; import java.awt.*; public class HelloWorld extends Applet { public void paint(Graphics g) { g.drawString("Hello, World!", 100, 50); } } |
JavaScript
1 | document.writeln('Hello, World!'); |
1 | alert('Hello, world!'); |
1 | print('Hello, world!'); |
1 | WScript.Echo('Hello, world!'); |
1 | <a href="#" onclick="helloWorld(); return false;">Hello World Example</a> |
1 | <a href="#" onclick="alert('Hello, World!'); return false;">Hello World Example</a> |
JSP
1 | <% out.println("Hello, world!"); %> |
1 | Hello, world! |
Joy
1 | "Hello, world!\n" putchars . |
Julia
1 | julia> println("Hello world!") |
K
1 | `0:"Hello world\n" |
Kogut
1 | WriteLine "Hello, World!" |
Kotlin
1 2 3 4 | fun main(args: Array<String>) { val scope = "world" println("Hello, $scope!") } |
KPL (Kids Programming Language)
1 2 3 4 5 6 | Program HelloWorld Method Main() ShowConsole() ConsoleWriteLine("Hello, world!") End Method End Program |
Lasso
1 | Output: 'Hello, world!'; |
1 | Output('Hello, world!'); |
1 | 'Hello, world!'; |
LaTeX
1 2 3 4 | \documentclass{article} \begin{document} Hello, World! \end{document} |
Lexico Mobile (in spanish)
1 | tarea muestre "Hola mundo !" |
1 2 3 4 | clase Saludo derivada_de Form publicos mensajes Saludo copie "Hola mundo !" en saludo.Text |
Limbo
1 2 3 4 5 6 7 8 9 10 | 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"); } |
Linden Scripting Language
1 2 3 4 5 6 7 | default { state_entry() { llSetText("Hello, World!" , <0,0,0> , 1.0); } } |
Lingo (Macromedia Director scripting language)
1 2 3 | on exitFrame me put "Hello, world!" end |
Linotte
1 2 3 4 | Livre : HelloWorld Paragraphe : Affichage Actions : "Hello, World !" ! |
Lisaac
1 2 3 4 5 6 7 8 9 10 | section HEADER + name := HELLO_WORLD; - category := MACRO; section INHERIT - parent_object:OBJECT := OBJECT; section PUBLIC - make <- ( "Hello World !\n".print; ); |
Lisp
Common Lisp
1 | (format t "Hello World!~%") |
1 | (write-line "Hello World!") |
1 | "Hello World!" |
Scheme
1 | (display "Hello, World!") |
Emacs Lisp
1 | (print "Hello, World!") |
AutoLisp
1 | (print "Hello, World!") |
XLisp
1 | (print "Hello, World!") |
Arc
1 | (prn "Hello, world!") |
Logo
1 | print [Hello World!] |
1 | pr [Hello World!] |
1 | messagebox [Hi] [Hello, world! |
LPC
1 2 3 4 | void create() { write("Hello, world!\n"); } |
Lua
1 | print "Hello, World!" |
LuaPSP
1 2 | screen:print(1,1,"Hello, world!") screen:flip() |
M (MUMPS)
1 | W "Hello, world!" |
M4
1 | Hello, World! |
Macsyma, Maxima
1 | print("Hello, World!")$ |
Maple
1 | >> print("Hello, World!"); |
Mathematica
1 2 | (* Hello World in Mathematica *) Print["Hello world"] |
1 | "Hello, world!" |
Matlab
1 | disp('Hello world') |
1 | fprintf('Hello, world!') |
Maude
1 2 3 4 5 6 | fmod HELLOWORLD is protecting STRING . op helloworld : -> String . eq helloworld = "Hello, World." . endfm red helloworld . |
Max
1 2 3 4 5 6 7 8 | max v2; #N vpatcher 10 59 610 459; #P message 33 93 63 196617 Hello World!; #P newex 33 73 45 196617 loadbang; #P newex 33 111 31 196617 print; #P connect 1 0 2 0; #P connect 2 0 0 0; #P pop; |
Maya Embedded Language
1 | print( "Hello, world!\n" ); |
Microsoft Foundation Classes (in C++)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #include <afx.h> #include <afxwin.h> class CHelloWin : public CWnd { protected: DECLARE_MESSAGE_MAP() afx_msg void OnPaint(void) { CPaintDC dc(this); dc.TextOut(15, 3, TEXT("Hello, world!"), 13); } }; BEGIN_MESSAGE_MAP(CHelloWin, CWnd) ON_WM_PAINT() END_MESSAGE_MAP() class CHelloApp : public CWinApp { virtual BOOL InitInstance(); }; CHelloApp theApp; LPCTSTR wndClass; BOOL CHelloApp::InitInstance() { CWinApp::InitInstance(); CHelloWin* hello = new CHelloWin(); m_pMainWnd = hello; wndClass = AfxRegisterWndClass(CS_VREDRAW | CS_HREDRAW, 0, (HBRUSH)::GetStockObject(WHITE_BRUSH), 0); hello->CreateEx(0, wndClass, TEXT("Hello MFC"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 120, 50, NULL, NULL); hello->ShowWindow(SW_SHOW); hello->UpdateWindow(); return TRUE; } |
mIrc Script
1 | echo Hello World |
Model 204
1 2 3 | BEGIN PRINT 'Hello, World!' END |
Modula-2
1 2 3 4 5 6 7 8 | MODULE Hello; FROM InOut IMPORT WriteLn, WriteString; BEGIN WriteString ("Hello, World!"); WriteLn END Hello. |
Moo
1 | notify(player, "Hello, World!"); |
Mouse
1 | "Hello, World!" $ |
Ms-Dos batch
1 | @echo Hello, World! |