<page> <title>Hello world</title> <id>6532</id> <revision> <id>31698807</id> <timestamp>2008-07-19T08:17:50Z</timestamp> <contributor> <username>Chphe</username> <id>247922</id> </contributor> <comment>Annulation des modifications 31689260 par [[Special:Contributions/Ordifana75|Ordifana75]] ([[User talk:Ordifana75|Discuter]]) pas d'erreur du bot</comment> <text xml:space="preserve">{{homonyme|Hello (homonymie)}} En [[informatique]], pour la démonstration rapide d'un [[langage de programmation]] (par exemple à but [[pédagogie|pédagogique]]) ou le test d'un [[compilateur]], il est de [[tradition]] d'écrire un petit [[programme informatique|programme]], aussi simple que possible, dont le seul but soit l'affichage à l'écran des mots '''hello world''' (''bonjour le monde''). Certains sont étonnamment complexes, particulièrement dans un contexte d'[[Environnement graphique|interface graphique]]. D'autres sont très simples, particulièrement ceux qui utilisent un [[Interprète (informatique)|interpréteur]] de ligne de commande pour afficher le résultat. Dans plusieurs [[Système embarqué|systèmes embarqués]], le texte peut être envoyé sur une ou deux lignes d'un afficheur [[Écran à cristaux liquides|LCD]] (ou dans d'autres systèmes, une simple [[Diode électroluminescente|DEL]] peut se substituer à un ''hello world''). Alors que les petits programmes de test existaient depuis le début de la programmation, la tradition d'utiliser ''hello world'' comme message de test a été influencée par le livre ''The [[C (langage)|C]] Programming Language'' de [[Brian Kernighan]] et [[Dennis Ritchie]]. Le premier exemple de ce livre affiche ''hello, world'' (sans majuscule ni point final, mais avec une virgule et un retour à la ligne final). Le premier ''hello world'' dont Ritchie et Kernighan se souviennent provient d'un manuel d'apprentissage du [[B (langage)|langage B]] écrit par Kernighan [http://cm.bell-labs.com/cm/cs/who/dmr/bintro.html]. Aujourd'hui on affiche plus souvent ''Hello world!'' comme une phrase, avec majuscule et point d'exclamation final. == Le programme « Hello world! » suivant les langages == === [[ABC (langage)|ABC]] === <source lang="freebasic"> WRITE "Hello world!" </source> === [[ActionScript]] === <source lang="actionscript"> trace("Hello world!"); </source> <source lang="actionscript"> this.createTextField("champ",this.getNextHighestDepth(),0,20,200,20); champ.text = "Hello World !"; </source> === [[Ada (langage)|Ada]] === <source lang="ada"> with Ada.Text_IO; use Ada.Text_IO; procedure Bonjour is begin -- Bonjour Put("Hello world!"); end Bonjour; </source> === Alma === Hello world! === AmigaE === PROC main() WriteF('Hello world!') ENDPROC === [[APL (langage)|APL]] === <source lang="freebasic"> 'Hello world!' </source> (L'une des bases d'APL est que toute expression qui, après exécution, n'est pas affectée à une variable voit son contenu affiché au terminal) === [[AppleScript]] === <source lang="applescript"> display dialog "Hello world!" </source> === [[Active server pages|ASP]] et ASP.NET === <source lang="asp"> <% Response.Write("Hello World") %> </source> === AspectJ === <source lang="java"> Main.java: public class Main { public static void main(String[] args){ } } HelloWorld.aj: public aspect HelloWorld { pointcut mainCall() : call(public static void *.main(String[] args)); before() : mainCall() { System.out.println( "Hello world!" ); } } </source> === Assembleur de [[Bytecode Java]] === Ce code fonctionne avec les assembleurs [[Jasmin (langage)|Jasmin]] et [[Oolong (langage)|Oolong]]. Les commentaires sont situés après un ';' <source lang="asm"> .class public Hello .super java/lang/Object ; spécification du constructeur par défaut .method public <init>(); ; pousse la référence à l'objet courant sur la pile aload_0 ; appel statiquement lié aux constructeurs de la classe de base invokespecial java/lang/Object/<init>()V return .end method .method public static main([java/lang/String;)V .limit stack 2 ; pousse la réf. à l'objet statique out de la classe System sur la pile getstatic java/lang/System/out Ljava/io/PrintStream ; pousse la chaîne de caractère sur la pile ldc "Hello world!" ; appel polymorphe invokevirtual java/io/PrintStream/println(Ljava.lang.String;)V return .end method </source> === [[Programme assembleur|Assembleur x86]] sous DOS === <source lang="asm"> cseg segment assume cs:cseg, ds:cseg org 100h main proc jmp debut mess db 'Hello world!$' debut: mov dx, offset mess mov ah, 9 int 21h ret main endp cseg ends end main </source> === [[Programme assembleur|Assembleur x86]], écrit pour l'assembleur [[TASM]] sous DOS === <source lang="asm"> .model small .stack 100h .data bonjour db "Hello world!$" .code main proc mov AX,@data mov DS, AX mov DX, offset bonjour mov AX,0900h int 21h mov AX,4C00h int 21h main endp end main </source> === [[Programme assembleur|Assembleur x86]], sous Linux, écrit pour l'assembleur [[NASM]] === <source lang="asm"> section .data helloMsg: db 'Hello world!',10 helloSize: equ $-helloMsg section .text global _start _start: mov eax,4 ; Appel système "write" (sys_write) mov ebx,1 ; File descriptor, 1 pour STDOUT (sortie standard) mov ecx, helloMsg ; Adresse de la chaîne a afficher mov edx, helloSize ; Taille de la chaîne int 80h ; Execution de l'appel système ; Sortie du programme mov eax,1 ; Appel système "exit" mov ebx,0 ; Code de retour int 80h </source> === [[Awk]] === <source lang="perl"> #!/usr/bin/awk -f BEGIN { print "Hello world!" } </source> === [[BASIC]] === <source lang="freebasic"> 10 PRINT "Hello world!" 20 END </source> Noter que les étiquettes (numéros devant les lignes) ne sont plus nécessaires dans les versions modernes ([[BBC BASIC for Windows]], [[Quick Basic]], [[Turbo Basic]], [[QBasic]], [[Visual Basic]]...). Elles ne sont plus utilisées que pour les [[Structure de contrôle|instructions de contrôle de flux]] (les [[Structure de contrôle#Boucles|boucles]] et les [[Structure de contrôle#Commandes à étiquettes|sauts]], notamment le [[Goto|GOTO]] et le GOSUB). === [[Bourne-Again shell|Bash]] === <source lang="bash"> #!/bin/bash echo 'Hello world' </source> === [[BCPL]] === GET "LIBHDR" &nbsp; LET START () BE $( WRITES ("Hello world!*N") $) === [[Befunge]] === <q_,#! #:<"Hello world!"a === [[Brainfuck]] === ++++++++[>+++++++++<-]>.>+++++++[<++++>-]<+.+++ ++++..+++.>++++[>++++++++<-]>.[-]<<++++++++.--- -----.+++.------.--------.>++++++++[->++++<]>+. === [[C (langage)|C]] === <source lang="c"> #include <stdio.h> int main(int argc, char* argv[]) { printf("Hello world!\n"); return 0; } </source> <source lang="c"> int main(int argc, char* argv[]) { puts("Hello world!"); return 0; } </source> En utilisant uniquement des fonctions [[POSIX]] : <source lang="c"> #include <unistd.h> int main(int argc, char* argv[]) { write(1, "Hello world!\n", 13); return 0; } </source> === [[C (langage)|C]] (uniquement sous windows, API Win32) === <source lang="c"> #include <windows.h> int WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow ) { MessageBox( NULL, "Hello world!\n", "", MB_OK ); return 0; } </source> === [[C (langage)|C]] (uniquement sur [[PlayStation Portable|PSP]]) === <source lang="c"> #include <pspkernel.h> #include <pspdebug.h> PSP_MODULE_INFO("Hello World", 0, 1, 1); #define printf pspDebugScreenPrintf /* Exit callback */ int exit_callback(int arg1, int arg2, void *common) { sceKernelExitGame(); return 0; } /* Callback thread */ int CallbackThread(SceSize args, void *argp) { int cbid; cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL); sceKernelRegisterExitCallback(cbid); sceKernelSleepThreadCB(); return 0; } /* Sets up the callback thread and returns its thread id */ int SetupCallbacks(void) { int thid = 0; thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0); if(thid >= 0) { sceKernelStartThread(thid, 0, 0); } return thid; } int main() { pspDebugScreenInit(); SetupCallbacks(); printf("Hello, World"); sceKernelSleepThread(); return 0; } </source> === [[C sharp|C#]] (en Console) === <source lang="csharp"> using System; public class HelloWorld { public static void Main () { Console.WriteLine("Hello world!"); } } </source> === [[C sharp|C#]] (Application Windows) === <source lang="csharp"> using System.Windows.Forms; public class HelloWorld { public static void Main() { MessageBox.Show("Hello world!"); } } </source> === [[C++]] === <source lang="cpp"> #include <iostream> using namespace std; int main() { cout << "Hello world!" << endl; return 0; } </source> === [[Caml]] === <source lang="ocaml"> print_string("Hello world!");; </source> Ou <source lang="ocaml"> (* Fichier hello.ml*) let hello () = print_string("Hello world!"); print_newline();; let main () = hello(); exit(0);; main();; </source> === Casio (calculatrices graphiques de la gamme «Graph xx») === <source lang="freebasic"> "Hello world!" </source> ou : <source lang="freebasic"> Locate 1,1,"Hello world!" </source> ou encore : <source lang="freebasic"> ViewWindow 1,127,0,1,63,0 Text 1,1,"Hello world!" </source> === [[C Intermediate Language|CIL]] === .method public static void Main() cil managed { .entrypoint .maxstack 8 ldstr "Hello world!." call void [mscorlib]System.Console::WriteLine(string) ret } === Clean === module hello &nbsp; Start :: String Start = "Hello world!" === [[CLIST]] === PROC 0 WRITE Hello world! === [[COBOL]] === IDENTIFICATION DIVISION. PROGRAM-ID. HELLO-WORLD. &nbsp; ENVIRONMENT DIVISION. &nbsp; DATA DIVISION. &nbsp; PROCEDURE DIVISION. DISPLAY "Hello world!". STOP RUN. === [[Common Lisp]] === <source lang="lisp"> (princ "Hello world!") </source> === [[D (langage)|D]] === <source lang="d"> import std.stdio; int main () { writefln("Hello world!"); return 0; } </source> === [[Delphi (informatique)|Delphi]] === <source lang="delphi"> unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) procedure FormActivate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormActivate(Sender: TObject); begin ShowMessage('Hello world'); end; end. </source> === [[Dialog]]/Xdialog === dialog --title 'Hello world!' --ok-label 'OK' --msgbox 'Hello world!' 0 0 Xdialog --title 'Hello world!' --ok-label 'OK' --msgbox 'Hello world!' 0 0 kdialog --title 'Hello world!' --msgbox 'Hello world!' 0 0 === DCL batch === $ write sys$output "Hello world!" === [[ed (logiciel)|ed]] et [[Ex (logiciel)|ex]] (Ed extendu) === a Hello world! . p ''ou'' comme ceci: echo -e 'a\nHello world!\n.\np'|ed echo -e 'a\nHello world!\n.\np'|ex === [[Eiffel (langage)|Eiffel]] === <source lang="eiffel"> class HELLO_WORLD creation make feature make is do io.put_string("Hello world!%N") end -- make end -- class HELLO_WORLD </source> === [[Erlang (langage)|Erlang]] === -module(hello). -export([hello_world/0]). &nbsp; hello_world() -> io:fwrite("Hello world!\n"). === EUPHORIA === puts(1, "Hello world!") === Forte TOOL === begin TOOL HelloWorld; &nbsp; includes Framework; HAS PROPERTY IsLibrary = FALSE; &nbsp; forward Hello; &nbsp; -- START CLASS DEFINITIONS &nbsp; class Hello inherits from Framework.Object &nbsp; has public method Init; &nbsp; has property shared=(allow=off, override=on); transactional=(allow=off, override=on); monitored=(allow=off, override=on); distributed=(allow=off, override=on); &nbsp; end class; -- END CLASS DEFINITIONS &nbsp; -- START METHOD DEFINITIONS &nbsp; ------------------------------------------------------------ method Hello.Init begin super.Init(); &nbsp; 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); &nbsp; end HelloWorld; === [[Forth (langage)|Forth]] === ." Hello world!" CR === [[Fortran]] (ANSI 77) === <source lang="fortran"> PROGRAM BONJOUR WRITE (*,*) 'Hello world!' END </source> === Frink === <source lang="freebasic"> println["Hello world!"] </source> === [[Gambas (langage)|Gambas]] === PUBLIC SUB Main() &nbsp; Print "Hello world!" &nbsp; END === [[Game Maker Language|GML]] (Game Maker Language) === <source lang="freebasic"> draw_text(x, y,"Hello world!"); </source> === [[Gnuplot]] === <source lang="bash"> #! /usr/bin/gnuplot print "hello world" </source> === GOTO++ === GOTOPRINTDUTEXTE() ; «Hello world!» === [[Grails]] === class HelloWorldController { def index = {render "Hello, world!" } } === [[Graphviz]] === <source lang="bash"> echo "digraph G {Hello->World}" | dot -Tpng >hello.png </source> === [[Groovy (langage)|Groovy]] === <source lang="groovy"> print "hello world" </source> === [[Haskell]] === module HelloWorld (main) where &nbsp; main = putStrLn "Hello world!" === Heron === program HelloWorld; functions { _main() { String("Hello world!") |> GetStdOut(); } } end === [[HP-41]] et HP-42S === (calculatrice [[Hewlett-Packard]] alphanumérique) &nbsp; 01 LBL<sup>T</sup>HELLO 02 <sup>T</sup>HELLO, WORLD 03 PROMPT<sup> </sup> [[Image:Hp41helo.png|Sortie de la HP-41]] === HP-40 G === (calculatrice [[Hewlett-Packard]]) DISP 1;"HELLO WORLD !": FREEZE: === HQ9+ === <code>H</code> === [[Hypertext Markup Language|HTML]] === <source lang="html4strict"> <html> <body> Hello world! </body> </html> </source> === [[Extensible HyperText Markup Language|XHTML]] 1.0 Strict === <source lang="html4strict"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> <title>Dire «Hello world!» en XHTML 1.0 Strict</title> </head> <body> <p>Hello world!</p> </body> </html> </source> === [[ICON]] === procedure main() write("Hello World !") end === Iptscrae === ON ENTER { "Hello " "world!" & SAY } === [[Io (langage)|Io]] === <source lang="io"> "Hello world!" print </source> ou <source lang="io"> write("Hello world!\n") </source> === [[Java (langage)|Java]] === Note: Le nom du fichier doit absolument être HelloWorld.java (même nom que la classe) <source lang="java"> public class HelloWorld { public static void main(String[] args) { System.out.print("Hello world!"); } } </source> ou <source lang="java"> public class HelloWorld { public static void main(String[] args) { javax.swing.JOptionPane.showMessageDialog(null, "Hello world!"); } } </source> === [[JavaScript]] / HTML DOM === En javascript : <source lang="javascript"> document.write("Hello world!"); </source> Cela peut être inclus dans du HTML de cette manière : <source lang="html4strict"> <script type="text/javascript" language="javascript"> document.write("Hello world!"); </script> </source> Ou par l'appel à une fonction : <source lang="html4strict"> <script type="text/javascript" language="javascript"> alert("Hello world!"); </script> </source> === Kogut === <source lang="freebasic"> WriteLine "Hello world!" </source> === [[LaTeX]] === <source lang="latex"> \documentclass{article} \begin{document} Hello world! \end{document} </source> === [[Linotte (langage)|Linotte]] === Livre : HelloWorld Paragraphe : Affichage Les actions : "Hello, World !" ! === [[Lisaac]] === section HEADER + name := HELLO_WORLD; - category := MACRO; section INHERIT - parent_object:OBJECT := OBJECT; section PUBLIC - make <- ( "Hello world !\n".print; ); === [[Lisp]] === <source lang="lisp"> (write-line "Hello World!") </source> === [[Logo (langage)|Logo]] === print [Hello world!] ou pr [Hello world!] en [[mswlogo]] seulement <nowiki>messagebox [Hi] [Hello world!]</nowiki> === [[LOLCODE]] === HAI CAN HAS STDIO? VISIBLE "HAI WORLD!" KTHXBYE === [[Lua]] === <source lang="lua"> print "Hello world!" </source> === [[Malbolge]] === (=<`:9876Z4321UT.-Q+*)M'&%$H"!~}|Bzy?=|{z]KwZY44Eq0/{mlk** hKs_dG5[m_BA{?-Y;;Vb'rR5431M}/.zHGwEDCBA@98\6543W10/.R,+O< === [[MATLAB]] === <source lang="freebasic"> disp('Hello world'); </source> ou <source lang="c"> fprintf('Hello world\n'); </source> === [[MIRC#Langage de script|mIRC Script]] === <source lang="bash"> echo -a Hello World! </source> === M (MUMPS) === W "Hello world!" === Modula-2 === MODULE Hello; &nbsp; FROM Terminal2 IMPORT WriteLn; WriteString; &nbsp; BEGIN WriteString("Hello world!"); WriteLn; END Hello; === MS-DOS batch === ''(avec l'interpreteur standard [[command.com]]. Le symbole @ est optionnel et évite au système de répéter la commande avant de l'exécuter. Le symbole @ doit être enlevé avec les versions de MS-DOS antérieures au 5.0.)'' @echo Hello world! pause === MUF === : main me @ "Hello world!" notify ; === [[Objective C]] === <nowiki>#</nowiki>import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = <nowiki>[[NSAutoreleasePool alloc]]</nowiki> init]; NSLog(@"Hello world!"); [pool release]; return 0; } === [[Objective Caml]] === Cf. [[#Caml]]. Cet exemple vaut aussi pour le F#. <source lang="ocaml"> let _ = print_endline "Hello world" </source> === Octave === #!/usr/bin/octave disp("hello world") === [[Brainfuck#Ook!|Ook]] === Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook! Ook! Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook? Ook! Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook! Ook! Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook? Ook! Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook! Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook? Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook! Ook! Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook? Ook! Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook! Ook! Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook? Ook! Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook! Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook? Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. === [[OpenLaszlo]] === <nowiki> <canvas> <text>Hello world</text> </canvas> </nowiki> === [[OPL]] === PROC hello: PRINT "Hello world!" ENDP === OPS5 === (object-class request ^action) &nbsp; (startup (strategy MEA) (make request ^action hello) ) &nbsp; &nbsp; (rule hello (request ^action hello) --> (write |Hello world!| (crlf)) ) === [[Oz (langage)|Oz]] === {Browse 'Hello world !'} === [[Pascal (langage)|Pascal]] === <source lang="pascal"> program hello; begin WriteLn('Hello world!'); end. </source> === [[Portable Document Format|PDF]] === %PDF-1.3 1 0 obj << /Type /Catalog /Outlines 2 0 R /Pages 3 0 R >> endobj 2 0 obj << /Type /Outlines /Count 0 >> endobj 3 0 obj << /Type /Pages /Kids [4 0 R] /Count 1 >> endobj 4 0 obj << /Type /Page /Parent 3 0 R /MediaBox [0 0 612 792] /Contents 5 0 R /Resources << /ProcSet 6 0 R /Font << /F1 7 0 R >> >> >> endobj 5 0 obj << /Length 73 >> stream BT /F1 24 Tf 100 100 Td (Hello World) Tj ET endstream endobj 6 0 obj [/PDF /Text] endobj 7 0 obj << /Type /Font /Subtype /Type1 /Name /F1 /BaseFont /Helvetica /Encoding /MacRomanEncoding >> endobj xref 0 8 0000000000 65535 f 0000000009 00000 n 0000000074 00000 n 0000000120 00000 n 0000000179 00000 n 0000000364 00000 n 0000000466 00000 n 0000000496 00000 n trailer << /Size 8 /Root 1 0 R >> startxref 625 %%EOF === [[Perl (langage)|Perl]] === <source lang="perl"> #!/usr/bin/perl print "Hello world!\n"; </source> === [[Perl 6]] === <source lang="perl"> say "Hello world"; </source> === [[PHP: Hypertext Preprocessor|PHP]] === <source lang="php"> <?php echo "Hello world!"; // On peut aussi utiliser les guillemets simples echo 'Hello World!'; ?> </source> ou <source lang="php"> <?php print ("Hello world!"); ?> </source> ou (version printf() du c) <source lang="php"> <?php printf("%s %s","Hello","world!"); ?> </source> et encore (en version raccourcie) <source lang="php"> <?="Hello world!"?> </source> On peut carrément sous-entendre l'instruction et écrire : <source lang="php"> Hello World! </source> === [[Piet]]=== <div style="padding-top:15px;margin-left:10px;"> [[Image:Piet Program Hello World(1).gif|thumb|left|[[Hello World]] en langage Piet]] </div> <source lang="text"> . . . . . . . . . . . . . </source> === [[PlanFacile]] === <pre><nowiki> #start{0}#message{Hello world !} </nowiki></pre> ou pour les amateurs d'IOCCC <pre><nowiki> #define{d}{r}#define{r}{H#2#1#H#define{r}{#1#1}} #H{#h{#r{#r{#e}#define{H}{#l}}{e}}{#define{d}{# }!} {#h{#l}{#o}{#w{w}}#e#define{h}{#3#define{o}{r}#1#2} #w{d}{#d}#define{w}{#0}}#define{h}{#1#d#3#2}#define{e} {l}}#start{0}#define{H}{#foot{#1#define{l}{o}}} </nowiki></pre> === [[PL/I]] === hello: procedure options(main); display ('Hello world!'); /* Ou, variante : put skip list ('Hello world!'); */ end hello; === [[PL/SQL]] === SET SERVEROUTPUT ON BEGIN DBMS_OUTPUT.PUT_LINE('Hello world!'); END; === [[PL/PGSQL]] === CREATE FUNCTION hello_world() RETURNS VOID AS $$ BEGIN RAISE NOTICE 'Hello World'; END $$ LANGUAGE 'plpgsql' VOLATILE; === POP-11 === 'Hello world!' => === [[POV-Ray]] === #include "colors.inc" camera { location <3, 1, -10> look_at <3,0,0> } light_source { <500,500,-1000> White } text { ttf "timrom.ttf" "Hello world!" 1, 0 pigment { White } } === [[PostScript]] === %!PS 100 /Helvetica findfont exch scalefont setfont 10 300 moveto (Hello, world !) show showpage === PROC (langage de commande [[Pick (système d'exploitation)|Pick]]) === 001 PQ 002 C Affiche 'Hello, world !' à l'écran 003 OHello, world ! 004 X :NB : PQ indique qu'il s'agit d'une PROC, C=Commentaire, O=Output, X=Exit (facultatif). Les numéros de lignes sont ceux affichés par l'éditeur de textes ED. === [[Prolog]] === :- write('Hello world!'), nl. === [[Pseudo-code]] === output Hello world! === [[PureBasic]] === <source lang="freebasic"> OpenConsole() PrintN("Hello World!") </source> === [[Python (langage)|Python]] === <source lang="python"> print "Hello world!" </source> === [[Rebol]] === <source lang="freebasic"> print "Hello world!" </source> === [[REXX]], NetRexx, et Object REXX === <source lang="freebasic"> say "Hello world!" </source> ''ou:'' <source lang="freebasic"> say 'Hello world!' </source> === RPG === ==== Syntaxe libre ==== <pre> /FREE DSPLY 'Hello, world!'; *InLR = *On; /END-FREE </pre> ==== Syntaxe traditionnelle ==== Avec cette syntaxe, une constante doit être utilisée car seules les positions 12 à 25 peuvent être utilisées pour contenir le message. <pre> d TestMessage c Const( 'Hello, world!' ) c TestMessage DSPLY c EVAL *InLR = *On </pre> === [[RPL]] === (Sur les calculatrices [[Hewlett-Packard]] [[HP-28]], [[HP-48]] et [[HP-49G|HP-49]].) << CLLCD "Hello world!" 1 DISP 0 WAIT DROP >> <!-- note: FREEZE non utilisié depuis qu'il n"est pas présent dans la HP-28 --> === [[Ruby]] === <source lang="ruby"> puts "Hello world!" </source> === [[Ruby on Rails]] === <source lang="ruby"> render :text => "Hello, world!" </source> === [[Sather]] === class HELLO_WORLD is main is #OUT+"Hello world!\n"; end; end; === [[Scala (langage)|Scala]] === object HelloWorld with Application { Console.println("Hello world!"); } === [[Scilab]] === <source lang="freebasic"> disp("Hello World"); </source> === [[Scheme]] === <source lang="scheme"> (display "Hello world!") (newline) </source> === [[sed (logiciel)|sed]] === (note: requiert au moins une ligne en entrée) <source lang="bash"> sed -ne '1s/.*/Hello world!/p' </source> ou <source lang="bash"> sed "i\ Hello World" << EOF EOF </source> === Seed7 === $ include "seed7_05.s7i"; const proc: main is func begin writeln("Hello world!"); end func; === [[Self (langage)|Self]] === 'Hello world!' print. === SPL ([[Shakespeare Programming Language]]) === <poem><nowiki> The Infamous Hello World Program. Romeo, a young man with a remarkable patience. Juliet, a likewise young woman of remarkable grace. Ophelia, a remarkable woman much in dispute with Hamlet. Hamlet, the flatterer of Andersen Insulting A/S. Act I: Hamlet's insults and flattery. Scene I: The insulting of Romeo. [Enter Hamlet and Romeo] Hamlet: You lying stupid fatherless big smelly half-witted coward! You are as stupid as the difference between a handsome rich brave hero and thyself! Speak your mind! You are as brave as the sum of your fat little stuffed misused dusty old rotten codpiece and a beautiful fair warm peaceful sunny summer's day. You are as healthy as the difference between the sum of the sweetest reddest rose and my father and yourself! Speak your mind! You are as cowardly as the sum of yourself and the difference between a big mighty proud kingdom and a horse. Speak your mind. Speak your mind! [Exit Romeo] Scene II: The praising of Juliet. [Enter Juliet] Hamlet: Thou art as sweet as the sum of the sum of Romeo and his horse and his black cat! Speak thy mind! [Exit Juliet] Scene III: The praising of Ophelia. [Enter Ophelia] Hamlet: Thou art as lovely as the product of a large rural town and my amazing bottomless embroidered purse. Speak thy mind! Thou art as loving as the product of the bluest clearest sweetest sky and the sum of a squirrel and a white horse. Thou art as beautiful as the difference between Juliet and thyself. Speak thy mind! [Exeunt Ophelia and Hamlet] Act II: Behind Hamlet's back. Scene I: Romeo and Juliet's conversation. [Enter Romeo and Juliet] Romeo: Speak your mind. You are as worried as the sum of yourself and the difference between my small smooth hamster and my nose. Speak your mind! Juliet: Speak YOUR mind! You are as bad as Hamlet! You are as small as the difference between the square of the difference between my little pony and your big hairy hound and the cube of your sorry little codpiece. Speak your mind! [Exit Romeo] Scene II: Juliet and Ophelia's conversation. [Enter Ophelia] Juliet: Thou art as good as the quotient between Romeo and the sum of a small furry animal and a leech. Speak your mind! Ophelia: Thou art as disgusting as the quotient between Romeo and twice the difference between a mistletoe and an oozing infected blister! Speak your mind! [Exeunt] </nowiki></poem> === [[Shell Unix]] === <source lang="bash"> #!/bin/sh echo "Hello world!" </source> === [[Simula]] === BEGIN outtext("Hello World!"); outimage; END; === Silscript === Intr-aff-{ aff[Hello world!]; }Stop-aff- === [[Smalltalk]] === Transcript show: 'Hello world!' Ou self inform: 'Hello world!' === SML === print "Hello world!\n"; === [[SNOBOL]] === OUTPUT = "Hello world!" END === [[Structured Query Language|SQL]] === <source lang="mysql"> create table MESSAGE (TEXT char(15)); insert into MESSAGE (TEXT) values ('Hello world!'); select TEXT from MESSAGE; drop table MESSAGE; </source> Ou (ex : en [[Oracle (base de données)|Oracle]]) <source lang="oracle8"> select 'Hello world!' from dual; </source> Ou (ex en: [[MySQL]] ) <source lang="mysql"> select 'Hello world!'; </source> Ou, plus simplement <source lang="mysql"> print 'Hello world!.' </source> Ou (pour le KB-SQL) <source lang="sql"> select Null from DATA_DICTIONARY.SQL_QUERY FOOTER ''or HEADER or DETAIL or FINAL event'' write "Hello world!" </source> === STARLET === <pre> RACINE: HELLO_WORLD. NOTIONS: HELLO_WORLD : ecrire("Hello world!"). </pre> === TACL === #OUTPUT Hello world! === [[Tool Command Language|Tcl]] === <source lang="tcl"> puts "Hello world!" </source> === [[Tool Command Language|Tcl/Tk]] === <source lang="tcl"> pack [button .b -text "Hello world!" -command exit] </source> === [[TeX]] === Hello world! \bye === [[Turbo Pascal]] === <source lang="pascal"> program Hello_World_in_TP; {titre le programme} begin writeln('Hello World'); {affiche le message et saute une ligne} readln; {Sert de pause} end. </source> === Turing === <source lang="freebasic"> put "Hello world!" </source> === TSQL === Declare @Output varchar(16) Set @Output='Hello world!' Select @Output ou, variation plus simple: Select 'Hello world!' Print 'Hello world!' === [[TI-Basic]] === [[Texas Instruments|Ti]] 80 à Ti 92 : <source lang="freebasic"> :Disp "Hello world!" </source> Remarque : les guillemets ne sont pas indipensables <source lang="freebasic"> :Disp "Hello World! </source> ou <source lang="freebasic"> :Output(X,Y,"Hello world!") </source> ou plus simplement : <source lang="freebasic"> :Output(X,Y,"Hello World! </source> Où X représente la ligne et Y la colonne. === [[Verilog]] === module main; initial begin $display("Hello, world"); $finish ; end endmodule === [[Very High Speed Integrated Circuit Hardware Description Language|VHDL]] === use std.textio.all; ENTITY hello IS END ENTITY hello; ARCHITECTURE Wiki OF hello IS CONSTANT message : string := "hello world"; BEGIN PROCESS variable L: line; BEGIN write(L, message); writeline(output, L); wait; END PROCESS; END ARCHITECTURE Wiki; === [[VBA]] (Visual Basic for Application) === Sub Main MsgBox "Hello world!" End Sub === [[Visual Basic .NET]] (Application Console) === Imports System Public Shared Sub Main() Console.WriteLine("Hello World!") End Sub === [[Visual Basic .NET]] (Application Windows Forms) === Imports System.Windows.Forms Public Shared Sub Main() MessageBox.Show("Hello World!") End Sub Le .Show n'est pas obligatoire mais les parenthèses oui === [[Visual DialogScript]] 2,3,4 et 5 === Title Hello World! Info Hello World! === [[Whitespace]] === <span style="background:#ffcccc">&#32;&#32;&#32;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span> <span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;&#32;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;&#9;&#9;&#9;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;&#32;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;&#9;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;&#9;</span><span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;&#9;&#9;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;</span> <span style="background:#ffcccc">&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;&#9;&#9;&#9;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;&#32;</span><span style="background:#ccffcc">&#9;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;&#9;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;</span> <span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;&#32;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;&#9;</span><span style="background:#ffcccc">&#32;</span> <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;</span> <span style="background:#ccffcc">&#9;&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;&#9;&#9;&#9;</span> <span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span> <span style="background:#ccffcc">&#9;</span> <span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;&#32;&#32;</span> empty-line <span style="background:#ffcccc">&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span> empty-line <span style="background:#ffcccc">&#32;</span><span style="background:#ccffcc">&#9;&#9;&#9;</span><span style="background:#ffcccc">&#32;</span> empty-line <span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;</span> <span style="background:#ccffcc">&#9;</span> <span style="background:#ffcccc">&#32;&#32;&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span> <span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;&#32;&#32;</span> empty-line <span style="background:#ffcccc">&#32;&#32;</span><span style="background:#ccffcc">&#9;</span> empty-line <span style="background:#ffcccc">&#32;&#32;&#32;</span><span style="background:#ccffcc">&#9;</span><span style="background:#ffcccc">&#32;</span> empty-line empty-line/EOF === [[XUL]] === <source lang="xml"> <?xml version="1.0" encoding="ISO-8859-1" ?> <window title="Hello world" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <description>Hello world</description> <label value="Hello world" /> </window> </source> == Liens externes == * [http://99-bottles-of-beer.ls-la.net/ 99 Bottles of Beer] (Site présentant un programme simple écrit en près de 1200 langages différents) [[Catégorie:Programmation informatique]] [[ar:برنامج هلو ورلد]] [[az:Bir çox dillÉ™rdÉ™ "Hello World"]] [[bar:Servus-Woid-Programm]] [[bg:Hello, world]] [[bs:Hello world program]] [[ca:Hola món]] [[cs:Hello world]] [[da:Hello world-program]] [[de:Hallo-Welt-Programm]] [[el:Î ÏόγÏαμμα hello world]] [[en:Hello world program]] [[eo:Saluton, mondo!]] [[es:Hola mundo]] [[et:Hello world]] [[eu:Kaixo mundua]] [[fi:Hei maailma -ohjelma]] [[he:×ª×•×›× ×™×ª Hello world]] [[hu:„Helló, világ!†program]] [[ia:Hello World]] [[id:Hello world]] [[it:Hello world]] [[ja:Hello world]] [[ko:Hello world 프로그램]] [[ms:Hello world]] [[nl:Hello world (computerprogramma)]] [[nn:Hello World]] [[no:Hello, world]] [[pl:Hello world]] [[pt:Programa Olá Mundo]] [[ro:Program Hello, world!]] [[ru:Программа Hello world]] [[simple:Hello World]] [[sk:Hello world]] [[sl:Pozdravljen, svet]] [[sq:Njatjeta Botë (programi)]] [[sr:Hello World]] [[sv:Hello World]] [[th:Hello world]] [[tr:Merhaba dünya programı]] [[vi:Chà o thế giá»›i!]] [[zh:Hello World]]</text> </revision> </page>