There are very nice collections of 200+ HelloWorld in a lot of ProgrammingLanguage''''''s at http://www.latech.edu/~acm/HelloWorld.shtml. A big collection of 440+ Hello World programs can be found here: http://helloworldcollection.de See also: ProgrammingChrestomathy, ArraySumInManyProgrammingLanguages, CounterInManyProgrammingLanguages, DotProductInManyProgrammingLanguages, WardNumberInManyProgrammingLanguages, HexDumpInManyProgrammingLanguages, NinetyNineBottlesOfBeerOnTheWall, QuineProgram, and TrainSpotting If you are confused about whether or not your selected language is a programming language take this easy test to determine it: if it is possible to modify the program to print the greeting ten times without duplicating code, then it most likely is a programming language. '''ConvertSpacesToTabsNotForCode''' ---- An apparently reasonable attempt was made to edit this page on August 6th, 2013, to presumably present a new Algol 60 example, but some of the existing content was damaged in the process. I lack the patience to sort out the mess, so I reverted the edit but made some effort to retain the (corrected?) Algol 60 example. I removed the commentary that related to the old (convoluted, and probably erroneous) example. ---- '''ActionScript''' trace('hello world'); ---- '''actsl''' from http://compilers.iecc.com/comparch/article/07-10-055 int nul fun main "Hello World!\n" arg call printf ref nul = 0 return endfun ---- '''AdaLanguage:''' procedure HELLO_WARD is begin What about Tandy TRS 80 (Level 1) with 4k Ram 1 p. "Hello World" 2 End PUT ("Hello, Ward"); end HELLO_WARD; Is a variation on the version offered in ''Understanding Ada'' by Ken Shumate. ---- '''AlephLanguage''': * Direct way(s) (either on a file ''hello.als'' or at the interpreter prompt): println "Hello World!" trans a "Hello World!" a * A bit more involved (let functions be!): trans hello nil { println "Hello World!" } hello * Even more (OO to the mêlée): const Hello (class) trans Hello:greet nil { String "Hello World!" } const nice-user (Hello) trans nice-user:hello nil { println (this:greet) } nice-user:hello It is nice :-) -- DavidDeLis ---- '''Algol-60''' begin file rmt (kind = remote); write(rmt, <"Hello World!">); end. ---- '''AmigaE (AmigaEe):''' PROC main() PrintF('Hello world\n') ENDPROC ''But if you want to use some OOP for more interest:'' PROC main() HANDLE DEF message=NIL:PTR TO printMessage ->object to be allocated NEW message.new('Hello world\n') message.print() EXCEPT DO END message IF exception PrintF('Exception raised: \s.\n', IF exceptioninfo THEN exceptioninfo ELSE 'Unknown') ENDIF ENDPROC OBJECT printMessage PRIVATE message:PTR TO CHAR ->message to be printed ENDOBJECT /* This is the constructor */ PROC new(message:PTR TO CHAR) OF printMessage self.message := message ENDPROC /* This is a normal method */ PROC print(addNewLine=FALSE) OF printMessage IF addNewLine = FALSE PrintF(self.message) ELSE PrintF('\s\n', self.message) ENDIF ENDPROC ''Please note that AmigaE is case-sensitive, that keywords must be uppercase, and that user-defined names must at-least start with a lower-case letter.'' ---- '''APL (AplLanguage)''' 'Hello World' ---- '''AppleScript''' on helloWorld() display dialog "Hello World!" buttons {"OK"} end helloWorld helloWorld() ---- '''AssemblyLanguage for the IBM-PC (i386):''' dosseg .model small .stack 100h .data hello_message db 'Hello, World!',0dh,0ah,'$' .code main proc mov ax,@data mov ds,ax mov ah,9 mov dx,offset hello_message int 21h mov ax,4C00h int 21h main endp end main But nowadays, we do it in protected mode in Linux. .text .global _start _start: mov $4, %eax /* write system call */ mov $1, %ebx /* stdout */ mov $msg, %ecx mov $msgend-msg, %edx int $0x80 mov $1, %eax /* _exit system call */ mov $0, %ebx /* EXIT_SUCCESS */ int $0x80 .data msg: .ascii "Hello, world\n" msgend: ''(Very nice, but gas/gcc format should be:'' .global main main: ''I have just checked it.. otherwise, it's cool, my assembler days are long gone...)'' Nope. That is if you want to use the libc and use the C startup code. The above program, however, does not require any C library code to be linked; it calls directly to the kernel through the interrupt 0x80 interface. ---- '''Autoit 3''' Msgbox(0,"Hello!!","Hello,World !!") Or ConsoleWrite("Hello, World !!!") ---- IBM 360/370/390 BAL (Basic Assembler Language) // EXEC ASSEMBLY START MAIN BALR 2,0 USING *,2 OPEN PRINT MVC BUF,HW PUT PRINT CLOSE PRINT EOJ HW DC CL132'HELLO WORLD' BUF DS CL132 PRINT DTFPR IOAREA1=BUF,DEVADDR=SYSLST,BLKSIZE=132, * DEVICE=3203,CONTROL=YES,PRINTOV=YES END MAIN /* // EXEC LNKEDT // EXEC /* /& (Ahhh... those were the days) ''Sorry, had to tweak it! Opcodes start in col. 10; operands in col. 16. These two rules aren't essential - an opcode can start as early as col. 2. Continuation character is in col. 72 (didn't bother spacing that far over). Continuations of statements on the next line start at col. 16. These last two rules ''are'' essential.'' ---- '''AwkLanguage:''' echo "" | awk 'BEGIN{print "Hello World"}' or echo "Hello World" | awk '{print $0}' '''GNU Awk:''' awk 'BEGIN{print "Hello World"}' ---- '''B (BeeLanguage)''': main( ) { putchar('hell'); putchar('o, w'); putchar('orld'); putchar('*n' ); } -- AdamBerger ---- '''BasicLanguage''' 10 PRINT "HELLO WORLD" (Obviously optional, but included 99.999% of the time...) 20 GOTO 10 RUN (AWAY, LAUGHING) Poor old Basic - everybody's forgotten you... 10 FORI=1to100000:NEXT 20 PRINT CHR$(7):GOTO20 ---- '''BefungeLanguage:''' 0".dlrow ,olleH">v ,: ^_@ ---- BlitzMax (http://www.blitzmax.com) Can be done in two variants Print "Hello World!" Or if you want it in a nice dialog box Notify "Hello World!" ---- '''Bourne Shell:''' #!/bin/sh echo hello, world ---- '''BrainLanguage''' (brain hello.brn): "Hello, world" println. -------- '''BrainfuckLanguage (an EsotericProgrammingLanguage):''': >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++. [-]>++++++++[<++++>-]<.>+++++++++++[<+++++>-]<. >++++++++[<+++>-]<.+++.------.--------.[-]>++++++++[<++++>-]<+. [-]++++++++++. >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++. [-]>++++++++[<++++>-]<.#>+++++++++++[<+++++>-]<. >++++++++[<+++>-]<.+++.------.--------.[-]>++++++++[<++++>-]<+. [-]++++++++++. -- DavidHooker ''shorter:'' ++++++++++[>+++++++>++++++++++>+++>+<<<<-] >++.>+.+++++++..+++.>++.<<+++++++++++++++. >.+++.------.--------.>+.>. ---- '''C (CeeLanguage)''' (according to KernighanAndRitchie): #include #include int main(void) { printf("Hello, world\n"); return EXIT_SUCCESS; } ---- Cerner Command Language (CCL) ;Example 1 call echo("Hello World!") go ;Example 2 drop program helloworld2 go create program helloworld2 call echo("Hello World!") end go ;Example 3 drop program helloworld3 go create program helloworld3 PAINT call TEXT(1,1, "Hello World!") end go ---- '''CsharpLanguage:''' class Hello { static void Main() { System.Console.Write("Hello World"); } } ---- '''C++ (CeePlusPlus)''' #include int main() { std::cout << "Hello, World."; } The code does not actually need the return 0; // an integer return value is expected. Thou shalt not remove this line! to be conformant - main will implicitly return 0 if no return value is given. See 3.6.1.5 (http://www.open-std.org/jtc1/sc22/open/n2356/basic.html#basic.start.main) -- ScottMcMurray ---- '''Cobol''' IDENTIFICATION DIVISION. PROGRAM-ID. Hello. ENVIRONMENT DIVISION. DATA DIVISION. PROCEDURE DIVISION. Display 'Hello, World'. STOP RUN. ---- '''ColdFusion''' Tag based: #hello# Script based: Write''''''Output("Hello World!"); Note that you don't need to assign a variable first. You can just type ''Hello World'' without any tags (if you don't care about "proper" HTML). ---- '''COM HelloWorld client:''' #define WIN32_LEAN_AND_MEAN #include #include #include #include #import "HelloSrv.tlb" void _tmain (int argc, TCHAR * argv[]) { if (S_OK == CoInitialize(NULL)) { try { HELLOSRVLib::IHelloWorld p(__uuidof(HELLOSRVLib::HelloWorld)); p->Hello(); } catch (const _com_error& Err) { cerr << Err.ErrorMessage() << endl; } CoUninitialize(); } else { cerr << "Error during OLE initialization" << endl; } } -- PhilipEskelin ---- '''RM COBOL:''' 000100 IDENTIFICATION DIVISION. 000200 PROGRAM-ID. HELLOWORLD. 000300 000400* 000500 ENVIRONMENT DIVISION. 000600 CONFIGURATION SECTION. 000700 SOURCE-COMPUTER. RM-COBOL. 000800 OBJECT-COMPUTER. RM-COBOL. 000900 001000 DATA DIVISION. 001100 FILE SECTION. 001200 100000 PROCEDURE DIVISION. 100100 100200 MAIN-LOGIC SECTION. 100300 BEGIN. 100400 DISPLAY " " LINE 1 POSITION 1 ERASE EOS. 100500 DISPLAY "Hello world!" LINE 15 POSITION 10. 100600 STOP RUN. 100700 MAIN-LOGIC-EXIT. 100800 EXIT. ---- '''CommonLisp:''' Interactively (at the ReadEvalPrintLoop): "Hello World!" If you're picky and you want a file you can "execute" which will write the sequence "Hello World!\n" on stdout: (write-line "Hello World!") ---- '''COW (an EsotericProgrammingLanguage):''' see: http://www.bigzaphod.org/cow/ MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO Moo MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO Moo MoO MoO MoO MoO MoO MoO MoO Moo Moo MoO MoO MoO Moo OOO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO Moo MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO Moo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo MOo Moo MOo MOo MOo MOo MOo MOo MOo MOo Moo MoO MoO MoO Moo MOo MOo MOo MOo MOo MOo Moo MOo MOo MOo MOo MOo MOo MOo MOo Moo OOO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO MoO Moo ''Is this code translated from the BrainfuckLanguage code given above? -- AnonymousDonor'' ---- D See: http://dlang.org/ import std.c.stdio; int main(char[][] args) { printf("Hello, World!\n"); return 0 } -- PaulRuane Also: import std.stdio; void main() { writeln("Hello, World!"); } ---- DeeCee [Hello, world!] p ---- Dodo http://dodo.sourceforge.net In the runnable dodo0 variant: println("Hello World!") -> exit() A proper dodo program would be: import console def Main: Main() { console!Stdout().Puts("Hello World!") }. ---- DOS (DiskOperatingSystem) command.com Shell Script: echo Hello World ''Mac users often confuse the operating system with the small sample shell that came with it.'' It was claimed that DOS did not qualify as a programming language, according to the test given at the top of the page. However, consider the following ''cmd.exe'' shell script: for /l %i in (1,1,10) do echo Hello World (at least under NT-like shells) ---- '''EiffelLanguage:''' '''class''' HELLO '''creation''' make '''feature''' make '''is''' '''do''' print ("Hello, World%N") '''end''' '''end''' ''-- class HELLO'' ---- '''EmacsLisp''' (defun hello-world () (interactive) (with-current-buffer (pop-to-buffer "*Hello!*") (insert "Hello World\n"))) ---- '''ErlangLanguage''': In file ''hello.erl'': -module(hello). -export([hello_world/0]). hello_world() -> io:fwrite("hello, world\n"). in ''erl'' (or ''esh'', or compiling it): > c(hello). > hello:hello_world(). ---- '''EtcLanguage''': ##X# ---- '''For non-programmers:''' These examples are mere toys! Don't forget the real thing, GNU HelloWorld at http://www.gnu.org/software/hello/ From the page: The GNU `hello' program produces a familiar, friendly greeting. It allows nonprogrammers to use a classic computer science tool which would otherwise be unavailable to them. Yes, this really is the classic program that prints "Hello, world!" when you run it. Unlike the elementary version often presented in books like K&R, GNU hello processes its argument list to modify its behavior, supports internationalization, and includes a mail reader. The primary purpose of this program is to demonstrate how to write other programs that do these things; it serves as a model for all of the GNU coding standards. ''This is an interesting corollary to the joke among Windows programmers that the last Windows program was written sometime in 1994; everything since then has been a modification of HELLO.C from Petzold. Sadly, I actually worked on a commercial product where that was the case.'' ---- '''Forte TOOL:''' task.part.logmgr.putline( 'Hello World ' ); -- DavidVydra ---- '''ForthLanguage:''' CR .( Hello, world!) ---- '''FortranLanguage''' -- this works both with f77 and f90 PROGRAM HELLOWORLD 10 FORMAT (1X,11HHELLO WORLD) WRITE(6,10) END ---- '''FrinkLanguage''' println["Hello World!"] ---- '''GoLanguage:''' package main import "fmt" func main() { fmt.Printf("Hello, World\n") } ---- '''GoogleplexianLanguage:''' obbs["Hello World!"]xx: ---- '''HaskellLanguage:''' main = do putStrLn "Hello, world." -- LoganHanks In file ''HelloWorld.hs'': module Main where main = putStrLn "Hello, World!\n" Then compile it or call it (eg. using hugs98: ''hugs HelloWorld.hs'' and at the prompt -> main) ---- '''HqNinePlusLanguage''' h ---- '''HtagLanguage''' Hello World executed as ''helloworld.htag'' if htag is properly associated with the interpreter, or as ''htag helloworld.htag'' if it isn't. Here if it's called as ''http://localhost/helloworld.htag'': Hello world Hello World This is also the reason why I created HtagLanguage, so I don't need unnecessary fluff. -- SvenNeumann ---- '''HTML''' not a programming language. ''That's not a sufficient reason to exclude it. Anyhow, ColdFusion is based around it, thus one can "print" just by stating the string:'' Hello World ''Hard to beat that.'' ---- '''Icon''' procedure main(args) write("Hello, World!"); end -- MichaelKnight ---- '''InformLanguage''' [ Main; print "Hello World!^"; ]; ---- '''IoLanguage''' "Hello World!" print ---- '''IokeLanguage''' "Hello World!" println ---- '''Jakarta Velocity''' (JakartaVelocity) import java.io.S''''''tringWriter; import org.apache.velocity.app.Velocity; import org.apache.velocity.V''''''elocityContext; public class H''''''elloWorld { public static void main(String args[]) throws Exception { Velocity.init(); V''''''elocityContext context = new V''''''elocityContext(); context.put("name", "World"); String s = "Hello $name!"; S''''''tringWriter w = new S''''''tringWriter(); Velocity.evaluate(context, w, "hello", s); System.out.println(w); } } -- DimitrisTzoumpas ---- '''JavaLanguage:''' public class Hello { public static void main(String []args) { System.out.println("Hello World"); } } '''Object oriented Java''' class Greeting { void greet(Named target) { System.out.println("Hello, " + target.getName() + "!"); } } interface Named { String getName(); } class World implements Named { String getName() { return "World"; } } class Main { public static void main( String[] args ) { Greeting greeting = new Greeting(); greeting.greet(new World()); } } '''Swing Java''' public class Hello { public static void main(String []args) { JOptionPane.showMessageDialog(null,"Hello, world!"); } } '''JavaApplet:''' import java.applet.*; import java.awt.*; public class Hello extends Applet { public void paint(Graphics g) { g.drawString("Hello World", 25, 50); } } ---- '''JavaScript:''' document.writeln("Hello, World"); -- Paul Gresham, 07NOV1999 Pop up: alert("Hello, World"); ''Note that none of these two examples are, strictly speaking, correct. They might however produce some results when being run from a specific host environment, and might even produce the intended result when this host environment happens to be a WebBrowser...'' ---- '''J (JayLanguage)''' 'Hello World' ---- '''JoyLanguage:''' "Hello World!" putln . -- ShaeErisson ---- '''K (KayLanguage)''': `0:"Hello World" ---- '''LatteLanguage (http://www.latte.org/):''' {\def \hello "Hello, World!"} {\head {\title \hello}} {\body \hello} -- IlmariKaronen ---- '''LISP:''' (DEFUN HELLO-WORLD () (PRINT (LIST 'HELLO 'WORLD))) ---- '''LingoScriptingLanguage''' put "Hello World" or: alert "Hello World" -- Welshy31 ---- '''Logo''' ''the turtle language'', still unbeaten in handling of sets, there is an interpreter here: http://www.cs.berkeley.edu/~bh/logo.html print [Hello World] -- michael ---- '''LolCode:''' HAI CAN HAS STDIO? VISIBLE "HAI WORLD!" KTHXBYE ---- '''Lotus Formula:''' @Prompt([Ok];"";"Hello World") ---- '''LotusScript:''' Sub Click(Source As Button) Print "Hello World" End Sub ---- '''LuaLanguage:''' print "Hello, World." ---- '''LxLanguage:''' import IO = LX.Text_IO procedure HELLO() is IO.WriteLn "Hello World" ---- '''ModulaTwo''' (* Classic Modula-2, aka PIM *) MODULE HelloWorld; FROM InOut IMPORT WriteString,WriteLn; BEGIN WriteString("Hello World!"); WriteLn; END HelloWorld. (* ISO Modula-2 *) MODULE HelloWorld; FROM STextIO IMPORT WriteString,WriteLn; BEGIN WriteString("Hello World!"); WriteLn; END HelloWorld. (* Modula-2 R10 *) MODULE HelloWorld; IMPORT PervasiveIO; BEGIN WRITE("HelloWorld!\n"); END HelloWorld. ---- '''ModulaThree''' MODULE Hello EXPORTS Main; IMPORT Stdio, Wr; BEGIN Wr.PutText(Stdio.stdout, "Hello World"); END Hello. Graphical version MODULE Hello EXPORTS Main; IMPORT Trestle, TextVBT; VAR v := TextVBT.New("Hello World"); BEGIN Trestle.Intall(v); Trestle.AwaitDelete(); END Hello. ---- '''Multiple languages:''' All such discussions are concluded by contemplating HelloPolyGlots. Cobol, Pascal, Fortran, C, PostScript, BourneShell, Assembly: All in one single source file! That makes my cheesy little effort (Perl and C) look, well cheesy. Here it is anyway. -- BruceIde #include #define sub int #define print(a) printf("%s", a) sub main() { print("Hello world\n"); } #ifdef _perl main(); #endif ---- '''NemerleLanguage:''' (http://www.nemerle.org) module Hello { Main(): void { Nemerle.IO.printf("Hello world\n"); } } ''or a graphical version, using Gtk#:'' using System; using Gtk; using Gtk''''''Sharp; module hello { Main(): void { Application.Init(); def button = Button("Hello World"); button.Clicked += (fun(_,_) { Console.Write''''''Line("Hello World") }); def window = Window("Helloworld"); window.Delete''''''Event += (fun(_,_) { Application.Quit() }); window.Add(button); window.Show''''''All(); Application.Run() } } ---- '''ObjectiveCee:''' #import @interface Greeter : NSObject { } - greet; @end @implementation Greeter - greet { NSLog(@"Hello, World!"); } @end int main(int argc, char *argv[]) { Greeter *gr = [Greeter new]; [gr greet]; [gr release]; return 0; } -- MartinHëer ---- '''OpalLanguage:''' FUN hello : denotation DEF hello == "Hello, World" Since Opal is a pure functional language there is no such side-effect as outputting something to stdout the only possibillity is to call this from the interpreter and so get the string as a result. (Ok, there is an output monad, but I'm not gonna touch that. :) ''The idea is to show a program which prints out "Hello, world!" to the standard output. If it is difficult or ugly in your language, then so be it. If you are ashamed, then remove it completely.'' ---- '''ObjectiveCaml:''' At the interactive prompt: print_string("Hello World!");; This is more correct (adds a newline and flushes the channel): print_endline "Hello, World!";; -- MarcoMaggesi ---- '''PascalLanguage:''' program HelloWorld; begin writeln('Hello World'); end. -- SavasAlparslan ---- '''PathLanguage:''' $\/\ /\ /\ /\ I wish Ward +++ ++ ++ ++ +++ ++ /++++\ ++ ++ /++++\ would fix the ++\++\++ + + ++ ++ + + ++ +++ +/+++/ ++ ++ + + ++ +++ ++ ++ ++ + + \/ \/\ /\+++ /\ /\ /++.+/ \ \ backslash /++++.+++++++++++++++++++++++++++ / \ bug! /\ - -# ++ . -. + / \++++\ /++++\ ++ /---\- -+ + /\ + + + + + +. - .- -> + +. + + + + +- - +- . +> + + + + +- - +- -. \.+/\++/ \++++/ + +\ /-.+/- -- \ / \.){eval;print $@;}" or perl -ne "eval; print $@;" or perl -de 1 # given appropriate CPAN bits, this has command-line editing and input the program directly: print "Hello, world" Hello, world # Perl's immediate response or even: sub hello { print "Hello, world" }; hello; # Call the subroutine we just defined Hello, world # Perl's immediate response ---- '''PerlInline:''' Perl subsumes all languages eventually... perl -e 'use Inline C=>q{void hw(){printf("Hello, world!\n");}};hw' perl -e 'use Inline Ruby=>q{def hw;puts "Hello, world!";end};hw' -- BrianIngerson ---- '''Perl "Obfuscation"''' (taken from http://www.perlmonks.net/index.pl?node_id=329174) package Earth;sub Greet{ %_=('Y','~');$_='$;=!(Middle Earth.age~~~ But you have to have short tags turned on in the ini file, otherwise: -- BrynJones Or just type "Hello, world!" in a file, and run php -f helloworld.php (doesn't have to pre-process plain old text, now does it?) -- Phil ---- '''Pike''' int main() { write("Hello World\n"); } ---- '''PlbLanguage (or Databus)''' DISPLAY "HELLO WORLD" STOP ---- '''PL/SQL''' BEGIN DBMS_OUTPUT.PUT_LINE('Frank and Beans'); END; ---- '''PostScript''' (Hello World) = or (only strings, to stdout) (Hello World\n) print or (to any file) (%stdout) (w) file (Hello World\n) writestring or (put on paper) /Times-Roman findfont 12 scalefont setfont 100 100 moveto (Hello World) show showpage ---- '''PowerScript''' (used in PowerSoft/Sybase PowerBuilder) global type main from application end type global main main on main.create appname = "main" end on event open;MessageBox ('', 'Hello World') end event ---- '''PowerShell''' "Hello World" ---- '''PrographLanguage:''' In this now-defunct, ''really'' visual dataflow OOP language, that was very cool and way ahead of its time, the program is: http://www.cuillin.demon.co.uk/nazz/trivia/hw/cpx_hello_win.gif (Note that in Prograph there was no "C code generation" or similar idiocy -- the compiler acted ''directly on this hierarchical hypergraph'' to create executable code. Alas for visionaries everywhere....) --BillTozier ''Highlighting one DISadvantage of a really visual dataflow language, the above image link is now broken, while the code for the plain old behind the times textual languages remains.'' ---- '''Prolog''': go :- writeln('Hello World'). -- TechnoKid ---- '''PythonLanguage:''' You copy the following text into a file and call the file (hello.py) (remember python is sensitive of it's indenting, which rocks :) ) print "hello world" Now invoke the interpreter and pass it your file with the single command: python hello.py ---- '''QBasic:''' ? "Hello, world!" The only language so far with Q? (See G entry) ... No I haven't forgotten you, dear QB (See BASIC entry) -- Phil P.S. (Anyone brave enough for a QuickBasic version? How about QB4.5 (mmm, compiled basic...)? VBDOS???) ---- '''Rebol''' print "Hello World" or: "Hello World" In a script: Rebol [] print "Hello World" -- AndrewMartin ---- '''RexxLanguage:''' say 'hello, world'; ---- '''RpgLanguage - RPG ''' Column positions are crucial - in old style RPG Columns . . . : 6 76 Browse TESTLIB/QRPGLESRC SEU==> TESTPGM FMT C CL0N01Factor1+++++++Opcode&ExtFactor2+++++++Result++++++++Len++D+HiLoEq FQSYSPRT O PRINTER OFLIND(*IN88) D* C EXFMT RECFMT C EVAL *INLR = *ON O RECFMT R O 11 'HELLO WORLD' '''Free format RPG''' IBM finally put the cash in for something a little more readable. Columns . . . : 6 76 Browse TESTLIB/QRPGLESRC SEU==> TESTPGM /Free dsply 'Hello World'; *INLR = *ON; /end-free -- JoshuaRobinson ---- '''RubyLanguage''': puts "Hello, world" (run with ''ruby hello.rb'' or ''ruby -e 'puts "Hello, world"''') ---- '''ScalaLanguage''': HelloWorld in Scala is discussed in several steps on this page: http://www.artima.com/scalazine/articles/steps.html println("Hello, world, from a script!") ---- '''SchemeLanguage:''' (display "Hello, World!") (newline) The following version does not work unless your Scheme system contains the writes procedure, which is non-standard. (define hello-world (lambda () (writes 'nil "Hello, World!"))) -- IainLowe I thought that at the Scheme interpreter prompt, since strings evaluate to themselves, you would just type "Hello World" and the interpreter would print it right back at you. -- EdwardKiser ''That's true, I hadn't thought of that. That bodes ill for SimplestThingThatCouldPossiblyWork.'' ''The same thing works in FalseLanguage.'' ''I'd even venture:'' (display "Hello, world!\n") We all love Closures - don't we: (define function lambda) ; for non-lispers only (define greet-constructor (function (x y) (cons x y))) (define get-greeting-function (function (a) (function (b) (greet-constructor a b)))) (define my-greeting-function (get-greeting-function 'hello)) (my-greeting-function 'world) -- ClausGittinger ---- '''sed''': s;.*;Hello, Ward; q Actually, this fails on empty input files. How about this: 0i\ Hello, world! d ---- '''ShellScript''': #!/bin/sh echo "Hello World" ---- '''Small Basic (Microsoft):''' T''''''extWindow.W''''''riteLine("Hello, World") Also G''''''raphicsWindow.D''''''rawText(10, 10, "Hello, World") --------- '''SmalltalkLanguage:''' Transcript cr; show: 'Hello World'. Type this into a workspace, select it and choose doit. Or, if you prefer a prototype, just type the quoted string, select it and choose printit. ''Then let's see how to build an "executable" that will run in something like the same way all the other languages will. We can do anything'' ''' in ''' ''Smalltalk, but the packaging, oy!'' -- RonJeffries I always show this, when asked by C/C++ programmers, as a typing in of "Hello, World!," preferably into an empty Transcript pane. And then I save the image. Loading the program subsequently brings up: "Hello, World!" Individuals will quibble over this relentlessly, saying, "It's not the same!" I can only agree that it's not the same, but that was my point about the languages and their environments in the first place. -- JerryArchibald (Eeeh - I have an eerie feeling I've just walked through this exact thing from the POV of a non-Smalltalk programmer on SmalltalkHelloWorld) I don't think this argument holds any longer - there are smalltalks around which can do this kind of stuff quite neatly (GNU-ST, ST/X...) -- ClausGittinger ---- '''SmileBASIC''' print "Hello World" ---- '''SmlLanguage''' val () = print "Hello, world!\n" ---- '''SnobolLanguage''' output = "Hello, world" end ---- '''SnuspLanguage''' ''(possibly the most fun I've ever had writing Hello world!)'' /e+++++++++++++++++++++++++++++.\ ./\/\/\ /+++\!>.+++o.l.+++++++l/ #/?\ $H!\++++++\ + \comma.------------ .+.!\-/ \!\/\/\/\/ \++++++++++/ ''or in Modular SNUSP:'' /@@@@++++# #+++@@\ #-----@@@\n $@\H.@/e.+++++++l.l.+++o.>>++++.< .<@/w.@\o.+++r.++@\l.@\d.>+.@/.# \@@@@=>++++>+++++<<@+++++# #---@@/!=========/!==/ Skeleton key (the flexiblity of PathLanguage or BefungeLanguage combined with the aesthetics of Brainf**k): * $ : start execution here moving to the right. * !? : skip over one character unconditionally or if current cell is zero * \/ : reflect the instruction pointer at a right angle (should be obvious) * +- : increment/decrement current data cell (all cells start at zero) * >< : increment/decrement the data pointer (above: cell 0 for letters, cell 1 for punctuation) * ., : output/input an ASCII character from/to the current cell * @#: enter/leave a subroutine. @ pushes position and continues with the next character. # pops position and continues with the ''second'' character from when called. * All other characters (such as '=' '|' and letters) are no-ops; commentary, if you will. There is an interpreter in Perl on the SnuspLanguage page, in case you don't believe the above is executable! ---- '''SQL (StructuredQueryLanguage):''' SQL has no branching or conditionals. It is not a programming language. It is a query language. Hmm, well. SELECT 'Hello World!'; And how about the Oracle SQL flavour? SELECT 'Hello World!' FROM dual; ''I don't know if there is a vendor-neutral way to specify this. Most dialects require the specification of a table in a SELECT statement, if I'm not mistaken.'' ---- '''SwiftLanguage:''' println("Hello, World") ---- '''TeX''' Hello,~world! or (messing with subroutines / macros) \def\hw#1{Hello,~#1} \hw{world!} \\ \hw{Ward.} (BTW, writing these examples I ran across a bug: end-of-line backslashes are eaten (together with the linefeed) at edit.) in LaTeX, you should use \newcommand: \newcommand{\hw}[1]{Hello,~#1} While we're at it, let's see the same definition in other macro processors: m4: define(`hw',`Hello, $1') cpp: #define hw(who) Hello, who It was claimed that TeX did not qualify as a programming language, according to the test given at the top of the page. However, consider the following: \long\def\repeat#1#2{ \count0=0 \def\onceMore{ \ifnum\count0<#1 #2 \advance \count0 by 1 \onceMore \fi } \onceMore } \repeat{10}{Hello,~World\par} \bye And let's not forget that there exists a BasicLanguage interpreter written in TeX: http://texcatalogue.sarovar.org/entries/basix.html ---- '''TomLanguage:''' Implementation class HelloWorld int main Array arguments { [[[stdio out] print "Hello, world"] nl]; } end; Implementation instance HelloWorld end; ---- '''ToolCommandLanguage''' puts "Hello, world" ---- '''TypoScript''' page = PAGE page.typeNum = 0 page.10 = TEXT page.10.value = HELLO WORLD! ---- '''UnLambdaLanguage''' `r```````````.H.e.l.l.o. .w.o.r.l.di ---- '''VisualBasic:''' Sub Main() MessageBox("Hello World") End Sub ---- '''VisualFoxPro: ''' '' - will also work in Clipper and almost any other DBase III-driven scripting language, known collectively as "Xbase" (ExBase)'' ? "Hello World" ---- '''MS VJ++ 6.0 version:''' import com.ms.wfc.app.*; import com.ms.wfc.core.*; import com.ms.wfc.ui.*; import com.ms.wfc.html.*; public class Form1 extends Form { public Form1() { // Required for Visual J++ Form Designer support initForm(); } public void dispose() { super.dispose(); components.dispose(); } /** * NOTE: The following code is required by the Visual J++ form * designer. It can be modified using the form editor. Do not * modify it using the code editor. */ Container components = new Container(); private void initForm() { this.setText("Form1"); this.setAutoScaleBaseSize(new Point(5, 13)); this.setClientSize(new Point(292, 273)); this.addOnClick(new EventHandler(this.Form1_click)); MessageBox.show("Hello, world"); } public static void main(String args[]) { Application.run(new Form1()); } } ---- '''VoiceXml'''
Hello, World!
-- FredrikBreivald ---- '''XIML''' -- http://ximl.com ---- '''Whirl''' 110011100111000001111100000001000011111000011111100000000010 000011001111100001100010000010011111000100000000000001001111 100000111110001000000000000000001000111110010000001100001111 100011000000000100111110011100111000111000001000111000001111 100000111110010000011111000110011111100001111000001111000001 110011111100001111000110011100000111000100011111000001111100 100000110000000111000001110001111100011111000111000001000001 000011000111110001000001000000011100000111001000111110001111 000001111000011111100001111110000011110000000000000000011110 000011100111000011110011111000111110001111100000100000000000 000000000000111110001110000001110000011100011100111110001000 100000000011100001111100110000000010011111000111100000111100 111100010011100000111110000011111001100111100010001111000000 000001000111110010000010011110011001110001000111110001100000 100011111000011110011100111111000111100000111100011111000000 011110000011100100001111000100011111001100011111000111100000 111001110001100111100100000000000000011111000001111100010010 000011100001111100100000100011100000111000110011110001001111 110001100000111100011111000111100000111001000011110001001111 100000111110000000011110000011110000000000000000111000001110 000011000001100000111000111000001100111110000111111001001110 000011111000001100011000001001111110000011100110011111000000 000111000001110000111100001100 -- by Kang Seonghoon 2005.1.7 ---- '''Whitespace''' - A real language (http://compsoc.dur.ac.uk/whitespace/) Say hello. (To be "Readable" and also so that it isn't rejected by the WikiWiki formatting transform): Note that the newlines are significant, but the extra spaces between the ''''s and ''''s should be removed before any s//\t/ and s/