\n","Clean"," module hello \n \n Start = \"Hello, world!\" \n","Clipper"," ? \"Hello, world!\" \n"," @1,1 say \"Hello, world!\" \n"," Qout (\"Hello, world\" )\n","CLIST","PROC 0\nWRITE Hello, world!\n","Clojure","( println \"Hello, world!\" ) \n","CLU","start_up = proc ()\n po: stream := stream$primary_output ()\n stream$putl (po, \"Hello, world!\")\n end start_up\n","COBOL"," IDENTIFICATION DIVISION . \n PROGRAM-ID . HELLO-WORLD . \n PROCEDURE DIVISION . \n DISPLAY \"Hello, world!\" . \n STOP RUN . \n","The above is a very abbreviated and condensed version, which omits the author name and source and destination computer types.\n","CoffeeScript","CoffeeScript is a language that compiles into JavaScript. Like JavaScript, it does not have native (built in) input or output routines, instead relying on the facilities provided by its host environment.\n","Using an alert that uses a standard Web browser's window object (window.alert)\n","alert 'Hello, world!' \n","or, from Firebug , Apple Safari , or Google Chrome debug console, or Node.js console\n","console . log 'Hello, world!' \n","ColdFusion (CFML)"," Hello, world! \n","Hello, world!\n","COMAL"," PRINT \"Hello, world!\" \n","Common Lisp","( princ \"Hello, world!\" ) \n","Cube","Function | Main \nWriteLine | \"Hello, world\"\nEnd | Main\n","The '|' represents the separation of the two text fields in the Cube standard IDE.\n","C++","#include \n\nint main () { \n std :: cout << \"Hello, World!\" << std :: endl ; \n return 0 ; \n} \n","C++/CLI","int main () { \n System :: Console :: WriteLine ( \"Hello, world!\" ); \n return 0 ; \n} \n","C++, Managed (.NET)","#using \n\nusing namespace System ; \n\nint wmain () \n{ \n Console :: WriteLine ( \"Hello, world!\" ); \n return 0 ; \n} \n","C#","See also GUI section .","using System ; \n\ninternal static class HelloWorld \n{ \n private static void Main () \n { \n Console . WriteLine ( \"Hello, world!\" ); \n } \n} \n","D"," import std . stdio ; \n \n void main () { \n writefln ( \"Hello, world!\" ); \n } \n","Tango version:\n"," import tango . io . Stdout ; \n\n void main () { \n Stdout ( \"Hello, world!\" ). newline ; \n } \n","Dart","main () { \n print ( 'Hello, world!' ); \n} \n","Or,\n","void main () { \n print ( 'Hello, world!' ); \n} \n","DC, an arbitrary precision calculator","[Hello, world!]p\n","1468369091346906859060166438166794P\n","In the second example, DC stores the decimal number as a sequence of bits, and then the \"P\" tells DC to interpret those bits as a string and print it.\n","DCL batch","$ write sys$output \"Hello, world!\"\n","Delphi","{$APPTYPE CONSOLE} \nbegin \n Write ( 'Hello, world!' ) ; \nend . \n","DIV","PROGRAM hello ; \nBEGIN \n write ( 0 , 0 , 0 , 0 , \" Hello , world !\" ) ; \n LOOP \n FRAME ; \n END \nEND \n","DOLL","this::operator()\n{\n import system.cstdio;\n puts(\"Hello, world!\");\n}\n","Dream Maker","mob\n Login()\n ..()\n world << \"Hello, world!\"\n","Dylan"," module : hello \n \n format-out ( \"Hello, world! \\n \" ); \n","EAScripting","set disp to \"Hello, world!\"\nset dispto to item unit 5 //5 = default screen\nrelease disp into dispto.\n","This would be a pure system call\n","import system ea.helloworld\nwait\n","Ed and Ex (Ed extended)","a\nHello, world!!\n.\np\n","Ecstasy (xtclang)","module HelloWorld \n { \n void run () \n { \n @Inject Console console ; \n console . print ( \"Hello World!\" ); \n } \n } \n","Eiffel","class HELLO_WORLD \n \ncreate make \nfeature \n make is \n do \n io . put_string ( \"Hello, world!%N\" ) \n end -- make \nend -- class HELLO_WORLD \n","Elixir","IO . puts \"Hello, world!\" \n","Elm","import Html exposing ( text ) \n\nmain = \n text \"Hello, World!\" \n","Erlang","- module ( hello ). \n\n- export ([ hello / 0 ]). \n\nhello () -> io : format ( \"Hello, world! ~n \" ). \n","Euphoria","puts(1, \"Hello, world!\")\n","Factor"," \"Hello, world!\" print \n","or gui version\n"," \"Hello, world!\" \"Hi\" open-window\n","Falcon","printl( \"Hello world\" )\n","Ferite","uses \"console\";\n\nConsole.println(\"Hello, world!\");\n","filePro"," @once:\n mesgbox \"Hello, world!\" ; exit\n","Fjölnir","\"halló\" < main\n{\n main ->\n stef(;)\n stofn\n skrifastreng(;\"Halló, veröld!\"),\n stofnlok\n}\n*\n\"GRUNNUR\"\n;\n","FOCAL","type \"Hello, world!\",!\n","t \"Hello, world!\",!\n","Focus","-TYPE Hello, world!\n","Forte TOOL","begin TOOL HelloWorld;\n\nincludes Framework;\nHAS PROPERTY IsLibrary = FALSE;\n\nforward Hello;\n\n-- START CLASS DEFINITIONS\n\nclass Hello inherits from Framework.Object\n\nhas public method Init;\n\nhas property\n shared=(allow=off, override=on);\n transactional=(allow=off, override=on);\n monitored=(allow=off, override=on);\n distributed=(allow=off, override=on);\n\nend class;\n-- END CLASS DEFINITIONS\n\n-- START METHOD DEFINITIONS\n\n------------------------------------------------------------\nmethod Hello.Init\nbegin\nsuper.Init();\n\ntask.Part.LogMgr.PutLine('Hello, world!');\nend method;\n-- END METHOD DEFINITIONS\nHAS PROPERTY\n CompatibilityLevel = 0;\n ProjectType = APPLICATION;\n Restricted = FALSE;\n MultiThreaded = TRUE;\n Internal = FALSE;\n LibraryName = 'hellowor';\n StartingMethod = (class = Hello, method = Init);\n\nend HelloWorld;\n","Forth"," : HELLO ( -- ) .\" Hello, world!\" CR ; \n HELLO\n","or instead of compiling a new routine, one can type directly in the Forth interpreter console\n"," CR .\" Hello, world!\" CR\n","Fortran","Fortran 77","00 program hello \n write ( * , * ) 'Hello World!' \n stop \n end \n","Fortran 90/95","program hello \n write ( * , * ) 'Hello, World!' \nend program hello \n","F#","printfn \"Hello, world!\" \n","Fril","?((pp \"Hello, world!\")) \n","pp \"Hello, world!\"\n","Frink","println[\"Hello, world!\"]\n","Gambas","PUBLIC SUB Main()\n Print \"Hello, world!\"\nEND\n","GEMBase 4GL","procedure_form hello\n begin_block world\n print \"Hello, world!\"\n end_block\nend_form\n","GeneXus","Msg(\"Hello World\")\n","GML (Game Maker Language)","In the draw event of some object:\n"," draw_text(x,y,\"Hello, world!\")\n","Or to show a splash screen message:\n"," show_message(\"Hello, world!\")\n","Go (from Google)","package main \n\nimport \"fmt\" \n\nfunc main () { \n fmt . Println ( \"Hello, world!\" ) \n} \n","GraalScript","GraalScript 1"," if (created) {\n echo Hello, world!;\n }\n","GraalScript 2"," function onCreated() {\n echo(\"Hello, world!\");\n }\n","Groovy","println \"Hello, world!\" \n","Harbour","? \"Hello, world!\"\n","@1,1 say \"Hello, world!\"\n","Qout(\"Hello, world\")\n","Haskell","main = putStrLn \"Hello, world!\" \n","Haxe","class HelloWorldApp \n{ \n static function main () \n { \n trace ( \"Hello, world!\" ); \n } \n} \n","Heron","program HelloWorld;\nfunctions {\n _main() {\n print_string(\"Hello, world!\");\n }\n}\nend\n","HP 33s","(Handheld Hewlett-Packard RPN-based scientific calculator.)\n","LBL H\nSF 10\nEQN\nRCL H\nRCL E\nRCL L\nRCL L\nRCL O\nR/S\nRCL W\nRCL O\nRCL R\nRCL L\nRDL D\nENTER\nR/S\n","HP-41 & HP-42S","(Handheld Hewlett-Packard RPN-based alphanumeric engineering calculators.)\n","01 LBLT HELLO\n\n02 T Hello, world!\n\n03 PROMPT\n","HyperTalk (Apple HyperCard's scripting programming language)"," put \"Hello, world!\" \n"," Answer \"Hello, world!\" \n","Icon","procedure main () \n write ( \"Hello, world!\" ) \nend \n","IDL"," print ,\"Hello, world!\" \n","Io","\"Hello, world!\" println \n","writeln ( \"Hello, world!\" ) \n","Inform","Inform 5/6"," [ Main ; \n \"Hello, world!\" ; \n ]; \n","Inform 7"," Hello World is a room. The printed name is \"Hello, world!\" \n","Iptscrae","ON ENTER {\n \"Hello, \" \"world!\" & SAY\n}\n","J","'Hello, world!' NB. echoes the string in interactive mode, doesn't work in script \n","'Hello World!' 1 !: 2 ( 2 ) NB. prints it to (2) - screen, (4) - stdout \n","Jal","include 16f877_20\ninclude hd447804\n \nhd44780_clear\n \nhd44780 = \"H\"\nhd44780 = \"e\"\nhd44780 = \"l\"\nhd44780 = \"l\"\nhd44780 = \"o\"\nhd44780 = \" \"\nhd44780 = \"W\"\nhd44780 = \"o\"\nhd44780 = \"r\"\nhd44780 = \"l\"\nhd44780 = \"d\"\nhd44780 = \"!\"\n","Java","class HelloWorld { \n public static void main ( String [] args ) { \n System . out . println ( \"Hello, world!\" ); \n } \n} \n","Java byte-code","(disassembler output of ","javap -c HelloWorld",")\n"," public class HelloWorld extends java . lang . Object { \n public HelloWorld (); \n Code : \n 0 : aload_0 \n 1 : invokespecial # 1 ; //Method java/lang/Object.\"\":()V \n 4 : return \n public static void main ( java . lang . String [] ); \n Code : \n 0 : getstatic # 2 ; //Field java/lang/System.out:Ljava/io/PrintStream; \n 3 : ldc # 3 ; //String Hello, world! \n 5 : invokevirtual # 4 ; //Method java/io/PrintStream.println:(Ljava/lang/String;)V \n 8 : return \n } \n","Java byte-code Jasmin Syntax",".class HelloWorld \n.super java/lang/ Object \n.method public static main ([ L java/lang/ String ;) V \n .limit stack 2 \n getstatic java/lang/ System/ out L java/io/ PrintStream ; \n ldc \"Hello, world!\" \n invokevirtual java/io/ PrintStream/ println ( L java/lang/ String ;) V \n return \n.end method \n","JavaFX Script","JavaFX Script was a scripting language formerly called F3 for Form Follows Function. It was discontinued by Oracle in 2010. \n"," Frame { \n title : \"Hello World JavaFX\" \n width : 200 \n content : Label { \n text : \"Hello World\" \n } \n visible : true \n } \n","This program can also be written in this way:\n"," var win = new Frame (); \n win . title = \"Hello World JavaFX\" ; \n win . width = 200 ; \n var label = new Label (); \n label . text = \"Hello World\" ; \n win . content = label ; \n win . visible = true ; \n","A simple console output version would be:\n"," import java.lang.System ; \n System . out . println ( \"Hello World\" ); \n","Or even simpler (with a built-in function):\n","println ( \"Hello World\" ); \n","JavaScript","JavaScript does not have native (built in) input or output routines. Instead it relies on the facilities provided by its host environment.\n","Using a standard Web browser's document object\n","document . write ( 'Hello, World!' ); \n","or with an alert, using a standard Web browser's window object (window.alert)\n","alert ( 'Hello, world!' ); \n","or, from the Mozilla command line implementation\n","print ( 'Hello, world!' ); \n","or, from the Windows Script Host \n","WScript . Echo ( 'Hello, world!' ); \n","or, from Firebug , Apple Safari , or Google Chrome debug console\n","console . log ( 'Hello, world!' ); \n","JCL (mainframe Job Control Language)","// HERIB JOB , 'HERIBERT OTTEN' , PRTY = 12 \n//* HELLO WORLD FOR MVS \n// HALLO EXEC PGM = IEBGENER \n// SYSIN DD DUMMY \n// SYSPRINT DD SYSOUT = * \n// SYSUT2 DD SYSOUT = T \n// SYSUT1 DD * \nHELLO WORLD! \n/* \n// \n","Joy","\"Hello, world!\\n\" putchars .\n","JSP"," <%@ page contentType = \"text/html;charset=WINDOWS-1252\" %> \n \n \n <% out . println ( \" Hello, world!\" ); %> \n \n \n","or just\n"," <% out . println ( \"Hello, world!\" ); %> \n","or literally\n"," Hello, world!\n","Julia"," println ( \"Hello, world!\" ) \n","K"," ` 0 : \"Hello, world! \\n \" \n","ksi","`plain\n'Hello World!' #echo #\n","Kotlin","fun main () { \n println ( \"Hello World!\" ) \n} \n","Kogut","WriteLine \"Hello, world!\"\n","KPL (Kids Programming Language)","Program HelloWorld\n Method Main()\n ShowConsole()\n ConsoleWriteLine(\"Hello, world!\")\n End Method\nEnd Program\n","Lasso"," Output : 'Hello, world!' ; \n"," Output ( 'Hello, world!' ); \n","or simply\n","'Hello, world!';\n","Lexico Mobile (in Spanish)","tarea muestre \"Hola mundo !\"\n","clase Saludo derivada_de Form\npublicos\nmensajes\nSaludo copie \"Hola mundo !\" en saludo.Text\n","Linden Scripting Language","Linden Scripting Language is the scripting language used within Second Life\n","default \n{ \n state_entry () \n { \n llSetText ( \"Hello, World!\" , < 0 , 0 , 0 > , 1.0 ); \n //or... \n llSay ( 0 , \"Hello, World!\" ); \n } \n} \n","Linotte","Livre : HelloWorld\n Paragraphe : Affichage\n Actions :\n \"Hello, World !\" !\n","Lisaac","Section Header \n + name := HELLO_WORLD_PROGRAM ; \n\nSection Public \n - main <- \n (\n \"Hello world!\\n\" .print ; \n ); \n","Lisp","Lisp has many dialects that have appeared over its almost fifty-year history.\n","( format t \"Hello, world!~%\" ) \n","( write-line \"Hello, world!\" ) \n","or in the REPL:\n","\"Hello, world!\"","(As a string (enclosed in quotes) it evaluates to itself, so is printed.)\n","Scheme","( display \"Hello, world! \\n \" ) \n","Emacs Lisp","( print \"Hello, world!\" ) \n","( message \"Hello, world!\" ) \n","AutoLisp","XLISP","Arc","( prn \"Hello, world!\" ) \n","Pils","( out \"Hello, world!\" ) \n","Logo","print [Hello, world!]\n","pr [Hello, world!]\n","In MSWLogo only\n","messagebox [Hi] [Hello, world!]\n","LPC"," void create () \n { \n write ( \"Hello, world! \\n \" ); \n } \n","Lua","io.write ( \"Hello, world! \\n \" ) \n","return \"Hello, World!\" \n","print ( \"Hello, world\" ) \n","LuaDEV (PSP and Wii)"," screen . print ( 10 , 10 , \"Hello, world!\" ) \n","M (MUMPS)","W \"Hello, world!\"\n","Macsyma, Maxima"," print ( \"Hello, world!\" )$ \n","Maple","print(\"Hello, world!\");\n","Mathematica"," Print [ \"Hello, world!\" ] \n","or simply:\n","MATLAB / GNU Octave","disp ( 'Hello, world!' ) \n","fprintf ( 'Hello, world!\\n' ) \n","or with a GUI\n"," figure ( 'Position' ,[ 100 100 200 200 ], 'MenuBar' , 'none' , 'Name' , 'Hello World' ); \n uicontrol ( 'Style' , 'text' , 'Position' ,[ 15 100 150 15 ], 'String' , 'Hello world' ); \n","msgbox ( 'Hello World!' ) \n","Maude","fmod HELLOWORLD is\nprotecting STRING .\n op helloworld : -> String .\n eq helloworld = \"Hello, world!\" .\nendfm\nred helloworld .\n","Max","max v2;\n#N vpatcher 10 59 610 459;\n#P message 33 93 63 196617 Hello, world!!;\n#P newex 33 73 45 196617 loadbang;\n#P newex 33 111 31 196617 print;\n#P connect 1 0 2 0;\n#P connect 2 0 0 0;\n#P pop;\n","Maya Embedded Language","print ( \"Hello, world!\\n\" ); \n","Mesham","var x:String::allocated[on[0]];\nx:=\"Hello World\"; // allocated on process 0 only\nproc 1 {\n // This is displayed by process 1, auto communication done to achieve this\n print[x];\n}\n","M4","Microbit","mIRC Script","aliases","helloworld echo Hello, world!","remote","alias helloworld echo Hello, world!","popups","Hello World:echo Hello, world!","command line","echo Hello, world!","Model 204","BEGIN\nPRINT 'Hello, world!'\nEND\n","Modula-2","MODULE Hello ; \n\nFROM InOut IMPORT WriteLn , WriteString ; \n\nBEGIN \n WriteString ( \"Hello, world!\" ); \n WriteLn \nEND Hello . \n","Monkey"," Strict \n \n Function Main : Int () \n Print \"Hello World!\" \n \n Return 0 \n End \n","MOO","This requires that you be the player or a wizard:"," notify ( player , \"Hello, world!\" ); \n","This is specific to the implementation of the core used for the moo, but works on most well known moos, such as LambdaCore or JH-Core:"," player : tell ( \"Hello, world!\" ); \n","Mouse","\"Hello, World!\"\n$\n","MPI","M# Fictional Computer Language","Script","main(std:string >>arg<< / OS.GetArg)\n{\n std:stream >>CONSOLE<< / OS.Console;\n\n CONSOLE:Write([byte]{0048, 0065, 006C, 006C, 006F, 002C, 0058, 006F, 0072, 006C, 0064});\n // H e l l o , W o r l d //\n}\n","Command WI","# # DEFINE g >>CONSOLE<< / OS.Console\n# % proc CONSOLE:Write([byte]{0048, 0065, 006C, 006C, 006F, 002C, 0058, 006F, 0072, 006C, 0064})\n","Command WoI","# @ Write([byte]{0048, 0065, 006C, 006C, 006F, 002C, 0058, 006F, 0072, 006C, 0064})\n","MS-DOS batch","(with the standard command.com interpreter. The @ symbol is optional and prevents the system from repeating the command before executing it. The @ symbol must be omitted on versions of MS-DOS prior to 3.0.). It's very common for batchfiles to start with two lines of \"@echo off\" and \"cls\".","@ echo Hello, world!\n"," For MS-DOS 3.0 or lower","@ echo off\ncls \necho Hello, world!\n","MUF",": main\n me @ \"Hello, world!\" notify\n;\n","Natural","WRITE 'Hello, world!'\nEND\n","WRITE 'Hello, world!'.\n","Neko","$print(\"Hello, world!!\\n\");\n","Nemerle","The easiest way to get Nemerle print \"Hello, world!\" would be that:\n"," System . Console . WriteLine ( \"Hello, world!\" ); \n","however, in bigger applications the following code would be probably more useful:\n"," using System . Console ; \n \n module HelloWorld \n { \n Main (): void \n { \n WriteLine ( \"Hello, world!\" ); \n } \n } \n","Nim","echo \"Hello, world!\" \n","echo ( \"Hello, world!\" ) \n","NXT 2.1 (the Lego Robot program)","Oberon","Oberon is both the name of a programming language and an operating system.\n","Program written for the Oberon operating system:\n","MODULE Hello ; \n IMPORT Oberon , Texts ; \n VAR W : Texts . Writer ; \n\n PROCEDURE World * ; \n BEGIN \n Texts . WriteString ( W , \"Hello, world!\" ); \n Texts . WriteLn ( W ); \n Texts . Append ( Oberon . Log , W . buf ) \n END World ; \n\nBEGIN \n Texts . OpenWriter ( W ) \nEND Hello . \n","Freestanding Oberon program using the standard Oakwood library:\n","MODULE Hello ; \n IMPORT Out ; \nBEGIN \n Out . String ( \"Hello, world!\" ); \n Out . Ln \nEND Hello . \n","Obix","system.console.write_line ( \"Hello, world!\" )\n","ObjectGears","Message to the user in the form:\n","OGForm.SetInfo('Hello world!');\n","Entry into the log:\n","OG.Log.Write('Hello world!');\n","Objective C","Procedural C Version","#import \n\nint main ( int argc , const char * argv []) \n{ \n printf ( \"Hello, world! \\n \" ); \n return 0 ; \n} \n","Object-Oriented C Version","#import \n#import \n\n@interface Hello : Object \n{ \n} \n- hello ; \n@end \n\n@implementation Hello \n- hello \n{ \n printf ( \"Hello, world! \\n \" ); \n} \n@end \n\nint main ( void ) \n{ \n id obj ; \n obj = [ Hello new ]; \n [ obj hello ]; \n [ obj free ]; \n return 0 ; \n} \n","OPENSTEP/Cocoa Version","#import \n\nint main ( int argc , const char * argv []) \n{ \n NSLog ( @\"Hello, world!\" ); \n return 0 ; \n} \n","OCaml","print_endline \"Hello, world!\" ;; \n","occam","#USE \"course.lib\"\n\nPROC hello.world(CHAN OF BYTE screen!)\n out.string(\"Hello, world!*n\", 0, screen!)\n:\n","or without using course.lib \n","PROC hello.world(CHAN OF BYTE screen!)\n SEQ\n screen ! 'H'\n screen ! 'e'\n screen ! 'l'\n screen ! 'l'\n screen ! 'o'\n screen ! ','\n screen ! ' '\n screen ! 'w'\n screen ! 'o'\n screen ! 'r'\n screen ! 'l'\n screen ! 'd'\n screen ! '!'\n screen ! '*n'\n:\n","OpenScript","-- in a popup window\nrequest \"Hello world\"\n","OPL","PROC hello:\n PRINT \"Hello, world!\"\nENDP\n","OPS5"," ( object-class request \n ^action ) \n \n ( startup \n ( strategy MEA ) \n ( make request ^action hello ) \n ) \n \n ( rule hello \n ( request ^action hello ) \n ( write |Hello, world!| ( crlf )) \n ) \n","OPS83","module hello (main)\n{ procedure main( )\n {\n write() |Hello, world!|, '\\n';\n };\n};\n","Oz","{Browse 'Hello, world!'}\n","Parrot assembly language"," print \"Hello, world!\\n\" \n end \n","Parrot intermediate representation"," .sub hello :main \n print \"Hello, world!!\\n\" \n .end \n","Pascal","begin \n write ( 'Hello, world!' ) ; \nend . \n","PAWN","main () {\n print (\"Hello, World!\" );\n}\n","main () {\n new string[14 ];\n format string(sizeof (string), \"Hello, World! );\n print (string);\n}\n","Perl","As PL file"," print \"Hello, world!\\n\" ; \n","(the semicolon is optional)\n"," package Hello ; \n sub new () { bless {} } \n sub Hello () { print \"Hello, world! \\n\" } \n package main ; \n my $hello = Hello -> new (); \n $hello -> Hello (); \n","As CGI file","#!/usr/local/bin/perl \nprint \"Content-type: text/html\\n\\n\" ; \nprint \"Hello World! \" ; \n","Phix","PHP","PHP is a templating language and will echo any text not within PHP tags directly, so the simplest form is:\n","Hello , world ! \n","Using actual PHP statements, it can be written:\n","\n echo 'Hello, world!' ; \n?> \n","or use short-hand echoing, syntaxed as such:\n"," echo \"Hello, world!\" ?> \n","this will also work:\n","= \"Hello, world!\" ?> \n","Pike"," int main () { \n write ( \"Hello, world! \\n \" ); \n return 0 ; \n } \n","PILOT","T:Hello, world!\n","PL/SQL","set serveroutput on size 1000000 ; -- this is a SQL*Plus command to enable the output buffer \nbegin \n dbms_output . put_line ( 'Hello, world!' ); \nend ; \n","PL/I","Test : proc options ( main) ; \n put list( 'Hello, world!' ) ; \nend Test; \n","PostScript","See also page description language section ."," (Hello, world! \\n ) print \n","PowerShell","Write-Host \"Hello, world!\" \n","echo \"Hello, world!\" \n","[System.Console] :: WriteLine ( \"Hello, world!\" ) \n","[void][System.Reflection.Assembly] :: LoadWithPartialName ( 'System.Windows.Forms' ) \n[System.Windows.Forms.MessageBox] :: Show ( \"Hello, World!\" ) \n","Processing","println(\"Hello, world!\");\n","Progress 4GL"," display \"Hello, world!\" . \n","Prolog",":- write ( 'Hello, world!' ), nl . \n","Pure Data","#N canvas 0 0 300 300 10;\n#X obj 100 100 loadbang;\n#X msg 100 150 Hello, world!;\n#X obj 100 200 print;\n#X connect 0 0 1 0;\n#X connect 1 0 2 0;\n","Python","As a script/module","Python 2 and earlier","print \"Hello, world!\" \n","Python 3","print ( \"Hello, world!\" ) \n","This also works on Python 2.4 or later, but in an unintuitive way. In Python 3, it calls the ","print"," function with the string ",". In Python 2, it executes the "," statement with the expression ","(\"Hello, world!\")",", which evaluates to the string ",".\n","Any Python version","import sys \nsys . stdout . write ( \"Hello, world! \\n \" ) \n","In Python 2.6 or later:\n","from __future__ import print_function \nprint ( \"Hello, world!\" ) \n","Two easter eggs","import __hello__ \nimport __phello__ \n","Using Curves","from math import cos , sin \n \ndef f ( x ): \n return int ( round ( 96.75 + - 21.98 * cos ( x * 1.118 ) + 13.29 * sin ( x * 1.118 ) + - 8.387 * cos ( 2 * x * 1.118 ) \\\n + 17.94 * sin ( 2 * x * 1.118 ) + 1.265 * cos ( 3 * x * 1.118 ) + 16.58 * sin ( 3 * x * 1.118 ) \\\n + 3.988 * cos ( 4 * x * 1.118 ) + 8.463 * sin ( 4 * x * 1.118 ) + 0.3583 * cos ( 5 * x * 1.118 ) \\\n + 5.878 * sin ( 5 * x * 1.118 ))) \n \nprint ( \"\" . join ([ chr ( f ( x )) for x in range ( 12 )])) \n","In the REPL","'Hello, world!' (with quotation marks) can be attained through:\n","'Hello, world!'","#!/usr/local/bin/python \nprint ( \"Content-type: text/html \\n\\n \" ) \nprint ( \"Hello World!\" ) \n","Flask","As Python's Flask web microframework \n","from flask import Flask \napp = Flask ( __name__ ) \n\n@app . route ( \"/\" ) \ndef hello (): \n return \"Hello World!\" \n\napp . run () \n","R","print ( 'Hello, world!' ) \n","Raku","\"Hello, world!\" .say \n","say \"Hello, world!\" ;\n","print \"Hello, world!\\n\" ;\n","Rebol","print \"Hello, world!\"\n","Red","Redcode","REFAL","$ENTRY GO{=;}\n","Revolution","(This works the same for Transcript or xTalk)\n","Printed in the message box","put \"Hello, World!\" \n","Shown within a dialog box","answer \"Hello, world!\" \n","Printed on the main window interface","create field \"myField\" \nset the text of field \"myField\" to \"Hello, world!\" \n","#!revolution \n\non startup \n put \"Content-Type: text/plain\" & cr & cr \n put \"Hello World!\" \nend startup \n","REXX, ARexx, NetRexx, and Object REXX"," /* a starting comment is needed in mainframe versions */ \n say \"Hello, world!\" \n","Ring"," see \"hello world!\"","RPG","Free-Form Syntax","/FREE\n\n DSPLY 'Hello, world!';\n\n *InLR = *On;\n\n/END-FREE \n","Traditional Syntax","With this syntax, a constant has to be used because the message must be placed in positions 12 to 25, between apostrophes.\n"," d TestMessage c Const( 'Hello, world!' )\n\n c TestMessage DSPLY\n\n c EVAL *InLR = *On\n","RPG Code","Message Window","Using the internal message window, a simple Hello, world! program can be rendered thus:\n","mwin(\"Hello, world!\")\nwait()\n","On Screen Text","An additional way to render text is by using the built in text() function.\n","text(1,1,\"Hello, world!\")\nwait()\n","RPL","(On Hewlett-Packard HP-28, HP-48 and HP-49 series graphing calculators.)\n","<<\n CLLCD\n \"Hello, world!\" 1 DISP\n 0 WAIT\n DROP\n>>\n","RT Assembler","_name Hello~World!\npause Hello~World!\nexit\n_end\n","Ruby","puts 'Hello, world!' \n","'Hello, world!' . each { | s | print s } \n","class String \n def say \n puts self \n end \nend \n'Hello, world!' . say \n","Rust","fn main () { \n println! ( \"Hello, world!\" ); \n} \n","S (and R)","message ( \"Hello, world\" ) \n","S-Lang","message(\"Hello, world!\");\n","SAS","%put Hello, world!; \n","Sather","class HELLO_WORLD is\n main is \n #OUT+\"Hello, world!\\n\"; \n end; \nend;\n","Scala","object HelloWorld extends App { \n println ( \"Hello, world!\" ) \n} \n","App was introduced since Scala 2.1, and Application was deprecated since Scala 2.9.0. Use Application instead of App for versions below 2.1.\n","SCAR"," program HelloWorld ; \n begin \n WriteLn ( 'Hello world!' ) ; \n end . \n","( display \"Hello, World!\" ) ( newline ) \n","Scratch","sed","(Note: requires at least one line of input)\n"," sed -ne '1s/.*/Hello, world!/p' \n","Seed7","$ include \"seed7_05.s7i\";\n\nconst proc: main is func\n begin\n writeln(\"Hello, world\");\n end func;\n","Self","'Hello, world!' print.\n","sense script","out('Hello, world!');\n","ShadowScript","'set up initial variables\nstruct.follow\n {\n cpu.fan.speed(500.rpm)\n cpu.max.process(100)\n }\n<\n logic.handle(0)\n int main()\n int var()\n array.max(100000000)\n>\n'open and write the text in a free handle window\nopen mainwin(io) as free(1)\n {\n write.free(1).(\"Hello\",&sym,\" world\",&sym)(&sym<\",\">&sym<\"!\">\n apply.free(1) to text\n }\n'reset the fan, cpu, and vars\n<\n logic(std)\n fan(std.auto)\n cpu.max(auto)\n unint main()\n unint var()\n un.array.max(std)\n>\n'end\nend\n.end/\n","Simula","BEGIN\n OutText(\"Hello, world!\");\n OutImage;\nEND\n","Smalltalk","Transcript show: 'Hello, world!' \n","alternative:\n","StdoutStream nextPutLine: 'Hello, world' \n","SML","print \"Hello, world! \\n \" ; \n","SNOBOL"," OUTPUT = \"Hello, world!\" \n END \n","Span","class Hello {\n static public main: args {\n Console << \"Hello, world!\\n\";\n }\n}\n","SPARK","with Spark_IO ; \n--# inherit Spark_IO; \n--# main_program; \n\nprocedure Hello_World \n--# global in out Spark_IO.Outputs; \n--# derives Spark_IO.Outputs from Spark_IO.Outputs; \nis \nbegin \n Spark_IO . Put_Line ( Spark_IO . Standard_Output , \"Hello, world!\" , 0 ); \nend Hello_World ; \n","Spin","Spin is the high level language from Parallax Inc. used to program their Propeller multi-core micro-controllers.\n","The program assumes that the software UART object, provided with the Propeller IDE, is used to deliver the message over a serial line.\n","CON\n _clkmode = xtal1 + pll16x\n _xinfreq = 5_000_000\nOBJ\n console : \"FullDuplexSerial\"\nPUB start\n console.start(31, 30, 0, 115_200)\n console.str(string(\"Hello, world!\", 13))\n","SPITBOL","SPSS Syntax","ECHO \"Hello, world!\".\n","SSPL","1.0\nprint Hello, World!\nend\n","Standard ML","SQL"," CREATE TABLE message ( text char ( 15 )); \n INSERT INTO message ( text ) VALUES ( 'Hello, world!' ); \n SELECT text FROM message ; \n DROP TABLE message ; \n","or (for EnterpriseDB's Stored Procedure Language (SPL))\n"," BEGIN \n DBMS_OUTPUT . PUT_LINE ( 'Hello, world!' ); \n END ; \n","or (e.g. Oracle dialect)\n","SELECT 'Hello, world!' FROM dual ; \n","or (for Oracle's PL/SQL proprietary procedural language)\n"," BEGIN \n DBMS_OUTPUT . ENABLE ( 1000000 ); \n DBMS_OUTPUT . PUT_LINE ( 'Hello, world!' ); \n END ; \n","or (e.g. MySQL or PostgreSQL dialect)\n","SELECT 'Hello, world!' ; \n","or (for PostgreSQL's PL/pgSQL Procedural language)\n"," CREATE FUNCTION hello_world () RETURNS text AS $$ \n BEGIN \n RETURN 'Hello, world!' ; \n END \n $$ LANGUAGE plpgsql ; \n","or (e.g. T-SQL dialect)\n","PRINT 'Hello, world!' \n","or (for KB-SQL dialect)\n"," select Null from DATA_DICTIONARY . SQL_QUERY \n\n FOOTER '' or HEADER or DETAIL or FINAL event '' \n write \"Hello, world!\" \n","STARLET","RACINE: HELLO_WORLD.\n\nNOTIONS:\nHELLO_WORLD : ecrire(\"Hello, world!\").\n","Stata","Define program in script (.do-file) or at command line:\n"," capture program drop hello /*Define Hello, world! program*/ \n program define hello \n di \"Hello, world!\" \n end \n \n hello /*run Hello, world! program*/ \n","Or, interactively at the command line:\n","di \"Hello, world!\"\n","SuperCollider"," \"Hello, world!\" . postln ; \n","or, for interactive prompt,\n","Supernova","I want window and the window title is hello world.\n","Swift"," println ( \"Hello, world!\" ) // Swift 1.x \n\n print ( \"Hello, world!\" ) // Swift 2.x \n","TACL","#OUTPUT Hello, world!\n","Tcl (Tool command language)","puts \"Hello, world!\" \n","Template Toolkit","[% GET \"Hola mundo!\"; %]\n","Or the English version:\n","[% GET \"Hello world!\"; %]\n","Thyme"," print (\"Hello, world!\")\n","TOM (rewriting language)"," public class HelloWorld { \n % include { string . tom } \n public final static void main ( String [] args ) { \n String who = \"world\" ; \n % match ( String who ) { \n \"World\" -> { System . out . println ( \"Hello, \" + who + \"!\" ); } \n _ -> { System . out . println ( \"Don't panic\" ); } \n } \n } \n","TSQL","Declare @Output varchar ( 16 ) \nSet @Output = 'Hello, world!' \nSelect 'Output' = @Output \n","or, simpler variations:\n","Select 'Hello, world!' \nPrint 'Hello, world!' \n","TTCN-3","module hello_world {\n control {\n log(\"Hello, world!\");\n }\n}\n","Turing","put \"Hello world!\"\n","UNIX-style shell"," echo 'Hello, world!' \n","or using an inline 'here document'\n"," cat <<'DELIM' \n Hello, world! \n DELIM \n"," printf '%s' $'Hello, world!\\n' \n","or for a curses interface:\n"," dialog --msgbox 'Hello, world!' 0 0 \n","Vala","using GLib ; \n\npublic int main ( string [] args ) \n{ \n stdout . printf ( \"Hello, world! \\n \" ); \n return 0 ; \n} \n","Verilog","module main (); \n initial begin \n # 0 $display ( \"Hello, world!!\" ); \n # 1 $finish ; \n end \nendmodule \n","or (a little more complicated)\n","module hello ( clk ); \n input clk ; \n always @( posedge clk ) $display ( \"Hello, world!!\" ); \nendmodule \nmodule main (); \n reg clk ; \n hello H1 ( clk ); \n initial begin \n # 0 clk = 0 ; \n # 5 clk = 1 ; \n # 1 $finish ; \n end \nendmodule \n","module hello ( clk ); \n input clk ; \n always @( posedge clk ) $display ( \"Hello, world!!\" ); \nendmodule \nmodule main (); \n reg clk ; \n hello H1 ( clk ); \n initial begin \n # 0 clk = 0 ; \n # 23 $display ( \"--23--\" ); \n # 100 $finish ; \n end \n always # 5 clk =~ clk ; \nendmodule \n","VHDL","use std.textio. all ; \n\nentity Hello is \nend Hello ; \n\narchitecture Hello_Arch of Hello is \nbegin \n p : process \n variable l : line ; \n begin \n write ( l , String '( \"Hello, world!\" )); \n writeline ( output , l ); \n wait ; \n end process ; \nend Hello_Arch ; \n","Visual Basic Script","WScript . Echo \"Hello, world!\" \n","OR as a VBscript file\n","MsgBox \"Hello, world!\" \n","Visual Prolog","#include @\" pfc\\console\\console.ph \" \n\ngoal \n console :: init (), \n stdio :: write ( \" Hello, world! \" ). \n","VRML (Virtual Reality Modeling Language)","#X3D V3.3 utf8 \nShape { \n geometry Text { \n string [ \"hello, world\" ] \n } \n} \n","Web Assembly"," ( module \n ( type $type0 ( func ( result i32 ))) \n ( table 0 any func ) \n ( memory 1 ) \n ( export \"memory\" memory ) \n ( export \"hello\" $func0 ) \n ( func $func0 ( result i32 ) \n i32.const 16 \n ) \n ( data ( i32.const 16 ) \n \"Hello World \\00 \" \n ) \n ) \n","X#","sub:main\nload:mscorlib.dll\npush:Hello, World!\ninvoke:mscorlib.dll:System.Console:Write:1\nendsub\n","X3D (Extensible 3D)"," profile= 'Immersive' version= '3.3' > \n \n \n string= '\"hello, world\"' /> \n \n \n \n","XC","XC is a C like language from XMOS Ltd offering features supporting Communicating Sequential Processes on their multi-threaded, multi-core processors.\nThis example shows some of those features.\n","XL"," use XL.UI.CONSOLE\n WriteLn \"Hello, world!\"\n"," import IO = XL.UI.CONSOLE\n IO.WriteLn \"Hello, world!\"\n","XMLmosaic"," \n XMLmosaic Class \n \n id= \"1\" > Main \n id= \"1\" > void Main()\n{\nConsole.WriteLine('Hello World!');\n}\n
\n \n \n 1 \n \n \n","Yorick","write, \"Hello, world!\";\n","Note: The semicolon is optional.\n","Zdzich","Programming language with commands in Polish. Webpage \n","pisz Hello World!\nkoniec\n","Graphical user interfaces (GUIs)","ActionScript (Adobe Flash)","this . createTextField ( \"hello_txt\" , 0 , 10 , 10 , 100 , 20 ); \nthis . hello_txt . text = \"Hello, world!\" ; \n","display dialog \"Hello, world!\" buttons { \"OK\" } default button 1 \n","import System . Drawing \nimport System . Windows . Forms \nf = Form () \nf . Controls . Add ( Label ( Text : \"Hello, world!\" , Location : Point ( 40 , 30 ))) \nf . Controls . Add ( Button ( Text : \"Ok\" , Location : Point ( 50 , 55 ), Click : { Application . Exit ()})) \nApplication . Run ( f ) \n","Functional equivalent of C# program below.\n","Simply, using Message Box:\n"," public class HelloWorld \n { \n static void Main () \n { \n System . Windows . Forms . MessageBox . Show ( \"Hello, world!\" ); \n } \n } \n","Or:\n","Clarion","The simplest way to achieve this is with the built in message function that is similar to the windows messageBox().\n"," PROGRAM\n MAP\n END\n CODE\n MESSAGE('Hello, world!!','Clarion')\n RETURN\n","A more real world example uses a Clarion structure to declare a window and the Clarion Accept loop to process events from that window.\n"," PROGRAM\n MAP\nHelloProcedure PROCEDURE()\n END\n\n CODE\n HelloProcedure()\n RETURN\n\nHelloProcedure PROCEDURE()\nWindow WINDOW('Clarion for Windows'),AT(,,222,116),FONT('Tahoma',8,,FONT:regular),ICON('Hey.ICO'), |\n SYSTEM,GRAY\n STRING('Hello, world!!'),AT(91,22),USE(?String1)\n BUTTON('Close'),AT(92,78,37,14),USE(?CloseBtn),LEFT\n END\n CODE\n OPEN(Window)\n ACCEPT\n CASE ACCEPTED()\n OF ?CloseBtn\n POST(EVENT:CloseWindow)\n END\n END\n CLOSE(Window)\n RETURN\n","Cocoa or GNUStep (In Objective C)","#import \n@interface hello : NSObject { \n} \n@end \n\n@implementation hello \n\n-( void ) awakeFromNib \n{ \n NSBeep (); // we don't need this but it's conventional to beep \n // when you show an alert \n NSRunAlertPanel ( @\"Message from your Computer\" , @\"Hello, world!\" , @\"Hi!\" , \n nil , nil ); \n} \n\n@end \n","Curl","{curl 3.0, 4.0 applet}\n{curl-file-attributes character-encoding = \"utf-8\"}\n\nHello, world!\n","Delphi, Kylix","program Hello_World ; \nuses \n QDialogs ; \n\nbegin \n ShowMessage ( 'Hello, world!' ) ; \nend . \n","program Hello_World ; \nuses \n QDialogs ; \n\nbegin \n MessageDlg ( 'Hello, world!' , mtInformation , [ mbOk ] , 0 ) ; \nend . \n","- module ( hello_world ). \n- export ([ hello / 0 ]). \n\nhello () -> \n S = gs : start (), \n Win = gs : create ( window , S , [{ width , 100 }, { height , 50 }]), \n gs : create ( label , Win , [{ label , { text , \"Hello, world!\" }}]), \n gs : config ( Win , { map , true }), \n receive \n { gs , Win , destroy , _, _} -> \n gs : stop () \n end , \n ok . \n","One way of invoking this would be to enter ","hello_world:hello()."," in the Erlang shell; another would be to run from a command line:\n","erl -noshell -run hello_world hello -run init stop\n","MS-Windows only - basic.\n","include msgbox.e\nif message_box(\"Hello, world!\", \"Hello\", 0) then end if\n","MS-Windows only - using Win32Lib library\n","include win32lib.ew\ncreateForm({\n \";Window; Hello\",\n \";Label; Hello, world!\"\n })\ninclude w32start.ew\n","Using WindowsForms, at the F# interactive prompt:\n","let _ = System . Windows . Forms . MessageBox . Show ( \"Hello, world!\" );; \n","FLTK2 (in C++)","#include \n#include \n#include \nusing namespace fltk ; \n\nint main ( int argc , char ** argv ) \n{ \n Window * window = new Window ( 300 , 180 ); \n window -> begin (); \n Widget * box = new Widget ( 20 , 40 , 260 , 100 , \"Hello, world!\" ); \n box -> box ( UP_BOX ); \n box -> labelfont ( HELVETICA_BOLD_ITALIC ); \n box -> labelsize ( 36 ); \n box -> labeltype ( SHADOW_LABEL ); \n window -> end (); \n window -> show ( argc , argv ); \n\n return run (); \n } \n","G (LabVIEW)","PUBLIC SUB Main()\n Message.Info(\"Hello, world!\")\nEND\n","Gtk# (in C#)","using Gtk ; \nusing GtkSharp ; \nusing System ; \n\nclass Hello { \n\n static void Main () \n { \n Application . Init (); \n\n Window window = new Window ( \"\" ); \n window . DeleteEvent += cls_evn ; \n Button close = new Button ( \"Hello, world!\" ); \n close . Clicked += new EventHandler ( cls_evn ); \n\n window . Add ( close ); \n window . ShowAll (); \n\n Application . Run (); \n\n } \n\n static void cls_evn ( object obj , EventArgs args ) \n { \n Application . Quit (); \n } \n\n} \n","GTK+ 2.x (in Euphoria)","include gtk2/wrapper.e\n\nInfo(NULL,\"Hello\",\"Hello, world!\")","IOC/OCL (in IBM VisualAge for C++)","#include \nvoid main () \n{ \n IFrameWindow frame ( \"Hello, world!\" ); \n frame . showModally () \n} \n","Swing","import javax.swing.* ; \n\nclass HelloWorld { \n\n public static void main ( final String [] args ) { \n JFrame frame = new JFrame (); \n frame . add ( new JLabel ( \"Hello World\" , SwingConstants . CENTER )); \n frame . setSize ( 200 , 100 ); \n frame . setLocationRelativeTo ( null ); \n frame . setVisible ( true ); \n frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE ); \n } \n\t \n} \n","JavaFX and FXML files","package example ; \n\npublic class FXMLDocumentController extends Application implements Initializable { \n \n @Override \n public void start ( Stage stage ) throws Exception { \n Parent root = FXMLLoader . load ( getClass (). getResource ( \"FXMLDocument.fxml\" )); \n Scene scene = new Scene ( root ); \n stage . setScene ( scene ); \n stage . show (); \n } \n\n @FXML \n private Label label ; \n \n @Override \n public void initialize ( URL url , ResourceBundle rb ) { \n label . setText ( \"Hello World!\" ); \n } \n \n public static void main ( String [] args ) { \n launch ( args ); \n } \n \n} \n"," \n\n \n \n \n \n \n\n id= \"AnchorPane\" prefHeight= \"200\" prefWidth= \"320\" xmlns:fx= \"http://javafx.com/fxml/1\" fx:controller= \"example.FXMLDocumentController\" > \n \n layoutX= \"126\" layoutY= \"80\" minHeight= \"16\" minWidth= \"69\" fx:id= \"label\" /> \n \n \n","GTK (java-gnome)","import org.gnome.gdk.* ; \n\nclass GdkSimple extends Window { \n\n public GdkSimple () { \n setTitle ( \"Example\" ); \n connect (( DeleteEvent )( source , event ) -> { \n Gtk . mainQuit (); \n return false ; \n }); \n add ( new Label ( \"Hello World\" )); \n setDefaultSize ( 250 , 150 ); \n setPosition ( WindowPosition . CENTER ); \n show (); \n } \n\n public static void main ( String [] args ) { \n Gtk . init ( args ); \n new GdkSimple (); \n Gtk . main (); \n } \n} \n","This creates a window labeled \"Hello, world!\" with a button labeled \"Hello, world!\".\n","hello : hello..l : \"Hello, world!\" \nhello..c : `button \n`show $ `hello \n","Microsoft Foundation Classes (in C++)","Adobe Flex MXML"," \n xmlns:mx= \"http://www.adobe.com/2006/mxml\" > \n text= \"Hello, world!\" /> \n \n","NSIS","This creates a message box saying \"Hello, world!\".\n","OutFile \"HelloWorld.exe\" \nName \"Hello, world!\" \nCaption \"Hello, world!\" \n\nSection Hello, world! \nSectionEnd \n\nFunction .onInit\n MessageBox MB_OK \"Hello, world!\" \n Quit \nFunctionEnd \n"," Uses lablgtk ","let () = \n let window = GWindow . window ~ title : \"Hello\" ~ border_width : 10 () in \n window # connect # destroy ~ callback : GMain . Main . quit ; \n let button = GButton . button ~ label : \"Hello World\" ~ packing : window # add () in \n button # connect # clicked ~ callback : window # destroy ; \n window # show () ; \n GMain . Main . main () \n","(On Psion Series 3 and later compatible PDAs.)\n","PROC guihello:\n ALERT(\"Hello, world!\",\"\",\"Exit\")\nENDP\n","PROC hello:\n dINIT \"Window Title\"\n dTEXT \"\",\"Hello, world!\"\n dBUTTONS \"OK\",13\n DIALOG\nENDP\n","Patch as ASCII-art:\n","[Hello, world!(\n|\n[print]\n","Patch as sourcecode:\n","#N canvas 0 0 300 300 10;\n#X msg 100 150 Hello, world!;\n#X obj 100 200 print;\n#X connect 0 0 1 0;\n","Tkinter","from Tkinter import Tk , Label \n \nroot = Tk () \nLabel ( root , text = \"Hello, world!\" ) . pack () \n \nroot . mainloop () \n","Using PyQt:\n","import sys \nfrom PyQt4.QtCore import * \nfrom PyQt4.QtGui import * \n\napp = QApplication ( sys . argv ) \nlabel = QLabel ( \"Hello, World!\" ) \nlabel . show () \nsys . exit ( app . exec_ ()) \n","PyGTK","from gtk import * \n\nlabel = Label ( \"Hello, world!\" ) \nlabel . show () \n\nwindow = Window () \nwindow . add ( label ) \nwindow . show () \n\nmain () \n","Pygame","import pygame \nimport sys \n\npygame . init () \nscreen = pygame . display . set_mode (( 512 , 256 ), 0 , 32 ) \nf = pygame . font . SysFont ( None , 32 ) \nt = f . render ( \"Hello, world!\" , True , ( 255 , 255 , 255 )) \ntR = t . get_rect () \nscreen . blit ( t , tR ) \nwhile True : \n for event in pygame . event . get (): \n if event . type == pygame . QUIT : \n pygame . quit () \n sys . exit () \n pygame . display . update () \n","Kivy","Kivy multi-platform framework\n","import kivy \n\nfrom kivy.app import App \nfrom kivy.uix.label import Label \n\nclass MyApp ( App ): \n def build ( self ): \n return Label ( text = 'Hello world' ) \n\nMyApp () . run () \n","Qt toolkit (in C++)"," #include \n #include \n\n int main ( int argc , char * argv []) \n { \n QApplication app ( argc , argv ); \n QMessageBox :: information ( 0 , \"Qt4\" , \"Hello World!\" ); \n } \n"," #include \n #include \n #include \n \n int main ( int argc , char * argv []) \n { \n QApplication app ( argc , argv ); \n \n QWidget * window = new QWidget ; \n QVBoxLayout * layout = new QVBoxLayout ( window ); \n QPushButton * hello = new QPushButton ( \"Hello, world!\" , window ); \n \n //connect the button to quitting \n hello -> connect ( hello , SIGNAL ( clicked ()), & app , SLOT ( quit ())); \n \n layout -> addWidget ( hello ); \n layout -> setMargin ( 10 ); \n layout -> setSpacing ( 10 ); \n \n window -> show (); \n \n return app . exec (); \n } \n"," view layout [text \"Hello, world!\" ]\n"," view [text \"Hello, world!\" ]\n","Robotic (MegaZeux)","* \"Hello, world!\"\nend\n","(On Hewlett-Packard HP-48G and HP-49G series calculators.)\n","<< \"Hello, world!\" MSGBOX >>\n","RTML","Hello ()\nTEXT \"Hello, world!\"\n","Ruby with WxWidgets","require 'wxruby' \n\nclass HelloWorldApp < Wx :: App \n def on_init \n ourFrame = Wx :: Frame . new ( nil , - 1 , \"Hello, world!\" ) . show \n ourDialogBox = Wx :: MessageDialog . new ( ourFrame , \"Hello, world!\" , \"Information:\" , \\ \n Wx :: OK | Wx :: ICON_INFORMATION ) . show_modal \n end \nend \n\nHelloWorldApp . new . main_loop \n","Ruby with GTK+","require 'gtk2' \n\nGtk . init \nwindow = Gtk :: Window . new \nwindow . signal_connect ( \"delete_event\" ) { Gtk . main_quit ; false } \nbutton = Gtk :: Button . new ( \"Hello, world!\" ) \nbutton . signal_connect ( \"clicked\" ) { Gtk . main_quit ; false } \nwindow . add ( button ) \nwindow . show_all \nGtk . main \n","Ruby with Tk","require 'tk' \n\nwindow = TkRoot . new { title 'Hello, world!' } \nbutton = TkButton . new ( window ) { \n text 'Hello, world!' \n command proc { exit } \n pack \n} \n\nTk . mainloop \n","Evaluate in a workspace:\n","Dialog confirm: 'Hello, world!' \n","Using the Morphic GUI toolkit of Squeak Smalltalk:\n"," ('Hello, world!' asMorph openInWindow ) submorphs second color: Color black \n","Using wxSqueak:\n","Wx messageBox: 'Hello, world!' \n","SWT with Java","Tk","label .l -text \"Hello, world!\"\npack .l\n","and the same in one line\n","pack [label .l -text \"Hello, world!\"]\n","Tcl with Tk","package require Tk\ntk_messageBox - message \"Hello, world!\" \n","package require Tk\npack [ button .b - text \"Hello, world!\" - command exit] \n","Ubercode"," Ubercode 1 class Hello\n public function main()\n code\n call Msgbox(\"Hello\", \"Hello, world!\")\n end function\n end class\n","Uniface"," message \"Hello, world!\"\n","Virtools","void main () \n{ \n String s = \"Hello World.\" ; \n bc . OutputToConsole ( s ); \n} \n","VBA","Sub Main () \n MsgBox \"Hello, world!\" \nEnd Sub \n","Visual Basic .NET 2003/2005","Private Sub Form_Load ( ByVal sender As Object , ByVal e As System . EventArgs ) Handles MyBase . Load \n MessageBox . Show ( \"Hello, world!\" ) \n Me . Close () \nEnd Sub \n","Note that the previous example will only work when the code is entered as part of a Form Load Event, such as the one created by default when generating a new project in the Visual Studio programming environment. Equivalently, the following code is roughly equivalent to the traditional Visual Basic 6 code by disabling the Application Framework and setting 'Sub Main' as the entry point for the application:\n","Public Module MyApplication \n Sub Main () \n MessageBox . Show ( \"Hello, world!\" ) \n End Sub \nEnd Class \n","or using a class;\n","Public Class MyApplication \n Shared Sub Main () \n MessageBox . Show ( \"Hello, world!\" ) \n End Sub \nEnd Class \n","Visual Prolog (note box)","#include @\" pfc\\vpi\\vpi.ph \" \n\ngoal \n vpiCommonDialogs :: note ( \" Hello, world! \" ). \n","Windows API (in C)","This uses the Windows API to create a full window containing the text.\n","Xojo","In the Open event handler of the default window:\n","MsgBox ( \"Hello world!\" ) \n","XUL"," \n \n id= \"yourwindow\" xmlns= \"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul\" > \n value= \"Hello, World!\" /> \n \n"," with ( Maplets ) : \n with ( Maplets [ Elements ]) : \n maplet := Maplet ( [[ \"Hello world!\" ]] ) : \n Display ( maplet ) ; \n","Document formats","ASCII","The following sequence of characters, expressed in hexadecimal notation (with carriage return and newline characters at end of sequence):\n","48 65 6C 6C 6F 2C 20 77 6F 72 6C 64 21 0D 0A\n","The following sequence of characters, expressed as binary numbers (with cr/nl as above, and the same ordering of bytes):\n","00-07: 01001000 01100101 01101100 01101100 01101111 00101100 00100000 01110111\n08-0E: 01101111 01110010 01101100 01100100 00100001 00001101 00001010\n","Page description languages","XHTML 1.1","(Using UTF-8 character set.)\n"," \n \n < html xmlns = \"http://www.w3.org/1999/xhtml\" > \n < head > \n < title > Hello, world!title > \n head > \n < body > \n < p > Hello, world!p > \n body > \n html > \n","HTML","Simple","< html > \n < body > \n Hello, world!\n body > \nhtml > \n","Informal","The and tags are not necessary for informal testing.\nSimply write it as text without tags.\n","HTML 4.01 Strict (full)"," \n< html > \n < head > \n < title > Hello, world!title > \n head > \n < body > \n < p > Hello, world!p > \n body > \nhtml > \n","The first paragraph of the W3C Recommendation on The global structure of an HTML document also features this example.\n","HTML 4.01 Strict (smallest)","This is the smallest legal version, leaving out all optional tags\n"," \n< title > Hello, world!title > \n< p > Hello, world!\n","HTML 5"," \n< html > \n < head > \n < title > Hello, World!title > \n head > \n < body > \n < h1 > Hello, world!h1 > \n body > \nhtml > \n","Markdown","Hello, World!\n","MediaWiki/Wikitext","PDF","%PDF-1.0\n1 0 obj\n<<\n/Type /Catalog\n/Pages 3 0 R\n/Outlines 2 0 R\n>>\nendobj\n2 0 obj\n<<\n/Type /Outlines\n/Count 0\n>>\nendobj\n3 0 obj\n<<\n/Type /Pages\n/Count 1\n/Kids [4 0 R]\n>>\nendobj\n4 0 obj\n<<\n/Type /Page\n/Parent 3 0 R\n/Resources << /Font << /F1 7 0 R >>/ProcSet 6 0 R\n>>\n/MediaBox [0 0 612 792]\n/Contents 5 0 R\n>>\nendobj\n5 0 obj\n<< /Length 44 >>\nstream\nBT\n/F1 24 TF\n100 100 Td (Hello, world!) Tj\nET\nendstream\nendobj\n6 0 obj\n[/PDF /Text]\nendobj\n7 0 obj\n<<\n/Type /Font\n/Subtype /Type1\n/Name /F1\n/BaseFont /Helvetica\n/Encoding /MacRomanEncoding\n>>\nendobj\nxref\n0 8\n0000000000 65535 f\n0000000009 00000 n\n0000000074 00000 n\n0000000120 00000 n\n0000000179 00000 n\n0000000322 00000 n\n0000000415 00000 n\n0000000445 00000 n\ntrailer\n<<\n/Size 8\n/Root 1 0 R\n>>\nstartxref\n553\n%%EOF\n","This is a valid PDF only if the text file has CRLF line endings.\n"," % Displays on console. \n (Hello, world!) = \n"," %! \n % Displays as page output. \n /Courier findfont \n 24 scalefont \n setfont \n 100 100 moveto \n (Hello, world!) show \n showpage \n","RTF","{\\rtf1\\ansi\\deff0\n{\\fonttbl {\\f0 Courier New;}}\n\\f0\\fs20 Hello, world!\n}\n","SVG"," \n xmlns= \"http://www.w3.org/2000/svg\" width= \"200\" height= \"100\" > \n x= \"50\" y= \"50\" > Hello, world! \n \n","TeX"," Hello, world!\n \\bye \n","LaTeX 2ε"," \\documentclass { article} \n \\begin { document} \n Hello, world!\n \\end { document} \n","ConTeXt"," \\starttext \n Hello, world!\n \\stoptext \n","Media-based scripting languages","AviSynth"," BlankClip()\n Subtitle(\"Hello, world!\")\n","(Creates a video with default properties)\n","Lingo (Macromedia Director scripting language)","on exitFrame me\n put \"Hello, world!\" \nend\n","Outputs the string to the message window if placed in a single movie frame. Alternatively, to display an alert box stating the message you could use\n","on exitFrame me\n alert \"Hello, world!\"\nend\n","POV-Ray"," #include \"colors.inc\" \n camera { \n location < 3 , 1 , - 10 > \n look_at < 3 , 0 , 0 > \n } \n light_source { < 500 , 500 , - 1000 > White } \n text { \n ttf \"timrom.ttf\" \"Hello, world!\" 1 , 0 \n pigment { White } \n } \n","Esoteric programming languages","This page shows the Hello, world! program in esoteric programming languages — that is, working programming languages that were designed as experiments or jokes and were not intended for serious use.\n","0815","<:48:x<:65:=<:6C:$=$=$$~<:03:+$<:2c:~$~<:c:x-$<:77:\n~$~<:8:x-$~<:03:+$~<:06:x-$x<:0e:x-$=x<:43:x-$\n","Alef++"," use java . lang . * ; \n main \n { \n System -> out -> println [ ' Hello , world ! ' ] ; \n } \n","Arrow"," ■→→■↓■←■←■↓■→→■ /* makes H */\n →→■↓■↑↑↑■ /* makes I */\n","Befunge"," \"!dlrow olleH\" >v \n : \n , \n ^ _@ \n"," v v \"Hello, world!!\" < \n > ^ \n > > : # v _@ \n ^ . < \n"," 0 \"!dlrow olleH\" > ,: # < _@ \n","Binary lambda calculus","As documented at http://www.ioccc.org/2012/tromp/hint.html \n(any of the 16 ASCII characters from ' ' to '/' can be used at the start)\n"," !Hello, world\n","BlooP, FlooP","From Eric Raymond's interpreter package (changed to use upper case as in the book).\n"," DEFINE PROCEDURE ''HELLO-WORLD''[N]:\n BLOCK 0: BEGIN\n PRINT['Hello, world!'];\n BLOCK 0: END.\n","brainfuck","+++++ +++++ initialize counter (cell #0) to 10 \n[ use loop to set the next four cells to 70/100/30/10 \n > +++++ ++ add 7 to cell #1 \n > +++++ +++++ add 10 to cell #2 \n > +++ add 3 to cell #3 \n > + add 1 to cell #4 \n <<<< - decrement counter (cell #0) \n] \n> ++ . print 'H' \n> + . print 'e' \n+++++ ++ . print 'l' \n. print 'l' \n+++ . print 'o' \n> ++ . print ' ' \n<< +++++ +++++ +++++ . print 'W' \n> . print 'o' \n+++ . print 'r' \n----- - . print 'l' \n----- --- . print 'd' \n> + . print '!' \n> . print '\\n' \n","Chef","Hello, world! Souffle by David Morgan-Mar.\n","Hello World Souffle.\n\nThis recipe prints the immortal words \"Hello world!\", in a basically brute force way. It also makes a lot of food for one person.\n\nIngredients.\n72 g haricot beans\n101 eggs\n108 g lard\n111 cups oil\n32 zucchinis\n119 ml water\n114 g red salmon\n100 g dijon mustard\n33 potatoes\n\nMethod.\nPut potatoes into the mixing bowl.\nPut dijon mustard into the mixing bowl.\nPut lard into the mixing bowl. \nPut red salmon into the mixing bowl.\nPut oil into the mixing bowl.\nPut water into the mixing bowl.\nPut zucchinis into the mixing bowl.\nPut oil into the mixing bowl.\nPut lard into the mixing bowl.\nPut lard into the mixing bowl.\nPut eggs into the mixing bowl.\nPut haricot beans into the mixing bowl.\nLiquefy contents of the mixing bowl.\nPour contents of the mixing bowl into the baking dish.\n\nServes 1.\n","Later Mike Worth wrote tastier and actually functional recipe .\n","Hello World Cake with Chocolate sauce.\n\nThis prints hello world, while being tastier than Hello World Souffle. The main\nchef makes a \" world!\" cake, which he puts in the baking dish. When he gets the\nsous chef to make the \"Hello\" chocolate sauce, it gets put into the baking dish\nand then the whole thing is printed when he refrigerates the sauce. When\nactually cooking, I'm interpreting the chocolate sauce baking dish to be\nseparate from the cake one and Liquify to mean either melt or blend depending on\ncontext.\n\nIngredients.\n33 g chocolate chips\n100 g butter\n54 ml double cream\n2 pinches baking powder\n114 g sugar\n111 ml beaten eggs\n119 g flour\n32 g cocoa powder\n0 g cake mixture\n\nCooking time: 25 minutes.\n\nPre-heat oven to 180 degrees Celsius.\n\nMethod.\nPut chocolate chips into the mixing bowl.\nPut butter into the mixing bowl.\nPut sugar into the mixing bowl.\nPut beaten eggs into the mixing bowl.\nPut flour into the mixing bowl.\nPut baking powder into the mixing bowl.\nPut cocoa powder into the mixing bowl.\nStir the mixing bowl for 1 minute.\nCombine double cream into the mixing bowl.\nStir the mixing bowl for 4 minutes.\nLiquify the contents of the mixing bowl.\nPour contents of the mixing bowl into the baking dish.\nbake the cake mixture.\nWait until baked.\nServe with chocolate sauce.\n\nchocolate sauce.\n\nIngredients.\n111 g sugar\n108 ml hot water\n108 ml heated double cream\n101 g dark chocolate\n72 g milk chocolate\n\nMethod.\nClean the mixing bowl.\nPut sugar into the mixing bowl.\nPut hot water into the mixing bowl.\nPut heated double cream into the mixing bowl.\ndissolve the sugar.\nagitate the sugar until dissolved.\nLiquify the dark chocolate.\nPut dark chocolate into the mixing bowl.\nLiquify the milk chocolate.\nPut milk chocolate into the mixing bowl.\nLiquify contents of the mixing bowl.\nPour contents of the mixing bowl into the baking dish.\nRefrigerate for 1 hour.\n","False","\"Hello, World!\n\"\n","The newline before the terminating quote mark is necessary.\n","HQ9+","H\n","INTERCAL programming language","LOLCODE","HAI;\n CAN HAS STDIO?;\n VISIBLE \"Hello, World!\";\nKTHXBYE;","LOLGraphics","HAI 3.4 0 100\nIM IN UR CODE EXECUTIN UR KOMANDZ\n\nPLZ PRINT TEXT HELLO WORLD!\n \nIM OUTTA UR CODE\n","Malbolge programming language","(=<`:9876Z4321UT.-Q+*)M'&%$H\"!~}|Bzy?=|{z]KwZY44Eq0/{mlk**hKs_dG5[m_BA{?-Y;;Vb'rR5431M}/.zHGwEDCBA@98\\6543W10/.R,+O< hello\n","P programming language","\"Hello, world!\\n\"\n","Not really an esoteric language, but this code uses obfuscation :\n","qq chop lc and print chr ord uc q chop uc and print chr ord q ne sin and \nprint chr ord qw q le q and print chr ord q else and print chr ord q pop \nand print chr oct oct ord uc qw q bind q and print chr ord q q eq and print \nchr ord qw q warn q and print chr ord q pop and print chr ord q qr q and \nprint chr ord q else and print chr ord qw q do q and print chr hex length \nq q semctl setpgrp chop q \n","Piet","Piet programming language uses only colors. \n","Hello world in piet (see from 41:40 minute on \"The Art of Code\" on YouTube)","Rockstar","Shout \"Hello, world!\"","Shakespeare"," The Infamous Hello World Program.\n \nRomeo, a young man with a remarkable patience.\nJuliet, a likewise young woman of remarkable grace.\nOphelia, a remarkable woman much in dispute with Hamlet.\nHamlet, the flatterer of Andersen Insulting A/S.\n \n Act I: Hamlet's insults and flattery.\n \n Scene I: The insulting of Romeo.\n \n[Enter Hamlet and Romeo ] \n\nHamlet:\n You lying stupid fatherless big smelly half-witted coward!\n You are as stupid as the difference between a handsome rich brave\n hero and thyself! Speak your mind!\n\n You are as brave as the sum of your fat little stuffed misused dusty\n old rotten codpiece and a beautiful fair warm peaceful sunny summer's\n day. You are as healthy as the difference between the sum of the\n sweetest reddest rose and my father and yourself! Speak your mind!\n\n You are as cowardly as the sum of yourself and the difference\n between a big mighty proud kingdom and a horse. Speak your mind.\n\n Speak your mind!\n\n[Exit Romeo ] \n\n Scene II: The praising of Juliet.\n\n[Enter Juliet ] \n\nHamlet:\n Thou art as sweet as the sum of the sum of Romeo and his horse and his\n black cat! Speak thy mind!\n\n[Exit Juliet ] \n\n Scene III: The praising of Ophelia.\n\n[Enter Ophelia ] \n\nHamlet:\n Thou art as lovely as the product of a large rural town and my amazing\n bottomless embroidered purse. Speak thy mind!\n\n Thou art as loving as the product of the bluest clearest sweetest sky\n and the sum of a squirrel and a white horse. Thou art as beautiful as\n the difference between Juliet and thyself. Speak thy mind!\n\n[Exeunt Ophelia and Hamlet ] \n\n\n Act II: Behind Hamlet's back.\n\n Scene I: Romeo and Juliet's conversation.\n\n[Enter Romeo and Juliet ] \n\nRomeo:\n Speak your mind. You are as worried as the sum of yourself and the\n difference between my small smooth hamster and my nose. Speak your\n mind!\n\nJuliet:\n Speak YOUR mind! You are as bad as Hamlet! You are as small as the\n difference between the square of the difference between my little pony\n and your big hairy hound and the cube of your sorry little\n codpiece. Speak your mind!\n\n[Exit Romeo ] \n\n Scene II: Juliet and Ophelia's conversation.\n\n[Enter Ophelia ] \n\nJuliet:\n Thou art as good as the quotient between Romeo and the sum of a small\n furry animal and a leech. Speak your mind!\n\nOphelia:\n Thou art as disgusting as the quotient between Romeo and twice the\n difference between a mistletoe and an oozing infected blister! Speak\n your mind!\n\n[Exeunt] \n","SNUSP"," /e+++++++++++++++++++++++++++++.\\ \n ./\\/\\/\\ /+++\\!>.+++o.l.+++++++l/ #/?\\ \n$H!\\++++++\\ + \\comma.------------ .+.!\\-/\n \\!\\/\\/\\/\\/ \\++++++++++/\n","Modular SNUSP:\n"," /@@@@++++# #+++@@\\ #-----@@@\\n\n$@\\H.@/e.+++++++l.l.+++o.>>++++.< .<@/w.@\\o.+++r.++@\\l.@\\d.>+.@/.#\n \\@@@@=>++++>+++++<<@+++++# #---@@/!=========/!==/\n","Spoon (programming language)","1111110010001011111111111101100000110100010100101111111111001000101111111111011000001101 0100101011111110010100010101110010100101111001000101111111111101100000110100010100111110 0100010000000000000011000001101000101001101101101101111100100010111110110000011010001010 0100100010101110010100000000000000000000010100000000000000000000000000010100100101001010\n","Super NAND Time!!","12 (32 35 37 38 42)\n13 (35 37 38 39 43)\n14 ((31 36 39 42 43))\n15 (31 33 34 35 38 40 43)\n16 (37 39)\n17 ((31 43))\n18 ((36 42 43))\n20 ((42(43)))\n21 44\n31 ((31)(44))\n32 (32(31))\n33 (33(32))\n34 (34(33))\n35 (35(34))\n36 (36(35))\n37 (37(36))\n38 (38(37))\n39 (39(38))\n40 (40(39))\n41 (41(40))\n42 (42(41))\n43 (43(42))\n44 1\n","Taxi programming language","\"Hello, World!\" is waiting at the Writer's Depot.\nGo to Writer's Depot: west 1st left, 2nd right, 1st left, 2nd left.\nPickup a passenger going to the Post Office.\nGo to the Post Office: north 1st right, 2nd right, 1st left.\nGo to the Taxi Garage: north 1st right, 1st left, 1st right.\n","T programming language","%begin @jump $main\n%main.0 @echo %msg\n%main.1 @end\n%main.count 2\n%msg Hello, world!\n","This=That","x=Hello,world!\nx=print\n","Unlambda programming language"," `r```````````.H.e.l.l.o. .w.o.r.l.di\n","Var'aq programming language","Note: actually prints \"What do you want, universe?\" in Klingon.\n"," ~ nuqneH { ~ 'u' ~ nuqneH disp disp } name\n nuqneH\n","Whitespace","Note that whitespace has been highlighted (Space , Tab )\n","XS programming language","Hello, world! \n","Ya programming language","@ HelloWorld . Ya ; \nusing < stdio . h > ; \n$int ( $char [][] args ) main \n\t printf ( \"Hello, %s! \\n \" , args . Length > 1 ? args [ 1 ] : \"World\" ); \n\t return 0 ; \n","DUNNBOL1","A code language that draws in binary on a braille plotter.\n","BGN GRPLOT BIN\nDRAWPLOT\n\n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n0011100111001111111001110000000011100000000001111100000000001000001000011111000001111100000100000000011111110000\n0001000010000100001000100000000001000000000010000010000000001000001000100000100010000010000100000000010000001000\n0001000010000100000000100000000001000000000010000010000000001000001000100000100010000010000100000000010000001000\n0001111110000111100000100000000001000000000010000010000000001001001000100000100011111110000100000000010000001000\n0001000010000100000000100000000001000000000010000010000000001011101000100000100010000001000100000000010000001000\n0001000010000100001000100000000001000000000010000010000000001100011000100000100010000000100100000000010000001000\n0011100111001111111001111111100011111111000001111100000000001000001000011111000010000000100111111100011111110000\n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n\nENDDRAW\nEND\n","SM","The OO language looks like C.\n","use System . Windows . Forms ; \n\nclass HelloWorld extends System . Windows . Forms \n{ \n protected : \n String hw ; \n construct HelloWorld () \n { \n this . hw = 'Hello, world!' ; \n } \n public void function show () \n { \n MessageBox . show ( this . hw , '' ); \n } \n} \n","Skript+","Copy this and paste in ChatGPT, on a new chat:\n","Output: Hello, world!\n","A longer version, which still prints \"Hello, world!\":\n","CreateBuf: $Hello$\n$Hello$: {\n[H]\n[e]\n[l]\n[l]\n[o]\n[,]\n[32] @ The ASCII value for space\n[w]\n[o]\n[r]\n[l]\n[d]\n[!]\n}\nOpenBuf: $Hello$\nJoinAllChars: $Hello$ => $Hello2$\nOutput: $Hello2$\nCloseBuf: $Hello$\n","Note: The first method is tested and it's working. I don't know about the second one!\n","Retrieved from \"https://en.wikibooks.org/w/index.php?title=Computer_Programming/Hello_world&oldid=4396061 \"","Kategorie",": ","Book:Computer Programming","Hidden categories: ","Pages with syntax highlighting errors","Pages using deprecated enclose attributes","Books to be broken into subpages","Navigation menu","Personal tools","Not logged in","Discussion for this IP address","Contributions","Create account","Einloggen","Namespaces","Book","Discussion","Englisch","Ansichten","Lesen","Edit source","View history","Mehr","Navigation","Main Page","Help","Browse","Cookbook","Wikijunior","Featured books","Recent changes","Donations","Random book","Using Wikibooks","Gemeinschaft","Reading room forum","Community portal","Bulletin Board","Help out!","Policies and guidelines","Kontaktieren Sie uns","Tools","What links here","Related changes","Upload file","Special pages","Permanent link","Page information","Cite this page","Get shortened URL","Download QR code","Wikidata item","Sister projects","Wikipedia","Wikiversity","Wiktionary","Wikiquote","Wikisource","Wikinews","Wikivoyage","Commons","Wikidata","MediaWiki","Meta-Wiki","Print/export","Create a collection","Download as PDF","Printable version","In other languages","Հայերեն","Edit links"," This page was last edited on 15 May 2024, at 13:25.","Text is available under the Creative Commons Attribution-ShareAlike License ; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. ","Privacy policy","About Wikibooks","Disclaimers","Code of Conduct","Developers","Statistics","Cookie statement","Mobile view"]}
Computer Programming/Hello world
From Wikibooks, open books for an open world
Jump to navigation
Jump to search
The following is a list of Hello, world! programs.
Hello, world! programs make the text "Hello, world!" appear on a computer screen. It is usually the first program encountered when learning a programming language. Otherwise, it's a basic sanity check for an installation of a new programming language. If "Hello World" does not run, one must not try to develop complex programs before fixing the issues with the installation.
For even more languages have a look at the Hello World Collection .
Inhalt
1 4DOS batch
2 Ingres 4GL
3 ABAP/4 - SAP AG
4 ABAP Objects (NetWeaver 7)
5 ABC
6 ActionScript
7 Ada
8 ALGOL 68
9 AmigaE
10 AMX NetLinx
11 ANT
12 APL
13 AppleScript
14 ASP
15 Assembly language
15.1 Accumulator-only architecture: DEC PDP-8, PAL-III assembler
15.2 First successful uP/OS combinations: Intel 8080/Zilog Z80, CP/M, RMAC assembler
15.3 Popular home computer: ZX Spectrum, Zilog Z80, HiSoft GENS assembler
15.4 Accumulator + index register machine: MOS Technology 6502, CBM KERNEL, MOS assembler syntax
15.5 Accumulator/Index microcoded machine: Data General Nova, RDOS
15.6 Expanded accumulator machine: Intel x86, DOS, TASM
15.7 ASSEMBLER x86 (DOS, MASM)
15.8 ASSEMBLER x86 (DOS, FASM)
15.9 Expanded accumulator machine: Intel x86, Microsoft Windows, FASM
15.10 Expanded accumulator machine: Intel x86, Linux, FASM
15.11 Expanded accumulator machine: Intel x86, Linux, GAS
15.12 Expanded accumulator machine: Intel x86, Linux, NASM
15.13 Expanded accumulator machine: Intel x86, Linux, GLibC, NASM
15.14 General-purpose fictional computer: MIX, MIXAL
15.15 General-purpose fictional computer: MMIX, MMIXAL
15.16 General-purpose-register CISC: DEC PDP-11
15.17 CISC Amiga (Workbench 2.0): Motorola 68000
15.18 CISC Atari: Motorola 68000
15.19 CISC Sharp X68000 (Human68K): Motorola 68000
15.20 CISC on advanced multiprocessing OS: DEC VAX, VMS, MACRO-32
15.21 Mainframe: IBM z/Architecture series using BAL
15.22 RISC processor: ARM, RISC OS, BBC BASIC's in-line assembler
15.23 RISC processor: MIPS architecture
15.24 RISC processor: PowerPC, Mac OS X, GAS
15.25 Sigma 6/7/8/9 METASYMBOL
16 AutoHotkey
17 AutoIt
18 Avenue (scripting language for ArcView GIS)
19 AWK
20 B
21 Baan Tools
22 Bash or sh
23 BASIC
24 Batch (MS-DOS)
25 bc
26 BCPL
27 BITGGAL AgileDog
28 BITGGAL Jihwaja
29 BLISS
30 BlitzMax
31 boo
32 Burning Sand 2
33 C
34 Caché Server Pages (CSP)
35 Calprola
36 C/AL - MBS Navision
37 Casio FX-9750
38 CCL
39 Ch
40 Chuck
41 Chrome
42 CIL
43 CintieFramework (VisualBasic.NET)
44 Clean
45 Clipper
46 CLIST
47 Clojure
48 CLU
49 COBOL
50 CoffeeScript
51 ColdFusion (CFML)
52 COMAL
53 Common Lisp
54 Cube
55 C++
56 C#
57 D
58 Dart
59 DC, an arbitrary precision calculator
60 DCL batch
61 Delphi
62 DIV
63 DOLL
64 Dream Maker
65 Dylan
66 EAScripting
67 Ed and Ex (Ed extended)
68 Ecstasy (xtclang)
69 Eiffel
70 Elixir
71 Elm
72 Erlang
73 Euphoria
74 Factor
75 Falcon
76 Ferite
77 filePro
78 Fjölnir
79 FOCAL
80 Focus
81 Forte TOOL
82 Forth
83 Fortran
84 F#
85 Fril
86 Frink
87 Gambas
88 GEMBase 4GL
89 GeneXus
90 GML (Game Maker Language)
91 Go (from Google)
92 GraalScript
93 Groovy
94 Harbour
95 Haskell
96 Haxe
97 Heron
98 HP 33s
99 HP-41 & HP-42S
100 HyperTalk (Apple HyperCard's scripting programming language)
101 Icon
102 IDL
103 Io
104 Inform
105 Iptscrae
106 J
107 Jal
108 Java
109 JavaFX Script
110 JavaScript
111 JCL (mainframe Job Control Language)
112 Joy
113 JSP
114 Julia
115 K
116 ksi
117 Kotlin
118 Kogut
119 KPL (Kids Programming Language)
120 Lasso
121 Lexico Mobile (in Spanish)
122 Linden Scripting Language
123 Linotte
124 Lisaac
125 Lisp
126 Logo
127 LPC
128 Lua
129 M (MUMPS)
130 Macsyma, Maxima
131 Maple
132 Mathematica
133 MATLAB / GNU Octave
134 Maude
135 Max
136 Maya Embedded Language
137 Mesham
138 M4
139 Microbit
140 mIRC Script
141 Model 204
142 Modula-2
143 Monkey
144 MOO
145 Mouse
146 MPI
147 M# Fictional Computer Language
148 MS-DOS batch
149 MUF
150 Natural
151 Neko
152 Nemerle
153 Nim
154 NXT 2.1 (the Lego Robot program)
155 Oberon
156 Obix
157 ObjectGears
158 Objective C
159 OCaml
160 occam
161 OpenScript
162 OPL
163 OPS5
164 OPS83
165 Oz
166 Parrot assembly language
167 Parrot intermediate representation
168 Pascal
169 PAWN
170 Perl
171 Phix
172 PHP
173 Pike
174 PILOT
175 PL/SQL
176 PL/I
177 PostScript
178 PowerShell
179 Processing
180 Progress 4GL
181 Prolog
182 Pure Data
183 Python
184 R
185 Raku
186 Rebol
187 Red
188 Redcode
189 REFAL
190 Revolution
191 REXX, ARexx, NetRexx, and Object REXX
192 Ring
193 RPG
194 RPG Code
195 RPL
196 RT Assembler
197 Ruby
198 Rust
199 S (and R)
200 S-Lang
201 SAS
202 Sather
203 Scala
204 SCAR
205 Scheme
206 Scratch
207 sed
208 Seed7
209 Self
210 sense script
211 ShadowScript
212 Simula
213 Smalltalk
214 SML
215 SNOBOL
216 Span
217 SPARK
218 Spin
219 SPITBOL
220 SPSS Syntax
221 SSPL
222 Standard ML
223 SQL
224 STARLET
225 Stata
226 SuperCollider
227 Supernova
228 Swift
229 TACL
230 Tcl (Tool command language)
231 Template Toolkit
232 Thyme
233 TOM (rewriting language)
234 TSQL
235 TTCN-3
236 Turing
237 UNIX-style shell
238 Vala
239 Verilog
240 VHDL
241 Visual Basic Script
242 Visual Prolog
243 VRML (Virtual Reality Modeling Language)
244 Web Assembly
245 X#
246 X3D (Extensible 3D)
247 XC
248 XL
249 XMLmosaic
250 Yorick
251 Zdzich
252 Graphical user interfaces (GUIs)
253 Document formats
254 Page description languages
255 Media-based scripting languages
256 Esoteric programming languages
It should be noted that the 4DOS/4NT batch language is a superset of the MS-DOS batch language.
message "Hello, world!" with style = popup;
REPORT ZHELLO .
START-OF-SELECTION .
WRITE "Hello, world!".
The example below makes use of the singleton pattern and outputs the text in a message box instead of a classic list output.
REPORT ZHELLO .
CLASS lcl_hello DEFINITION CREATE PRIVATE FINAL .
PUBLIC SECTION .
CLASS-DATA self TYPE REF TO lcl_hello READ - ONLY .
CLASS-METHODS class_constructor .
METHODS say_hello .
PRIVATE SECTION .
CONSTANTS con_hello_world TYPE c LENGTH 13 VALUE 'Hello, World!' .
ENDCLASS .
CLASS lcl_hello IMPLEMENTATION .
METHOD class_constructor .
CREATE OBJECT lcl_hello => self .
ENDMETHOD .
METHOD say_hello .
MESSAGE con_hello_world TYPE 'I' .
ENDMETHOD .
ENDCLASS .
START-OF-SELECTION .
lcl_hello => self -> say_hello ( ).
WRITE "Hello, world!"
This will output to the output window only, which an end user would not see.
This version will be visible to the end user.
var helloWorld : TextField = this . createTextField ( "helloWorld" , this . getNextHighestDepth () , 1 , 1 , 100 , 20 );
helloWorld . text = "Hello, world!" ;
package
{
public class HelloWorld
{
public function HelloWorld ()
{
trace ( "Hello, world!" );
}
}
}
with Ada.Text_IO ;
procedure Hello is
begin
Ada . Text_IO . Put_Line ( "Hello, world!" );
end Hello ;
The ALGOL 68 standard requires that reserved-words , types and operators are in a different typeface.
Hence programs are typically published in either bold or an underline typeface, e.g.:
begin
printf($"Hello, world!"l$)
end
In the popular upper-case stropping convention for bold words:
BEGIN
printf($"Hello, world!"l$)
END
or using a wikitext like quote stropping, this is especially suitable on computers with only 6 bits per character (hence only have UPPERCASE):
'BEGIN'
PRINTF($"HELLO, WORLD!"L$)
'END'
or minimally using the "brief symbol" form of begin and end .
( printf($"Hello, world!"l$) )
PROC main()
WriteF('Hello, world!');
ENDPROC
This program sends the message out via the Diagnostics Interface after start-up.
program_name = 'Hello'
define_start
send_string 0,'Hello World!'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project>
<project default= "helloworld" >
<target name= "helloworld" >
<echo message= "Hello, World!" />
</target>
</project>
∇ R ← HWΔPGM
[ 1 ] R ← 'HELLO WORLD!'
∇
The Del on the first line begins function definition for the program named HWΔPGM. It is a niladic function (no parameters, as opposed to monadic or dyadic) and it will return an explicit result which allows other functions or APL primitives to use the returned value as input.
The line labeled 1 assigns the text vector 'Hello, world!!' to the variable R
The last line is another Del which ends the function definition.
When the function is executed by typing its name the APL interpreter assigns the text vector to the variable R, but since we have not used this value in another function, primitive, or assignment statement the interpreter returns it to the terminal, thus displaying the words on the next line below the function invocation.
The session would look like this
HWΔPGM
Hello, world!!
While not a program, if you simply supplied the text vector to the interpreter but did not assign it to a variable it would return it to the terminal as output. Note that user input is automatically indented 6 spaces by the interpreter while results are displayed at the beginning of a new line.
'Hello, world!'
Hello, world!!
or:
display dialog "Hello, world!"
<% Response . Write ( "Hello, world!" ) %>
or simply:
// in the page behind using C#
protected void Page_Load ( object sender , EventArgs e )
{
Response . Write ( "Hello, world!" );
}
' in the page behind using VB.NET
Protected Sub Page_Load ( ByVal sender As Object , ByVal e As EventArgs )
Response . Write ( "Hello, world!" )
End Sub
// ASPX Page Template
<asp:Literal ID= "Literal1" runat= "server" Text= "Hello World!" ></asp:Literal>
oder
<asp:Label ID= "Label1" runat= "server" Text= "Hello World" ></asp:Label>
oder
Hello World!
Accumulator-only architecture: DEC PDP-8, PAL-III assembler[ edit | edit source ]
See the example program in the Wikipedia PDP-8 article .
First successful uP/OS combinations: Intel 8080/Zilog Z80, CP/M, RMAC assembler[ edit | edit source ]
bdos equ 0005H ; BDOS entry point
start: mvi c , 9 ; BDOS function: output string
lxi d , msg$ ; address of msg
call bdos
ret ; return to CCP
msg$: db 'Hello, world!$'
end start
Popular home computer: ZX Spectrum, Zilog Z80, HiSoft GENS assembler[ edit | edit source ]
10 ORG #8000 ; Start address of the routine
20 START LD A , 2 ; set the output channel
30 CALL #1601 ; to channel 2 (main part of TV display)
40 LD HL , MSG ; Set HL register pair to address of the message
50 LOOP LD A ,( HL ) ; De-reference HL and store in A
60 AND A ; Null terminator?
70 RET Z ; If so, return
80 RST #10 ; Print the character in A
90 INC HL ; HL points at the next char to be printed
100 JR LOOP
110 RET
120 MSG DEFM "Hello, world!"
130 DEFB 13 ; carriage return
140 DEFB 0 ; null terminator
Accumulator + index register machine: MOS Technology 6502, CBM KERNEL, MOS assembler syntax[ edit | edit source ]
A_CR = $0D ;carriage return
BSOUT = $FFD2 ;kernel ROM sub, write to current output device
;
LDX # $00 ;starting index in .X register
;
LOOP LDA MSG , X ;read message text
BEQ LOOPEND ;end of text
;
JSR BSOUT ;output char
INX
BNE LOOP ;repeat
;
LOOPEND RTS ;return from subroutine
;
MSG .BYT 'Hello, world!' , A_CR , $00
Accumulator/Index microcoded machine: Data General Nova, RDOS[ edit | edit source ]
See the example section of the Nova article.
MODEL SMALL
IDEAL
STACK 100H
DATASEG
MSG DB 'Hello, world!' , 13 , '$'
CODESEG
Start:
MOV AX , @ data
MOV DS , AX
MOV DX , OFFSET MSG
MOV AH , 09H ; DOS: output ASCII$ string
INT 21H
MOV AX , 4C00H
INT 21H
END Start
.MODEL Small
.STACK 100h
.DATA
db msg 'Hello, world!$'
.CODE
start:
mov ah , 09h
lea dx , msg ; or mov dx, offset msg
int 21h
mov ax , 4C00h
int 21h
end start
; FASM example of writing 16-bit DOS .COM program
; Compile: "FASM HELLO.ASM HELLO.COM"
org $ 100
use16
mov ah , 9
mov dx , xhello
int $ 21 ; DOS call: text output
mov ah , $ 4 C
int $ 21 ; Return to DOS
xhello db 'Hello world !!!$'
Expanded accumulator machine: Intel x86, Microsoft Windows, FASM[ edit | edit source ]
Example of making 32-bit PE program as raw code and data:
format PE GUI
entry start
section '.code' code readable executable
start:
push 0
push _caption
push _message
push 0
call [ MessageBox ]
push 0
call [ ExitProcess ]
section '.data' data readable writeable
_caption db 'Win32 assembly program' , 0
_message db 'Hello, world!' , 0
section '.idata' import data readable writeable
dd 0 , 0 , 0 , RVA kernel_name , RVA kernel_table
dd 0 , 0 , 0 , RVA user_name , RVA user_table
dd 0 , 0 , 0 , 0 , 0
kernel_table:
ExitProcess dd RVA _ExitProcess
dd 0
user_table:
MessageBox dd RVA _MessageBoxA
dd 0
kernel_name db 'KERNEL32.DLL' , 0
user_name db 'USER32.DLL' , 0
_ExitProcess dw 0
db 'ExitProcess' , 0
_MessageBoxA dw 0
db 'MessageBoxA' , 0
section '.reloc' fixups data readable discardable
Using FASM import macro, unicode (MessageBoxW is one of few unicode functions 'supported' by Windows 9x/ME) and section sharing, no relocation (not required for 32-bit Windows NT executables, recommended for DOS-based Windows, required for x64), no heap - Not a beginners example but only 1024 instead of 3072 bytes:
format PE GUI 4.0
heap 0
entry start
include 'win32a.inc'
section '.text' code import readable executable data
library kernel , 'KERNEL32.DLL' , \
user , 'USER32.DLL'
import kernel , \
ExitProcess , 'ExitProcess'
import user , \
MessageBoxW , 'MessageBoxW'
start:
xor ebx , ebx
push ebx
push ebx
push _message
push ebx
call [ MessageBoxW ]
push ebx
call [ ExitProcess ]
_message du 'Hello, world!' , 0
section '.reloc' fixups data readable discardable
format ELF executable
entry _start
_start:
mov eax , 4
mov ebx , 1
mov ecx , msg
mov edx , msg_len
int 80h
mov ebx , 0
mov eax , 1
int 80h
msg db 'Hello, world!' , 0xA
msg_len = $ - msg
.data
msg:
.ascii "Hello, world!\n"
len = . - msg
.text
.global _start
_start:
movl $len , %edx
movl $msg , %ecx
movl $1 , %ebx
movl $4 , %eax
int $0x80
movl $0 , %ebx
movl $1 , %eax
int $0x80
section .data
msg db 'Hello, world!' , 0xA
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
Expanded accumulator machine: Intel x86, Linux, GLibC, NASM[ edit | edit source ]
extern printf ; Request symbol "printf".
global main ; Declare symbol "main".
section .data
str: DB "Hello World!" , 0x0A , 0x00
section .text
main:
PUSH str ; Push string pointer onto stack.
CALL printf ; Call printf.
POP eax ; Remove value from stack.
MOV eax , 0x0 ; \_Return value 0.
RET ; /
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
string BYTE "Hello, world!",#a,0 string to be printed (#a is newline and 0 terminates the string)
Main GETA $255,string get the address of the string in register 255
TRAP 0,Fputs,StdOut put the string pointed to by register 255 to file StdOut
TRAP 0,Halt,0 end process
.MCALL .REGDEF ,. TTYOUT ,. EXIT
.REGDEF
HELLO: MOV #MSG,R1
MOVB ( R1 ) + , R0
BEQ EXIT
LOOP: .TTYOUT
BR LOOP
EXIT:
.EXIT
MSG: .ASCIZ / Hello , world ! /
.END HELLO
Variant for Elektronika BK using BIOS function, MICRO-11[ edit | edit source ]
MOV #TXT,R1 ;Moving string address to R1
CLR R2 ;String length=0, means null will be the termination character
EMT 20 ;Print the string
HALT
TXT: .ASCIZ / Hello , world ! /
.END
include lvo / exec_lib.i
include lvo / dos_lib.i
; open DOS library
movea.l 4 .w , a6
lea dosname ( pc ), a1
moveq #36,d0
jsr _LVOOpenLibrary ( a6 )
movea.l d0 , a6
; actual print string
lea hellostr ( pc ), a0
move.l a0 , d1
jsr _LVOPutStr ( a6 )
; close DOS library
movea.l a6 , a1
movea.l 4 .w , a6
jmp _LVOCloseLibrary ( a6 )
dosname dc.b 'dos.library' , 0
hellostr dc.b 'Hello, world!' , 0
;print
move.l #Hello,-(A7)
move.w #9,-(A7)
trap #1
addq.l #6,A7
;wait for key
move.w #1,-(A7)
trap #1
addq.l #2,A7
;exit
clr.w - ( A7 )
trap #1
Hello
dc.b 'Hello, world!' , 0
pea ( strign ) ; push string address onto stack
dc.w $ FF09 ; call DOS "print" by triggering an exception
addq.l #4,a7 ; restore the stack pointer
dc.w $ FF00 ; call DOS "exit"
strign:
dc.b "Hello, world!" , 13 , 10 , 0
CISC on advanced multiprocessing OS: DEC VAX, VMS, MACRO-32[ edit | edit source ]
.title hello
.psect data , wrt , noexe
chan: .blkw 1
iosb: .blkq 1
term: .ascid "SYS$OUTPUT"
msg: .ascii "Hello, world!"
len = . - msg
.psect code , nowrt , exe
.entry hello , ^ m <>
; Establish a channel for terminal I/O
$assign_s devnam = term , -
chan = chan
blbc r0 , end
; Queue the I/O request
$qiow_s chan = chan , -
func = #io$_writevblk, -
iosb = iosb , -
p1 = msg , -
p2 = #len
; Check the status and the IOSB status
blbc r0 , end
movzwl iosb , r0
; Return to operating system
end: ret
.end hello
HELLO CSECT The name of this program is 'HELLO'
USING *,12 Tell assembler what register we are using
SAVE (14,12) Save registers
LR 12,15 Use Register 12 for this program
WTO 'Hello, world!' Write To Operator
RETURN (14,12) Return to calling party
END HELLO This is the end of the program
RISC processor: ARM, RISC OS, BBC BASIC's in-line assembler[ edit | edit source ]
.program
ADR R0 , message
SWI " OS_Write0 "
SWI " OS_Exit "
.message
EQUS "Hello, world!"
EQUB 0
ALIGN
or the even smaller version (from qUE);
SWI "OS_WriteS":EQUS "Hello, world!":EQUB0:ALIGN:MOV PC,R14
.data
msg: .asciiz "Hello, world!"
.align 2
.text
.globl main
main:
la $a0 , msg
li $v0 , 4
syscall
jr $ra
.data
msg:
.ascii "Hello, world!\n"
len = . - msg
.text
.globl _main
_main:
li r0 , 4 ; write
li r3 , 1 ; stdout
addis r4 , 0 , ha16 ( msg ) ; high 16 bits of address
addi r4 , r4 , lo16 ( msg ) ; low 16 bits of address
li r5 , len ; length
sc
li r0 , 1 ; exit
li r3 , 0 ; exit status
sc
SYSTEM BPM
START M : PRINT ( MESS , HW )
M: EXIT
HW TEXTC ' HELLO WORLD '
END START
(The comma after the command name is optional.)
MsgBox ( 0 , '' , 'Hello, world!' )
MsgBox("Hello, world!","aTitle")
BEGIN { print "Hello, world!" }
This is the first known Hello, world! program ever written:[1]
main ( ) {
extrn a , b , c ;
putchar ( a ); putchar ( b ); putchar ( c ); putchar ( ' !* n ' );
}
a ' hell ' ;
b ' o , w ' ;
c ' orld ' ;
Also known as Triton Tools on older versions. On Baan ERP you can create a program on 3GL or 4GL mode.
function main()
{
message("Hello, world!")
}
choice.cont.process:
on.choice:
message("Hello, world!")
On this last case you should press the Continue button to show the message.
oder
or using the C preprocessor
#!/bin/bash
#define cpp #
cpp $0 2 > /dev/null | /bin/bash; exit $?
#undef cpp
#define HELLO_WORLD echo "hello, world"
HELLO_WORLD | tr a-z A-Z
The following example works for any ANSI/ISO-compliant BASIC implementation, as well as most implementations built into or distributed with microcomputers in the 1970s and 1980s (usually some variant of Microsoft BASIC):
10 PRINT "Hello, world!"
20 END
Note that the "END" statement is optional in many implementations of BASIC.
Some implementations could also execute instructions in an immediate mode when line numbers are omitted. The following examples work without requiring a RUN instruction.
Later implementations of BASIC allowed greater support for structured programming and did not require line numbers for source code. The following example works when RUN for the vast majority of modern BASICs.
PRINT "Hello, world!"
END
Again, the "END" statement is optional in many BASICs.
Print "Hello, world!"
WaitKey
oder
TEXT 0 , 0 , "Hello, world!"
WAIT KEY
Note: In the "classic" Dark Basic the WAIT KEY command is optional as the console goes up when the program has finished.
PRINT "Hello World"
SLEEP
END
oder
oder
oder
'without a newline
? "Hello World" ;
AddText "Hello, world!"
DrawScreen
WaitKey
10 PRINT "Hello, World!"
20 END
To write to the main window:
Or drawn in a graphics window:
nomainwin
open "Hello, world!" for graphics as # main
print # main , "place 50 50"
print # main , "\Hello, world!"
print # main , "flush"
wait
TextWindow . WriteLine ( "Hello, world!" )
DEBUG "Hello, world!" , CR
or, the typical microcontroller Hello, world! program equivalent with the only output device present being a light-emitting diode (LED) (in this case attached to the seventh output pin):
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
sub main
print "Hello, world!"
end sub
OpenConsole ()
PrintN ( "Hello, world!" )
Input ()
oder
MessageRequester ( "Hello, World" , "Hello, World" )
oder
PRINT "Hello, World" END
Same for QBasic
On TI calculators of the TI-80 through TI-86 range:
:Disp "Hello, world! (note the optional ending quotes)
:Output(X,Y,"Hello, world! (note the optional ending parenthesis)
:Text(X,Y,"Hello, world! (writes to the graph rather than home screen)
:Text(-1,X,Y,"Hello, world! (only on the 83+ and higher, provides larger text, home screen size)
:"Hello, world! (last line of program only)
Note: "!" character is not on the keypad. It can be accessed from "Catalog" menu, "Probability" menu, or "Math" menu (as factorial notation).
On TI-89/TI-89 Titanium/TI-92(+)/Voyage 200 calculators:
:hellowld()
:Prgm
:Disp "Hello, world!"
:EndPrgm
Public Sub Main ()
Debug . Print "Hello, world!"
End Sub
oder
Public Sub Main ()
MsgBox "Hello, world!"
End Sub
oder
Private Sub Form_Activate ()
Print "Hello, world!"
End Sub
Alternatively, copy this into a New Form:
Private Sub Form_Click ()
Form1 . Hide
Dim HelloWorld As New Form1
HelloWorld . Width = 2500 : HelloWorld . Height = 1000 : HelloWorld . Caption = "Hello, world!" : HelloWorld . CurrentX = 500 : HelloWorld . CurrentY = 75
HelloWorld . Show : HelloWorld . Font = "Tahoma" : HelloWorld . FontBold = True : HelloWorld . FontSize = 12 : HelloWorld . Print "Hello, world!"
End Sub
Module HelloWorldApp
Sub Main ()
System . Console . WriteLine ( "Hello, world!" )
End Sub
End Module
In addition to the ANSI syntax at the head of this article, most Pick operating system flavors of Dartmouth BASIC support extended syntax allowing cursor placement and other terminfo type functions for VDT's
X, Y positioning (colon ":" is the concatenation instruction):
PRINT @ ( 34 , 12 ) : "Hello, world!"
Will display the string "Hello, world!" roughly centered in a 80X24 CRT.
Other functions:
PRINT @ ( -1 ) : @ ( 34 , 12 ) : "Hello, world!"
Will clear the screen before displaying the string "Hello, world!" roughly centered in a 80X24 CRT.
Syntax variants:
CRT "Hello, world!"
Supporting the "@" functions above, the CRT statement ignores previous PRINTER statements and always sends output to the screen.
Some Pick operating system environments such as OpenQM support the DISPLAY variant of PRINT. This variant in addition to the "@" functions maintains pagination based upon the settings of the TERM variable:
DISPLAY "Hello, world!"
oder
@ echo off
set hellostring = Hello World!
echo %hellostring%
oder
@ echo off
echo Hello World!
pause
exit
oder
@ echo Hello World!
pause
exit
@ echo off
echo Content-type: text/plain >> sample.cgi
echo . >> sample.cgi
echo . >> sample.cgi
echo Hello, world! >> sample.cgi
"Hello, world!"
or, with the newline
GET "LIBHDR"
LET START () BE
$(
WRITES ("Hello, world!*N")
$)
T
1 "Hello, World"
0
J( 1 TM 5 ZV 3 "Hello, world" )
%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
SuperStrict
Graphics 640 , 480 , 0 , 60
Local running : Int = 1
While running
Cls
DrawText "Hello World!" , 1 , 1
Flip
If GetChar ()
running = 0
EndIf
Wend
End
See also GUI section .
WRITE ELEMENT:Earth 210 230 40 CENTER TEXT "Hello World!"
#include <stdio.h>
int main ()
{
printf ( "Hello, world! \n " );
return 0 ;
}
#include <stdio.h>
int main ( void ) {
printf ( "Hello, World! \n " );
return 0 ;
}
Class Test.Hello Extends %CSP.Page [ ProcedureBlock ]
{
ClassMethod OnPage() As %Status
{
& html< < html >
< head >
</ head >
< body > >
Write "Hello, world!",!
& html< </ body >
</ html > >
Quit $$$OK
}
}
This program will work on the Avasmath 80 online programmable calculator.
#BTN A1
#PRI "HELLO WORLD!"
#END
OBJECT Codeunit 50000 HelloWorld
{
PROPERTIES
{
OnRun=BEGIN
MESSAGE(Txt001);
END;
}
CODE
{
VAR
Txt001@1000000000 : TextConst 'ENU=Hello, world!';
BEGIN
{
Hello, world! in C/AL (Microsoft Business Solutions-Navision)
}
END.
}
}
This program will work on the fx-9750 graphing calculator and compatibles.
"Hello, world!"↵
oder
Locate 1,1,"Hello, world!"↵
call echo("Hello, world!")
The above C code can run in Ch as examples. The simple one in Ch is:
printf ( "Hello, world! \n " );
<<<"Hello World">>>;
namespace HelloWorld;
interface
type
HelloClass = class
public
class method Main;
end;
implementation
class method HelloClass.Main;
begin
System.Console.WriteLine('Hello, world!' );
end;
end.
. assembly Hello {}
. assembly extern mscorlib {}
. method static void Main ()
{
. entrypoint
. maxstack 1
ldstr "Hello, world!"
call void [ mscorlib ] System . Console :: WriteLine ( string )
ret
}
<Script>
<References>
<Reference> System.dll</Reference>
</References>
<Code Language= "VisualBasic" >
<![CDATA[
Public Class Plugin
Public Function MainF(ByVal Ob As Object) As String
'Script Code
Return "Hello, World!"
End Function
End Class
]]>
</Code>
</Script>
module hello
Start = "Hello, world!"
oder
oder
PROC 0
WRITE Hello, world!
( println "Hello, world!" )
start_up = proc ()
po: stream := stream$primary_output ()
stream$putl (po, "Hello, world!")
end start_up
IDENTIFICATION DIVISION .
PROGRAM-ID . HELLO-WORLD .
PROCEDURE DIVISION .
DISPLAY "Hello, world!" .
STOP RUN .
The above is a very abbreviated and condensed version, which omits the author name and source and destination computer types.
CoffeeScript is a language that compiles into JavaScript. Like JavaScript, it does not have native (built in) input or output routines, instead relying on the facilities provided by its host environment.
Using an alert that uses a standard Web browser's window object (window.alert)
or, from Firebug , Apple Safari , or Google Chrome debug console, or Node.js console
console . log 'Hello, world!'
<cfoutput> Hello, world!</cfoutput>
oder
Function | Main
WriteLine | "Hello, world"
End | Main
The '|' represents the separation of the two text fields in the Cube standard IDE.
#include <iostream>
int main () {
std :: cout << "Hello, World!" << std :: endl ;
return 0 ;
}
int main () {
System :: Console :: WriteLine ( "Hello, world!" );
return 0 ;
}
#using <mscorlib.dll>
using namespace System ;
int wmain ()
{
Console :: WriteLine ( "Hello, world!" );
return 0 ;
}
See also GUI section .
using System ;
internal static class HelloWorld
{
private static void Main ()
{
Console . WriteLine ( "Hello, world!" );
}
}
import std . stdio ;
void main () {
writefln ( "Hello, world!" );
}
Tango version:
import tango . io . Stdout ;
void main () {
Stdout ( "Hello, world!" ). newline ;
}
main () {
print ( 'Hello, world!' );
}
Or,
void main () {
print ( 'Hello, world!' );
}
[Hello, world!]p
oder
1468369091346906859060166438166794P
In the second example, DC stores the decimal number as a sequence of bits, and then the "P" tells DC to interpret those bits as a string and print it.
$ write sys$output "Hello, world!"
{$APPTYPE CONSOLE}
begin
Write ( 'Hello, world!' ) ;
end .
PROGRAM hello ;
BEGIN
write ( 0 , 0 , 0 , 0 , " Hello , world !" ) ;
LOOP
FRAME ;
END
END
this::operator()
{
import system.cstdio;
puts("Hello, world!");
}
mob
Login()
..()
world << "Hello, world!"
module : hello
format-out ( "Hello, world! \n " );
set disp to "Hello, world!"
set dispto to item unit 5 //5 = default screen
release disp into dispto.
This would be a pure system call
import system ea.helloworld
wait
a
Hello, world!!
.
p
module HelloWorld
{
void run ()
{
@Inject Console console ;
console . print ( "Hello World!" );
}
}
class HELLO_WORLD
create make
feature
make is
do
io . put_string ( "Hello, world!%N" )
end -- make
end -- class HELLO_WORLD
import Html exposing ( text )
main =
text "Hello, World!"
See also GUI section .
- module ( hello ).
- export ([ hello / 0 ]).
hello () -> io : format ( "Hello, world! ~n " ).
or gui version
"Hello, world!" <label> "Hi" open-window
printl( "Hello world" )
uses "console";
Console.println("Hello, world!");
@once:
mesgbox "Hello, world!" ; exit
"halló" < main
{
main ->
stef(;)
stofn
skrifastreng(;"Halló, veröld!"),
stofnlok
}
*
"GRUNNUR"
;
type "Hello, world!",!
oder
t "Hello, world!",!
-TYPE Hello, world!
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;
: HELLO ( -- ) ." Hello, world!" CR ;
HELLO
or instead of compiling a new routine, one can type directly in the Forth interpreter console
CR ." Hello, world!" CR
00 program hello
write ( * , * ) 'Hello World!'
stop
end
program hello
write ( * , * ) 'Hello, World!'
end program hello
?((pp "Hello, world!"))
oder
pp "Hello, world!"
println["Hello, world!"]
See also GUI section .
PUBLIC SUB Main()
Print "Hello, world!"
END
procedure_form hello
begin_block world
print "Hello, world!"
end_block
end_form
Msg("Hello World")
In the draw event of some object:
draw_text(x,y,"Hello, world!")
Or to show a splash screen message:
show_message("Hello, world!")
package main
import "fmt"
func main () {
fmt . Println ( "Hello, world!" )
}
if (created) {
echo Hello, world!;
}
function onCreated() {
echo("Hello, world!");
}
? "Hello, world!"
oder
@1,1 say "Hello, world!"
oder
Qout("Hello, world")
main = putStrLn "Hello, world!"
class HelloWorldApp
{
static function main ()
{
trace ( "Hello, world!" );
}
}
program HelloWorld;
functions {
_main() {
print_string("Hello, world!");
}
}
end
(Handheld Hewlett-Packard RPN-based scientific calculator.)
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
(Handheld Hewlett-Packard RPN-based alphanumeric engineering calculators.)
01 LBLT HELLO
02 T Hello, world!
03 PROMPT
HyperTalk (Apple HyperCard's scripting programming language)[ edit | edit source ]
oder
procedure main ()
write ( "Hello, world!" )
end
oder
[ Main ;
"Hello, world!" ;
];
Hello World is a room. The printed name is "Hello, world!"
ON ENTER {
"Hello, " "world!" & SAY
}
'Hello, world!' NB. echoes the string in interactive mode, doesn't work in script
'Hello World!' 1 !: 2 ( 2 ) NB. prints it to (2) - screen, (4) - stdout
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 = "!"
See also GUI section .
class HelloWorld {
public static void main ( String [] args ) {
System . out . println ( "Hello, world!" );
}
}
(disassembler output of javap -c HelloWorld
)
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
}
.class HelloWorld
.super java/lang/ Object
.method public static main ([ L java/lang/ String ;) V
.limit stack 2
getstatic java/lang/ System/ out L java/io/ PrintStream ;
ldc "Hello, world!"
invokevirtual java/io/ PrintStream/ println ( L java/lang/ String ;) V
return
.end method
JavaFX Script was a scripting language formerly called F3 for Form Follows Function. It was discontinued by Oracle in 2010.
Frame {
title : "Hello World JavaFX"
width : 200
content : Label {
text : "Hello World"
}
visible : true
}
This program can also be written in this way:
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 ;
A simple console output version would be:
import java.lang.System ;
System . out . println ( "Hello World" );
Or even simpler (with a built-in function):
JavaScript does not have native (built in) input or output routines. Instead it relies on the facilities provided by its host environment.
Using a standard Web browser's document object
document . write ( 'Hello, World!' );
or with an alert, using a standard Web browser's window object (window.alert)
or, from the Mozilla command line implementation
or, from the Windows Script Host
WScript . Echo ( 'Hello, world!' );
or, from Firebug , Apple Safari , or Google Chrome debug console
console . log ( 'Hello, world!' );
// HERIB JOB , 'HERIBERT OTTEN' , PRTY = 12
//* HELLO WORLD FOR MVS
// HALLO EXEC PGM = IEBGENER
// SYSIN DD DUMMY
// SYSPRINT DD SYSOUT = *
// SYSUT2 DD SYSOUT = T
// SYSUT1 DD *
HELLO WORLD!
/*
//
"Hello, world!\n" putchars .
<%@ page contentType = "text/html;charset=WINDOWS-1252" %>
<HTML>
<BODY>
<% out . println ( " Hello, world!" ); %>
</BODY>
</HTML>
or just
<% out . println ( "Hello, world!" ); %>
or literally
Hello, world!
`plain
'Hello World!' #echo #
fun main () {
println ( "Hello World!" )
}
WriteLine "Hello, world!"
Program HelloWorld
Method Main()
ShowConsole()
ConsoleWriteLine("Hello, world!")
End Method
End Program
oder
or simply
'Hello, world!';
tarea muestre "Hola mundo !"
oder
clase Saludo derivada_de Form
publicos
mensajes
Saludo copie "Hola mundo !" en saludo.Text
Linden Scripting Language is the scripting language used within Second Life
default
{
state_entry ()
{
llSetText ( "Hello, World!" , < 0 , 0 , 0 > , 1.0 );
//or...
llSay ( 0 , "Hello, World!" );
}
}
Livre : HelloWorld
Paragraphe : Affichage
Actions :
"Hello, World !" !
Section Header
+ name := HELLO_WORLD_PROGRAM ;
Section Public
- main <-
(
"Hello world!\n" .print ;
);
Lisp has many dialects that have appeared over its almost fifty-year history.
( format t "Hello, world!~%" )
oder
( write-line "Hello, world!" )
or in the REPL:
(As a string (enclosed in quotes) it evaluates to itself, so is printed.)
( display "Hello, world! \n " )
( println "Hello, world!" )
or:
( message "Hello, world!" )
print [Hello, world!]
oder
pr [Hello, world!]
In MSWLogo only
messagebox [Hi] [Hello, world!]
void create ()
{
write ( "Hello, world! \n " );
}
io.write ( "Hello, world! \n " )
oder
oder
screen . print ( 10 , 10 , "Hello, world!" )
W "Hello, world!"
print("Hello, world!");
or simply:
"Hello, world!"
oder
fprintf ( 'Hello, world!\n' )
or with a GUI
figure ( 'Position' ,[ 100 100 200 200 ], 'MenuBar' , 'none' , 'Name' , 'Hello World' );
uicontrol ( 'Style' , 'text' , 'Position' ,[ 15 100 150 15 ], 'String' , 'Hello world' );
oder
fmod HELLOWORLD is
protecting STRING .
op helloworld : -> String .
eq helloworld = "Hello, world!" .
endfm
red helloworld .
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;
print ( "Hello, world!\n" );
var x:String::allocated[on[0]];
x:="Hello World"; // allocated on process 0 only
proc 1 {
// This is displayed by process 1, auto communication done to achieve this
print[x];
}
Hello, world!
helloworld echo Hello, world!
alias helloworld echo Hello, world!
Hello World:echo Hello, world!
BEGIN
PRINT 'Hello, world!'
END
MODULE Hello ;
FROM InOut IMPORT WriteLn , WriteString ;
BEGIN
WriteString ( "Hello, world!" );
WriteLn
END Hello .
Strict
Function Main : Int ()
Print "Hello World!"
Return 0
End
This requires that you be the player or a wizard:
notify ( player , "Hello, world!" );
This is specific to the implementation of the core used for the moo, but works on most well known moos, such as LambdaCore or JH-Core:
player : tell ( "Hello, world!" );
"Hello, World!"
$
#include <stdio.h>
#include <time.h>
#include <string.h>
#include "mpi.h"
int main ( int argc , char * argv [] )
{
const int maximum_message_length = 100 ;
const int master_rank = 0 ;
char message [ maximum_message_length + 1 ];
MPI_Status status ; /* Info about receive status */
int my_rank ; /* This process ID */
int num_procs ; /* Number of processes in run */
int source ; /* Process ID to receive from */
int destination ; /* Process ID to send to */
int tag = 0 ; /* Message ID */
int mpi_error ; /* Error code for MPI calls */
int icount ;
char processor_name [ MPI_MAX_PROCESSOR_NAME ];
int name_length ;
// Initialize the MPI execution environment.
mpi_error = MPI_Init ( & argc , & argv );
if ( mpi_error != MPI_SUCCESS )
{
fprintf ( stderr , "Error: %s: Unable to initialize MPI execution environment \n Aborting ... \n " , argv [ 0 ] );
return ( 1 );
}
// Even though we capture the error value from the MPI calls, we will
// not deal with any error except the last one.
mpi_error = MPI_Comm_rank ( MPI_COMM_WORLD , & my_rank );
mpi_error = MPI_Comm_size ( MPI_COMM_WORLD , & num_procs );
if ( my_rank != master_rank )
{
mpi_error = MPI_Get_processor_name ( processor_name , & name_length );
sprintf ( message , "Greetings from process #%d running on %s \n " , \
my_rank , processor_name );
destination = master_rank ;
mpi_error = MPI_Send ( message , strlen ( message ) + 1 , MPI_CHAR , \
destination , tag , MPI_COMM_WORLD );
}
else
{
for ( source = 0 ; source < num_procs ; source ++ )
{
if ( source != master_rank )
{
mpi_error = MPI_Recv ( message , maximum_message_length + 1 , \
MPI_CHAR , source , tag , MPI_COMM_WORLD , & status );
printf ( "%s \n " , message );
}
}
}
mpi_error = MPI_Finalize ();
if ( MPI_SUCCESS != mpi_error )
return ( mpi_error );
else
return ( 0 );
}
main(std:string >>arg<< / OS.GetArg)
{
std:stream >>CONSOLE<< / OS.Console;
CONSOLE:Write([byte]{0048, 0065, 006C, 006C, 006F, 002C, 0058, 006F, 0072, 006C, 0064});
// H e l l o , W o r l d //
}
# # DEFINE g >>CONSOLE<< / OS.Console
# % proc CONSOLE:Write([byte]{0048, 0065, 006C, 006C, 006F, 002C, 0058, 006F, 0072, 006C, 0064})
# @ Write([byte]{0048, 0065, 006C, 006C, 006F, 002C, 0058, 006F, 0072, 006C, 0064})
(with the standard command.com interpreter. The @ symbol is optional and prevents the system from repeating the command before executing it. The @ symbol must be omitted on versions of MS-DOS prior to 3.0.). It's very common for batchfiles to start with two lines of "@echo off" and "cls".
For MS-DOS 3.0 or lower
@ echo off
cls
echo Hello, world!
: main
me @ "Hello, world!" notify
;
WRITE 'Hello, world!'
END
oder
WRITE 'Hello, world!'.
$print("Hello, world!!\n");
The easiest way to get Nemerle print "Hello, world!" would be that:
System . Console . WriteLine ( "Hello, world!" );
however, in bigger applications the following code would be probably more useful:
using System . Console ;
module HelloWorld
{
Main (): void
{
WriteLine ( "Hello, world!" );
}
}
oder
Oberon is both the name of a programming language and an operating system.
Program written for the Oberon operating system:
MODULE Hello ;
IMPORT Oberon , Texts ;
VAR W : Texts . Writer ;
PROCEDURE World * ;
BEGIN
Texts . WriteString ( W , "Hello, world!" );
Texts . WriteLn ( W );
Texts . Append ( Oberon . Log , W . buf )
END World ;
BEGIN
Texts . OpenWriter ( W )
END Hello .
Freestanding Oberon program using the standard Oakwood library:
MODULE Hello ;
IMPORT Out ;
BEGIN
Out . String ( "Hello, world!" );
Out . Ln
END Hello .
system.console.write_line ( "Hello, world!" )
Message to the user in the form:
OGForm.SetInfo('Hello world!');
Entry into the log:
OG.Log.Write('Hello world!');
#import <stdio.h>
int main ( int argc , const char * argv [])
{
printf ( "Hello, world! \n " );
return 0 ;
}
#import <stdio.h>
#import <objc/Object.h>
@interface Hello : Object
{
}
- hello ;
@end
@implementation Hello
- hello
{
printf ( "Hello, world! \n " );
}
@end
int main ( void )
{
id obj ;
obj = [ Hello new ];
[ obj hello ];
[ obj free ];
return 0 ;
}
#import <Foundation/Foundation.h>
int main ( int argc , const char * argv [])
{
NSLog ( @"Hello, world!" );
return 0 ;
}
print_endline "Hello, world!" ;;
#USE "course.lib"
PROC hello.world(CHAN OF BYTE screen!)
out.string("Hello, world!*n", 0, screen!)
:
or without using course.lib
PROC hello.world(CHAN OF BYTE screen!)
SEQ
screen ! 'H'
screen ! 'e'
screen ! 'l'
screen ! 'l'
screen ! 'o'
screen ! ','
screen ! ' '
screen ! 'w'
screen ! 'o'
screen ! 'r'
screen ! 'l'
screen ! 'd'
screen ! '!'
screen ! '*n'
:
-- in a popup window
request "Hello world"
See also GUI section .
PROC hello:
PRINT "Hello, world!"
ENDP
( object-class request
^action )
( startup
( strategy MEA )
( make request ^action hello )
)
( rule hello
( request ^action hello )
( write |Hello, world!| ( crlf ))
)
module hello (main)
{ procedure main( )
{
write() |Hello, world!|, '\n';
};
};
print "Hello, world!\n"
end
.sub hello :main
print "Hello, world!!\n"
.end
begin
write ( 'Hello, world!' ) ;
end .
main () {
print ("Hello, World!" );
}
oder
main () {
new string[14 ];
format string(sizeof (string), "Hello, World! );
print (string);
}
(the semicolon is optional)
oder
package Hello ;
sub new () { bless {} }
sub Hello () { print "Hello, world! \n" }
package main ;
my $hello = Hello -> new ();
$hello -> Hello ();
#!/usr/local/bin/perl
print "Content-type: text/html\n\n" ;
print "<H1>Hello World!</H1>" ;
PHP is a templating language and will echo any text not within PHP tags directly, so the simplest form is:
Using actual PHP statements, it can be written:
<?php
echo 'Hello, world!' ;
?>
or use short-hand echoing, syntaxed as such:
<? echo "Hello, world!" ?>
this will also work:
int main () {
write ( "Hello, world! \n " );
return 0 ;
}
T:Hello, world!
set serveroutput on size 1000000 ; -- this is a SQL*Plus command to enable the output buffer
begin
dbms_output . put_line ( 'Hello, world!' );
end ;
Test : proc options ( main) ;
put list( 'Hello, world!' ) ;
end Test;
See also page description language section .
oder
Write-Host "Hello, world!"
oder
oder
[System.Console] :: WriteLine ( "Hello, world!" )
oder
[void][System.Reflection.Assembly] :: LoadWithPartialName ( 'System.Windows.Forms' )
[System.Windows.Forms.MessageBox] :: Show ( "Hello, World!" )
println("Hello, world!");
:- write ( 'Hello, world!' ), nl .
#N canvas 0 0 300 300 10;
#X obj 100 100 loadbang;
#X msg 100 150 Hello, world!;
#X obj 100 200 print;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
This also works on Python 2.4 or later, but in an unintuitive way. In Python 3, it calls the print
function with the string "Hello, world!"
. In Python 2, it executes the print
statement with the expression ("Hello, world!")
, which evaluates to the string "Hello, world!"
.
import sys
sys . stdout . write ( "Hello, world! \n " )
In Python 2.6 or later:
from __future__ import print_function
print ( "Hello, world!" )
import __hello__
import __phello__
from math import cos , sin
def f ( x ):
return int ( round ( 96.75 + - 21.98 * cos ( x * 1.118 ) + 13.29 * sin ( x * 1.118 ) + - 8.387 * cos ( 2 * x * 1.118 ) \
+ 17.94 * sin ( 2 * x * 1.118 ) + 1.265 * cos ( 3 * x * 1.118 ) + 16.58 * sin ( 3 * x * 1.118 ) \
+ 3.988 * cos ( 4 * x * 1.118 ) + 8.463 * sin ( 4 * x * 1.118 ) + 0.3583 * cos ( 5 * x * 1.118 ) \
+ 5.878 * sin ( 5 * x * 1.118 )))
print ( "" . join ([ chr ( f ( x )) for x in range ( 12 )]))
'Hello, world!' (with quotation marks) can be attained through:
#!/usr/local/bin/python
print ( "Content-type: text/html \n\n " )
print ( "Hello World!" )
As Python's Flask web microframework
from flask import Flask
app = Flask ( __name__ )
@app . route ( "/" )
def hello ():
return "Hello World!"
app . run ()
oder
oder
See also GUI section .
print "Hello, world!"
See also GUI section .
print "Hello, world!"
; Should work with any MARS >= ICWS-86
; with 128x64 gfx core
Start MOV 0 , 2455
MOV 0 , 2458
MOV 0 , 2459
MOV 0 , 2459
MOV 0 , 2459
MOV 0 , 2459
MOV 0 , 2459
MOV 0 , 2460
MOV 0 , 2465
MOV 0 , 2471
MOV 0 , 2471
MOV 0 , 2471
MOV 0 , 2479
MOV 0 , 2482
MOV 0 , 2484
MOV 0 , 2484
MOV 0 , 2484
MOV 0 , 2486
MOV 0 , 2486
MOV 0 , 2486
MOV 0 , 2486
MOV 0 , 2488
MOV 0 , 2493
MOV 0 , 2493
MOV 0 , 2493
MOV 0 , 2493
MOV 0 , 2497
MOV 0 , 2556
MOV 0 , 2559
MOV 0 , 2560
MOV 0 , 2565
MOV 0 , 2570
MOV 0 , 2575
MOV 0 , 2578
MOV 0 , 2585
MOV 0 , 2588
MOV 0 , 2589
MOV 0 , 2592
MOV 0 , 2593
MOV 0 , 2596
MOV 0 , 2597
MOV 0 , 2603
MOV 0 , 2605
MOV 0 , 2608
MOV 0 , 2667
MOV 0 , 2670
MOV 0 , 2671
MOV 0 , 2676
MOV 0 , 2681
MOV 0 , 2686
MOV 0 , 2689
MOV 0 , 2696
MOV 0 , 2699
MOV 0 , 2700
MOV 0 , 2703
MOV 0 , 2704
MOV 0 , 2707
MOV 0 , 2708
MOV 0 , 2714
MOV 0 , 2716
MOV 0 , 2719
MOV 0 , 2778
MOV 0 , 2778
MOV 0 , 2778
MOV 0 , 2778
MOV 0 , 2778
MOV 0 , 2779
MOV 0 , 2779
MOV 0 , 2779
MOV 0 , 2782
MOV 0 , 2787
MOV 0 , 2792
MOV 0 , 2795
MOV 0 , 2802
MOV 0 , 2805
MOV 0 , 2806
MOV 0 , 2809
MOV 0 , 2810
MOV 0 , 2810
MOV 0 , 2810
MOV 0 , 2810
MOV 0 , 2812
MOV 0 , 2818
MOV 0 , 2820
MOV 0 , 2823
MOV 0 , 2882
MOV 0 , 2885
MOV 0 , 2886
MOV 0 , 2891
MOV 0 , 2896
MOV 0 , 2901
MOV 0 , 2904
MOV 0 , 2911
MOV 0 , 2912
MOV 0 , 2913
MOV 0 , 2914
MOV 0 , 2917
MOV 0 , 2918
MOV 0 , 2919
MOV 0 , 2922
MOV 0 , 2928
MOV 0 , 2930
MOV 0 , 2933
MOV 0 , 2992
MOV 0 , 2995
MOV 0 , 2996
MOV 0 , 3001
MOV 0 , 3006
MOV 0 , 3011
MOV 0 , 3014
MOV 0 , 3021
MOV 0 , 3022
MOV 0 , 3023
MOV 0 , 3024
MOV 0 , 3027
MOV 0 , 3028
MOV 0 , 3030
MOV 0 , 3032
MOV 0 , 3038
MOV 0 , 3040
MOV 0 , 3103
MOV 0 , 3106
MOV 0 , 3107
MOV 0 , 3107
MOV 0 , 3107
MOV 0 , 3107
MOV 0 , 3107
MOV 0 , 3108
MOV 0 , 3108
MOV 0 , 3108
MOV 0 , 3108
MOV 0 , 3108
MOV 0 , 3109
MOV 0 , 3109
MOV 0 , 3109
MOV 0 , 3109
MOV 0 , 3109
MOV 0 , 3111
MOV 0 , 3111
MOV 0 , 3111
MOV 0 , 3120
MOV 0 , 3121
MOV 0 , 3124
MOV 0 , 3124
MOV 0 , 3124
MOV 0 , 3126
MOV 0 , 3129
MOV 0 , 3130
MOV 0 , 3130
MOV 0 , 3130
MOV 0 , 3130
MOV 0 , 3130
MOV 0 , 3131
MOV 0 , 3131
MOV 0 , 3131
MOV 0 , 3131
MOV 0 , 3135
JMP 0
$ENTRY GO{=<Prout 'Hello, world!'>;}
(This works the same for Transcript or xTalk)
put "Hello, World!"
answer "Hello, world!"
create field "myField"
set the text of field "myField" to "Hello, world!"
#!revolution
on startup
put "Content-Type: text/plain" & cr & cr
put "Hello World!"
end startup
/* a starting comment is needed in mainframe versions */
say "Hello, world!"
/FREE
DSPLY 'Hello, world!';
*InLR = *On;
/END-FREE
With this syntax, a constant has to be used because the message must be placed in positions 12 to 25, between apostrophes.
d TestMessage c Const( 'Hello, world!' )
c TestMessage DSPLY
c EVAL *InLR = *On
Using the internal message window, a simple Hello, world! program can be rendered thus:
mwin("Hello, world!")
wait()
An additional way to render text is by using the built in text() function.
text(1,1,"Hello, world!")
wait()
See also GUI section .
(On Hewlett-Packard HP-28, HP-48 and HP-49 series graphing calculators.)
<<
CLLCD
"Hello, world!" 1 DISP
0 WAIT
DROP
>>
_name Hello~World!
pause Hello~World!
exit
_end
See also GUI section .
oder
'Hello, world!' . each { | s | print s }
oder
class String
def say
puts self
end
end
'Hello, world!' . say
fn main () {
println! ( "Hello, world!" );
}
oder
message("Hello, world!");
class HELLO_WORLD is
main is
#OUT+"Hello, world!\n";
end;
end;
object HelloWorld extends App {
println ( "Hello, world!" )
}
App was introduced since Scala 2.1, and Application was deprecated since Scala 2.9.0. Use Application instead of App for versions below 2.1.
program HelloWorld ;
begin
WriteLn ( 'Hello world!' ) ;
end .
( display "Hello, World!" ) ( newline )
(Note: requires at least one line of input)
sed -ne '1s/.*/Hello, world!/p'
$ include "seed7_05.s7i";
const proc: main is func
begin
writeln("Hello, world");
end func;
'Hello, world!' print.
out('Hello, world!');
'set up initial variables
struct.follow
{
cpu.fan.speed(500.rpm)
cpu.max.process(100)
}
<
logic.handle(0)
int main()
int var()
array.max(100000000)
>
'open and write the text in a free handle window
open mainwin(io<std>) as free(1)
{
write.free(1).("Hello",&sym," world",&sym)(&sym<",">&sym<"!">
apply.free(1) to text
}
'reset the fan, cpu, and vars
<
logic(std)
fan(std.auto)
cpu.max(auto)
unint main()
unint var()
un.array.max(std)
>
'end
end
.end/
BEGIN
OutText("Hello, world!");
OutImage;
END
Transcript show: 'Hello, world!'
alternative:
StdoutStream nextPutLine: 'Hello, world'
OUTPUT = "Hello, world!"
END
class Hello {
static public main: args {
Console << "Hello, world!\n";
}
}
with Spark_IO ;
--# inherit Spark_IO;
--# main_program;
procedure Hello_World
--# global in out Spark_IO.Outputs;
--# derives Spark_IO.Outputs from Spark_IO.Outputs;
is
begin
Spark_IO . Put_Line ( Spark_IO . Standard_Output , "Hello, world!" , 0 );
end Hello_World ;
Spin is the high level language from Parallax Inc. used to program their Propeller multi-core micro-controllers.
The program assumes that the software UART object, provided with the Propeller IDE, is used to deliver the message over a serial line.
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
OBJ
console : "FullDuplexSerial"
PUB start
console.start(31, 30, 0, 115_200)
console.str(string("Hello, world!", 13))
OUTPUT = "Hello, world!"
END
ECHO "Hello, world!".
1.0
print Hello, World!
end
CREATE TABLE message ( text char ( 15 ));
INSERT INTO message ( text ) VALUES ( 'Hello, world!' );
SELECT text FROM message ;
DROP TABLE message ;
or (for EnterpriseDB's Stored Procedure Language (SPL))
BEGIN
DBMS_OUTPUT . PUT_LINE ( 'Hello, world!' );
END ;
or (e.g. Oracle dialect)
SELECT 'Hello, world!' FROM dual ;
or (for Oracle's PL/SQL proprietary procedural language)
BEGIN
DBMS_OUTPUT . ENABLE ( 1000000 );
DBMS_OUTPUT . PUT_LINE ( 'Hello, world!' );
END ;
or (e.g. MySQL or PostgreSQL dialect)
or (for PostgreSQL's PL/pgSQL Procedural language)
CREATE FUNCTION hello_world () RETURNS text AS $$
BEGIN
RETURN 'Hello, world!' ;
END
$$ LANGUAGE plpgsql ;
or (e.g. T-SQL dialect)
or (for KB-SQL dialect)
select Null from DATA_DICTIONARY . SQL_QUERY
FOOTER '' or HEADER or DETAIL or FINAL event ''
write "Hello, world!"
RACINE: HELLO_WORLD.
NOTIONS:
HELLO_WORLD : ecrire("Hello, world!").
Define program in script (.do-file) or at command line:
capture program drop hello /*Define Hello, world! program*/
program define hello
di "Hello, world!"
end
hello /*run Hello, world! program*/
Or, interactively at the command line:
di "Hello, world!"
or, for interactive prompt,
"Hello, world!"
I want window and the window title is hello world.
println ( "Hello, world!" ) // Swift 1.x
print ( "Hello, world!" ) // Swift 2.x
#OUTPUT Hello, world!
See also GUI section .
[% GET "Hola mundo!"; %]
Or the English version:
[% GET "Hello world!"; %]
public class HelloWorld {
% include { string . tom }
public final static void main ( String [] args ) {
String who = "world" ;
% match ( String who ) {
"World" -> { System . out . println ( "Hello, " + who + "!" ); }
_ -> { System . out . println ( "Don't panic" ); }
}
}
Declare @Output varchar ( 16 )
Set @Output = 'Hello, world!'
Select 'Output' = @Output
or, simpler variations:
Select 'Hello, world!'
Print 'Hello, world!'
module hello_world {
control {
log("Hello, world!");
}
}
put "Hello world!"
or using an inline 'here document'
cat <<'DELIM'
Hello, world!
DELIM
oder
printf '%s' $'Hello, world!\n'
or for a curses interface:
dialog --msgbox 'Hello, world!' 0 0
using GLib ;
public int main ( string [] args )
{
stdout . printf ( "Hello, world! \n " );
return 0 ;
}
module main ();
initial begin
# 0 $display ( "Hello, world!!" );
# 1 $finish ;
end
endmodule
or (a little more complicated)
module hello ( clk );
input clk ;
always @( posedge clk ) $display ( "Hello, world!!" );
endmodule
module main ();
reg clk ;
hello H1 ( clk );
initial begin
# 0 clk = 0 ;
# 5 clk = 1 ;
# 1 $finish ;
end
endmodule
module hello ( clk );
input clk ;
always @( posedge clk ) $display ( "Hello, world!!" );
endmodule
module main ();
reg clk ;
hello H1 ( clk );
initial begin
# 0 clk = 0 ;
# 23 $display ( "--23--" );
# 100 $finish ;
end
always # 5 clk =~ clk ;
endmodule
use std.textio. all ;
entity Hello is
end Hello ;
architecture Hello_Arch of Hello is
begin
p : process
variable l : line ;
begin
write ( l , String '( "Hello, world!" ));
writeline ( output , l );
wait ;
end process ;
end Hello_Arch ;
WScript . Echo "Hello, world!"
OR as a VBscript file
#include @" pfc\console\console.ph "
goal
console :: init (),
stdio :: write ( " Hello, world! " ).
#X3D V3.3 utf8
Shape {
geometry Text {
string [ "hello, world" ]
}
}
( module
( type $type0 ( func ( result i32 )))
( table 0 any func )
( memory 1 )
( export "memory" memory )
( export "hello" $func0 )
( func $func0 ( result i32 )
i32.const 16
)
( data ( i32.const 16 )
"Hello World \00 "
)
)
sub:main
load:mscorlib.dll
push:Hello, World!
invoke:mscorlib.dll:System.Console:Write:1
endsub
<X3D profile= 'Immersive' version= '3.3' >
<Scene>
<Shape>
<Text string= '"hello, world"' />
</Shape>
</Scene>
</X3D>
XC is a C like language from XMOS Ltd offering features supporting Communicating Sequential Processes on their multi-threaded, multi-core processors.
This example shows some of those features.
#include <platform.h>
#define BIT_RATE 115200
#define BIT_TIME XS1_TIMER_HZ / BIT_RATE
// A one bit output port with buffering
out port : 1 buffered uart_tx = PORT_UART_TX ;
// Thread implements serial transmitter using the ports timer.
void console ( chanend c , out port : 1 buffered TXD )
{
unsigned time ;
char byte ;
while ( 1 )
{
c : > byte ; // Read byte from the consol output channel.
TXD <: 0 @ time ; // Set start bit and save IO time stamp.
for ( int j = 0 ; j < 8 ; j += 1 ) // Data bits.
{
time += BIT_TIME ; // Time of next bit.
TXD @ time <: >> byte ; // Shift out next bit on time.
}
time += BIT_TIME ; // Two stop bits
TXD @ time <: 1 ;
time += BIT_TIME ;
TXD @ time <: 1 ;
}
}
// Thread issues greeting message to the console
void greeter ( chanend c )
{
char msg [] = "Hello World! \n " ;
int i ;
while ( 1 ) // Repeatedly send message to console output channel.
{
for ( i = 0 ; i < sizeof ( msg ) - 1 ; i ++ )
{
c <: msg [ i ]; // Output a byte to the channel.
}
}
}
int main ()
{
chan c ; // Communication channel between threads.
par // Parallel execution of block statements.
{
on stdcore [ 0 ] : console ( c , uart_tx ); // Run console output thread on core 0.
on stdcore [ 1 ] : greeter ( c ); // Run greeter thread or core 1.
}
return 0 ;
}
use XL.UI.CONSOLE
WriteLn "Hello, world!"
oder
import IO = XL.UI.CONSOLE
IO.WriteLn "Hello, world!"
<Class>
<Type> XMLmosaic Class</Type>
<Method>
<Name id= "1" > Main</Name>
<Code id= "1" > void Main()
{
Console.WriteLine('Hello World!');
}
</Code>
</Method>
<Counter>
<Count> 1</Count>
</Counter>
</Class>
write, "Hello, world!";
Note: The semicolon is optional.
Programming language with commands in Polish. Webpage
this . createTextField ( "hello_txt" , 0 , 10 , 10 , 100 , 20 );
this . hello_txt . text = "Hello, world!" ;
display dialog "Hello, world!" buttons { "OK" } default button 1
import System . Drawing
import System . Windows . Forms
f = Form ()
f . Controls . Add ( Label ( Text : "Hello, world!" , Location : Point ( 40 , 30 )))
f . Controls . Add ( Button ( Text : "Ok" , Location : Point ( 50 , 55 ), Click : { Application . Exit ()}))
Application . Run ( f )
Functional equivalent of C# program below.
Simply, using Message Box:
public class HelloWorld
{
static void Main ()
{
System . Windows . Forms . MessageBox . Show ( "Hello, world!" );
}
}
Or:
using System ;
using System.Drawing ;
using System.Windows.Forms ;
public class HelloWorldForm : Form
{
public static void Main ()
{
Application . Run ( new HelloWorldForm ());
}
public HelloWorldForm ()
{
Label label = new Label ();
label . Text = "Hello, world!" ;
label . Location = new Point ( 40 , 30 );
this . Controls . Add ( label );
Button button = new Button ();
button . Text = "OK" ;
button . Location = new Point ( 50 , 55 );
this . Controls . Add ( button );
button . Click += new EventHandler ( button_Click );
}
private void button_Click ( Object sender , EventArgs e )
{
Application . Exit ();
}
}
The simplest way to achieve this is with the built in message function that is similar to the windows messageBox().
PROGRAM
MAP
END
CODE
MESSAGE('Hello, world!!','Clarion')
RETURN
A more real world example uses a Clarion structure to declare a window and the Clarion Accept loop to process events from that window.
PROGRAM
MAP
HelloProcedure PROCEDURE()
END
CODE
HelloProcedure()
RETURN
HelloProcedure PROCEDURE()
Window WINDOW('Clarion for Windows'),AT(,,222,116),FONT('Tahoma',8,,FONT:regular),ICON('Hey.ICO'), |
SYSTEM,GRAY
STRING('Hello, world!!'),AT(91,22),USE(?String1)
BUTTON('Close'),AT(92,78,37,14),USE(?CloseBtn),LEFT
END
CODE
OPEN(Window)
ACCEPT
CASE ACCEPTED()
OF ?CloseBtn
POST(EVENT:CloseWindow)
END
END
CLOSE(Window)
RETURN
#import <Cocoa/Cocoa.h>
@interface hello : NSObject {
}
@end
@implementation hello
-( void ) awakeFromNib
{
NSBeep (); // we don't need this but it's conventional to beep
// when you show an alert
NSRunAlertPanel ( @"Message from your Computer" , @"Hello, world!" , @"Hi!" ,
nil , nil );
}
@end
{curl 3.0, 4.0 applet}
{curl-file-attributes character-encoding = "utf-8"}
Hello, world!
program Hello_World ;
uses
QDialogs ;
begin
ShowMessage ( 'Hello, world!' ) ;
end .
oder
program Hello_World ;
uses
QDialogs ;
begin
MessageDlg ( 'Hello, world!' , mtInformation , [ mbOk ] , 0 ) ;
end .
- module ( hello_world ).
- export ([ hello / 0 ]).
hello () ->
S = gs : start (),
Win = gs : create ( window , S , [{ width , 100 }, { height , 50 }]),
gs : create ( label , Win , [{ label , { text , "Hello, world!" }}]),
gs : config ( Win , { map , true }),
receive
{ gs , Win , destroy , _, _} ->
gs : stop ()
end ,
ok .
One way of invoking this would be to enter hello_world:hello(). in the Erlang shell; another would be to run from a command line:
erl -noshell -run hello_world hello -run init stop
MS-Windows only - basic.
include msgbox.e
if message_box("Hello, world!", "Hello", 0) then end if
MS-Windows only - using Win32Lib library
include win32lib.ew
createForm({
";Window; Hello",
";Label; Hello, world!"
})
include w32start.ew
Using WindowsForms, at the F# interactive prompt:
let _ = System . Windows . Forms . MessageBox . Show ( "Hello, world!" );;
#include <fltk/Window.h>
#include <fltk/Widget.h>
#include <fltk/run.h>
using namespace fltk ;
int main ( int argc , char ** argv )
{
Window * window = new Window ( 300 , 180 );
window -> begin ();
Widget * box = new Widget ( 20 , 40 , 260 , 100 , "Hello, world!" );
box -> box ( UP_BOX );
box -> labelfont ( HELVETICA_BOLD_ITALIC );
box -> labelsize ( 36 );
box -> labeltype ( SHADOW_LABEL );
window -> end ();
window -> show ( argc , argv );
return run ();
}
PUBLIC SUB Main()
Message.Info("Hello, world!")
END
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 ();
}
}
include gtk2/wrapper.e
Info(NULL,"Hello","Hello, world!")
#include <iframe.hpp>
void main ()
{
IFrameWindow frame ( "Hello, world!" );
frame . showModally ()
}
import javax.swing.* ;
class HelloWorld {
public static void main ( final String [] args ) {
JFrame frame = new JFrame ();
frame . add ( new JLabel ( "Hello World" , SwingConstants . CENTER ));
frame . setSize ( 200 , 100 );
frame . setLocationRelativeTo ( null );
frame . setVisible ( true );
frame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );
}
}
package example ;
public class FXMLDocumentController extends Application implements Initializable {
@Override
public void start ( Stage stage ) throws Exception {
Parent root = FXMLLoader . load ( getClass (). getResource ( "FXMLDocument.fxml" ));
Scene scene = new Scene ( root );
stage . setScene ( scene );
stage . show ();
}
@FXML
private Label label ;
@Override
public void initialize ( URL url , ResourceBundle rb ) {
label . setText ( "Hello World!" );
}
public static void main ( String [] args ) {
launch ( args );
}
}
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane id= "AnchorPane" prefHeight= "200" prefWidth= "320" xmlns:fx= "http://javafx.com/fxml/1" fx:controller= "example.FXMLDocumentController" >
<children>
<Label layoutX= "126" layoutY= "80" minHeight= "16" minWidth= "69" fx:id= "label" />
</children>
</AnchorPane>
import org.gnome.gdk.* ;
class GdkSimple extends Window {
public GdkSimple () {
setTitle ( "Example" );
connect (( DeleteEvent )( source , event ) -> {
Gtk . mainQuit ();
return false ;
});
add ( new Label ( "Hello World" ));
setDefaultSize ( 250 , 150 );
setPosition ( WindowPosition . CENTER );
show ();
}
public static void main ( String [] args ) {
Gtk . init ( args );
new GdkSimple ();
Gtk . main ();
}
}
This creates a window labeled "Hello, world!" with a button labeled "Hello, world!".
hello : hello..l : "Hello, world!"
hello..c : `button
`show $ `hello
#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 ;
}
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx= "http://www.adobe.com/2006/mxml" >
<mx:Label text= "Hello, world!" />
</mx:Application>
This creates a message box saying "Hello, world!".
OutFile "HelloWorld.exe"
Name "Hello, world!"
Caption "Hello, world!"
Section Hello, world!
SectionEnd
Function .onInit
MessageBox MB_OK "Hello, world!"
Quit
FunctionEnd
Uses lablgtk
let () =
let window = GWindow . window ~ title : "Hello" ~ border_width : 10 () in
window # connect # destroy ~ callback : GMain . Main . quit ;
let button = GButton . button ~ label : "Hello World" ~ packing : window # add () in
button # connect # clicked ~ callback : window # destroy ;
window # show () ;
GMain . Main . main ()
(On Psion Series 3 and later compatible PDAs.)
PROC guihello:
ALERT("Hello, world!","","Exit")
ENDP
oder
PROC hello:
dINIT "Window Title"
dTEXT "","Hello, world!"
dBUTTONS "OK",13
DIALOG
ENDP
Patch as ASCII-art:
[Hello, world!(
|
[print]
Patch as sourcecode:
#N canvas 0 0 300 300 10;
#X msg 100 150 Hello, world!;
#X obj 100 200 print;
#X connect 0 0 1 0;
from Tkinter import Tk , Label
root = Tk ()
Label ( root , text = "Hello, world!" ) . pack ()
root . mainloop ()
Using PyQt:
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
app = QApplication ( sys . argv )
label = QLabel ( "Hello, World!" )
label . show ()
sys . exit ( app . exec_ ())
from gtk import *
label = Label ( "Hello, world!" )
label . show ()
window = Window ()
window . add ( label )
window . show ()
main ()
import pygame
import sys
pygame . init ()
screen = pygame . display . set_mode (( 512 , 256 ), 0 , 32 )
f = pygame . font . SysFont ( None , 32 )
t = f . render ( "Hello, world!" , True , ( 255 , 255 , 255 ))
tR = t . get_rect ()
screen . blit ( t , tR )
while True :
for event in pygame . event . get ():
if event . type == pygame . QUIT :
pygame . quit ()
sys . exit ()
pygame . display . update ()
Kivy multi-platform framework
import kivy
from kivy.app import App
from kivy.uix.label import Label
class MyApp ( App ):
def build ( self ):
return Label ( text = 'Hello world' )
MyApp () . run ()
#include <QApplication>
#include <QMessageBox>
int main ( int argc , char * argv [])
{
QApplication app ( argc , argv );
QMessageBox :: information ( 0 , "Qt4" , "Hello World!" );
}
oder
#include <qapplication.h>
#include <qpushbutton.h>
#include <qwidget.h>
#include <iostream>
class HelloWorld : public QWidget
{
Q_OBJECT
public :
HelloWorld ();
virtual ~ HelloWorld ();
public slots :
void handleButtonClicked ();
QPushButton * mPushButton ;
};
HelloWorld :: HelloWorld () :
QWidget (),
mPushButton ( new QPushButton ( "Hello, world!" , this ))
{
connect ( mPushButton , SIGNAL ( clicked ()), this , SLOT ( handleButtonClicked ()));
}
HelloWorld ::~ HelloWorld () {}
void HelloWorld :: handleButtonClicked ()
{
std :: cout << "Hello, world!" << std :: endl ;
}
int main ( int argc , char * argv [])
{
QApplication app ( argc , argv );
HelloWorld helloWorld ;
app . setMainWidget ( & helloWorld );
helloWorld . show ();
return app . exec ();
}
oder
#include <QApplication>
#include <QPushButton>
#include <QVBoxLayout>
int main ( int argc , char * argv [])
{
QApplication app ( argc , argv );
QWidget * window = new QWidget ;
QVBoxLayout * layout = new QVBoxLayout ( window );
QPushButton * hello = new QPushButton ( "Hello, world!" , window );
//connect the button to quitting
hello -> connect ( hello , SIGNAL ( clicked ()), & app , SLOT ( quit ()));
layout -> addWidget ( hello );
layout -> setMargin ( 10 );
layout -> setSpacing ( 10 );
window -> show ();
return app . exec ();
}
view layout [text "Hello, world!" ]
view [text "Hello, world!" ]
* "Hello, world!"
end
(On Hewlett-Packard HP-48G and HP-49G series calculators.)
<< "Hello, world!" MSGBOX >>
Hello ()
TEXT "Hello, world!"
require 'wxruby'
class HelloWorldApp < Wx :: App
def on_init
ourFrame = Wx :: Frame . new ( nil , - 1 , "Hello, world!" ) . show
ourDialogBox = Wx :: MessageDialog . new ( ourFrame , "Hello, world!" , "Information:" , \
Wx :: OK | Wx :: ICON_INFORMATION ) . show_modal
end
end
HelloWorldApp . new . main_loop
require 'gtk2'
Gtk . init
window = Gtk :: Window . new
window . signal_connect ( "delete_event" ) { Gtk . main_quit ; false }
button = Gtk :: Button . new ( "Hello, world!" )
button . signal_connect ( "clicked" ) { Gtk . main_quit ; false }
window . add ( button )
window . show_all
Gtk . main
require 'tk'
window = TkRoot . new { title 'Hello, world!' }
button = TkButton . new ( window ) {
text 'Hello, world!'
command proc { exit }
pack
}
Tk . mainloop
Evaluate in a workspace:
Dialog confirm: 'Hello, world!'
Using the Morphic GUI toolkit of Squeak Smalltalk:
('Hello, world!' asMorph openInWindow ) submorphs second color: Color black
Using wxSqueak:
Wx messageBox: 'Hello, world!'
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 ;
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 ();
}
}
label .l -text "Hello, world!"
pack .l
and the same in one line
pack [label .l -text "Hello, world!"]
package require Tk
tk_messageBox - message "Hello, world!"
oder
package require Tk
pack [ button .b - text "Hello, world!" - command exit]
Ubercode 1 class Hello
public function main()
code
call Msgbox("Hello", "Hello, world!")
end function
end class
message "Hello, world!"
void main ()
{
String s = "Hello World." ;
bc . OutputToConsole ( s );
}
Sub Main ()
MsgBox "Hello, world!"
End Sub
Private Sub Form_Load ( ByVal sender As Object , ByVal e As System . EventArgs ) Handles MyBase . Load
MessageBox . Show ( "Hello, world!" )
Me . Close ()
End Sub
Note that the previous example will only work when the code is entered as part of a Form Load Event, such as the one created by default when generating a new project in the Visual Studio programming environment. Equivalently, the following code is roughly equivalent to the traditional Visual Basic 6 code by disabling the Application Framework and setting 'Sub Main' as the entry point for the application:
Public Module MyApplication
Sub Main ()
MessageBox . Show ( "Hello, world!" )
End Sub
End Class
or using a class;
Public Class MyApplication
Shared Sub Main ()
MessageBox . Show ( "Hello, world!" )
End Sub
End Class
#include @" pfc\vpi\vpi.ph "
goal
vpiCommonDialogs :: note ( " Hello, world! " ).
This uses the Windows API to create a full window containing the text.
/*
Name: Win32 example
Copyright: GLP
Author: Ryon S. Hunter
Date: 20/03/07 17:11
Description: This is an example of what a Win32 hello world looks like.
*/
#include <windows.h>
#define APPTITLE "Win32 - Hello world"
BOOL InitInstance ( HINSTANCE , int );
ATOM MyRegisterClass ( HINSTANCE );
LRESULT CALLBACK WinProc ( HWND , UINT , WPARAM , LPARAM );
LRESULT CALLBACK WinProc ( HWND hWnd , UINT message , WPARAM wParam , LPARAM lParam )
{
PAINTSTRUCT ps ;
COLORREF c = RGB ( 0 , 0 , 0 );
HDC hdc ;
RECT rt ;
switch ( message )
{
case WM_DESTROY : // Exit the window? Ok
PostQuitMessage ( 0 );
break ;
case WM_PAINT :
GetClientRect ( hWnd , & rt );
hdc = BeginPaint ( hWnd , & ps );
DrawText ( hdc , "Hello world!" , sizeof ( "Hello world!" ), & rt , DT_CENTER );
EndPaint ( hWnd , & ps );
break ;
}
return DefWindowProc ( hWnd , message , wParam , lParam );
}
ATOM MyRegisterClass ( HINSTANCE hInstance )
{
WNDCLASSEX wc ;
wc . cbSize = sizeof ( WNDCLASSEX );
wc . style = CS_HREDRAW | CS_VREDRAW ;
wc . lpfnWndProc = ( WNDPROC ) WinProc ;
wc . cbClsExtra = 0 ;
wc . cbWndExtra = 0 ;
wc . hInstance = 0 ;
wc . hIcon = NULL ;
wc . hCursor = LoadCursor ( NULL , IDC_ARROW );
wc . hbrBackground = ( HBRUSH ) GetStockObject ( WHITE_BRUSH );
wc . lpszMenuName = NULL ;
wc . lpszClassName = APPTITLE ;
wc . hIconSm = NULL ;
return RegisterClassEx ( & wc );
}
BOOL InitInstance ( HINSTANCE hInstance , int nCmdShow )
{
HWND hWnd ;
hWnd = CreateWindow ( // Create a win32 window
APPTITLE ,
APPTITLE ,
WS_OVERLAPPEDWINDOW ,
CW_USEDEFAULT ,
CW_USEDEFAULT ,
500 ,
400 ,
NULL ,
NULL ,
hInstance ,
NULL );
if ( ! hWnd ) return FALSE ;
ShowWindow ( hWnd , nCmdShow );
UpdateWindow ( hWnd );
return TRUE ;
}
int WINAPI WinMain ( HINSTANCE hInstance ,
HINSTANCE hPrevInstance ,
LPSTR lpCmdLine ,
int nCmdShow )
{
MSG msg ;
MyRegisterClass ( hInstance );
if ( ! InitInstance ( hInstance , nCmdShow ) )
return 1 ;
while ( GetMessage ( & msg , NULL , 0 , 0 ) )
{
TranslateMessage ( & msg );
DispatchMessage ( & msg );
}
return msg . wParam ;
}
In the Open event handler of the default window:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id= "yourwindow" xmlns= "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" >
<label value= "Hello, World!" />
</window>
with ( Maplets ) :
with ( Maplets [ Elements ]) :
maplet := Maplet ( [[ "Hello world!" ]] ) :
Display ( maplet ) ;
The following sequence of characters, expressed in hexadecimal notation (with carriage return and newline characters at end of sequence):
48 65 6C 6C 6F 2C 20 77 6F 72 6C 64 21 0D 0A
The following sequence of characters, expressed as binary numbers (with cr/nl as above, and the same ordering of bytes):
00-07: 01001000 01100101 01101100 01101100 01101111 00101100 00100000 01110111
08-0E: 01101111 01110010 01101100 01100100 00100001 00001101 00001010
(Using UTF-8 character set.)
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< title > Hello, world!</ title >
</ head >
< body >
< p > Hello, world!</ p >
</ body >
</ html >
< html >
< body >
Hello, world!
</ body >
</ html >
The <html> and <body> tags are not necessary for informal testing.
Simply write it as text without tags.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
< html >
< head >
< title > Hello, world!</ title >
</ head >
< body >
< p > Hello, world!</ p >
</ body >
</ html >
The first paragraph of the W3C Recommendation on The global structure of an HTML document also features this example.
This is the smallest legal version, leaving out all optional tags
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
< title > Hello, world!</ title >
< p > Hello, world!
<!DOCTYPE html>
< html >
< head >
< title > Hello, World!</ title >
</ head >
< body >
< h1 > Hello, world!</ h1 >
</ body >
</ html >
Hello, World!
Hello, World!
%PDF-1.0
1 0 obj
<<
/Type /Catalog
/Pages 3 0 R
/Outlines 2 0 R
>>
endobj
2 0 obj
<<
/Type /Outlines
/Count 0
>>
endobj
3 0 obj
<<
/Type /Pages
/Count 1
/Kids [4 0 R]
>>
endobj
4 0 obj
<<
/Type /Page
/Parent 3 0 R
/Resources << /Font << /F1 7 0 R >>/ProcSet 6 0 R
>>
/MediaBox [0 0 612 792]
/Contents 5 0 R
>>
endobj
5 0 obj
<< /Length 44 >>
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
0000000322 00000 n
0000000415 00000 n
0000000445 00000 n
trailer
<<
/Size 8
/Root 1 0 R
>>
startxref
553
%%EOF
This is a valid PDF only if the text file has CRLF line endings.
% Displays on console.
(Hello, world!) =
%!
% Displays as page output.
/Courier findfont
24 scalefont
setfont
100 100 moveto
(Hello, world!) show
showpage
{\rtf1\ansi\deff0
{\fonttbl {\f0 Courier New;}}
\f0\fs20 Hello, world!
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns= "http://www.w3.org/2000/svg" width= "200" height= "100" >
<text x= "50" y= "50" > Hello, world!</text>
</svg>
\documentclass { article}
\begin { document}
Hello, world!
\end { document}
\starttext
Hello, world!
\stoptext
BlankClip()
Subtitle("Hello, world!")
(Creates a video with default properties)
on exitFrame me
put "Hello, world!"
end
Outputs the string to the message window if placed in a single movie frame. Alternatively, to display an alert box stating the message you could use
on exitFrame me
alert "Hello, world!"
end
#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 }
}
This page shows the Hello, world! program in esoteric programming languages — that is, working programming languages that were designed as experiments or jokes and were not intended for serious use.
<:48:x<:65:=<:6C:$=$=$$~<:03:+$<:2c:~$~<:c:x-$<:77:
~$~<:8:x-$~<:03:+$~<:06:x-$x<:0e:x-$=x<:43:x-$
use java . lang . * ;
main
{
System -> out -> println [ ' Hello , world ! ' ] ;
}
■→→■↓■←■←■↓■→→■ /* makes H */
→→■↓■↑↑↑■ /* makes I */
v v "Hello, world!!" <
> ^
> > : # v _@
^ . <
As documented at http://www.ioccc.org/2012/tromp/hint.html
(any of the 16 ASCII characters from ' ' to '/' can be used at the start)
!Hello, world
From Eric Raymond's interpreter package (changed to use upper case as in the book).
DEFINE PROCEDURE ''HELLO-WORLD''[N]:
BLOCK 0: BEGIN
PRINT['Hello, world!'];
BLOCK 0: END.
+++++ +++++ initialize counter (cell #0) to 10
[ use loop to set the next four cells to 70/100/30/10
> +++++ ++ add 7 to cell #1
> +++++ +++++ add 10 to cell #2
> +++ add 3 to cell #3
> + add 1 to cell #4
<<<< - decrement counter (cell #0)
]
> ++ . print 'H'
> + . print 'e'
+++++ ++ . print 'l'
. print 'l'
+++ . print 'o'
> ++ . print ' '
<< +++++ +++++ +++++ . print 'W'
> . print 'o'
+++ . print 'r'
----- - . print 'l'
----- --- . print 'd'
> + . print '!'
> . print '\n'
Hello, world! Souffle by David Morgan-Mar.
Hello World Souffle.
This recipe prints the immortal words "Hello world!", in a basically brute force way. It also makes a lot of food for one person.
Ingredients.
72 g haricot beans
101 eggs
108 g lard
111 cups oil
32 zucchinis
119 ml water
114 g red salmon
100 g dijon mustard
33 potatoes
Method.
Put potatoes into the mixing bowl.
Put dijon mustard into the mixing bowl.
Put lard into the mixing bowl.
Put red salmon into the mixing bowl.
Put oil into the mixing bowl.
Put water into the mixing bowl.
Put zucchinis into the mixing bowl.
Put oil into the mixing bowl.
Put lard into the mixing bowl.
Put lard into the mixing bowl.
Put eggs into the mixing bowl.
Put haricot beans into the mixing bowl.
Liquefy contents of the mixing bowl.
Pour contents of the mixing bowl into the baking dish.
Serves 1.
Later Mike Worth wrote tastier and actually functional recipe .
Hello World Cake with Chocolate sauce.
This prints hello world, while being tastier than Hello World Souffle. The main
chef makes a " world!" cake, which he puts in the baking dish. When he gets the
sous chef to make the "Hello" chocolate sauce, it gets put into the baking dish
and then the whole thing is printed when he refrigerates the sauce. When
actually cooking, I'm interpreting the chocolate sauce baking dish to be
separate from the cake one and Liquify to mean either melt or blend depending on
context.
Ingredients.
33 g chocolate chips
100 g butter
54 ml double cream
2 pinches baking powder
114 g sugar
111 ml beaten eggs
119 g flour
32 g cocoa powder
0 g cake mixture
Cooking time: 25 minutes.
Pre-heat oven to 180 degrees Celsius.
Method.
Put chocolate chips into the mixing bowl.
Put butter into the mixing bowl.
Put sugar into the mixing bowl.
Put beaten eggs into the mixing bowl.
Put flour into the mixing bowl.
Put baking powder into the mixing bowl.
Put cocoa powder into the mixing bowl.
Stir the mixing bowl for 1 minute.
Combine double cream into the mixing bowl.
Stir the mixing bowl for 4 minutes.
Liquify the contents of the mixing bowl.
Pour contents of the mixing bowl into the baking dish.
bake the cake mixture.
Wait until baked.
Serve with chocolate sauce.
chocolate sauce.
Ingredients.
111 g sugar
108 ml hot water
108 ml heated double cream
101 g dark chocolate
72 g milk chocolate
Method.
Clean the mixing bowl.
Put sugar into the mixing bowl.
Put hot water into the mixing bowl.
Put heated double cream into the mixing bowl.
dissolve the sugar.
agitate the sugar until dissolved.
Liquify the dark chocolate.
Put dark chocolate into the mixing bowl.
Liquify the milk chocolate.
Put milk chocolate into the mixing bowl.
Liquify contents of the mixing bowl.
Pour contents of the mixing bowl into the baking dish.
Refrigerate for 1 hour.
"Hello, World!
"
The newline before the terminating quote mark is necessary.
H
PLEASE DO , 1 <- # 13
DO , 1 SUB # 1 <- # 238
DO , 1 SUB # 2 <- # 112
DO , 1 SUB # 3 <- # 112
DO , 1 SUB # 4 <- # 0
DO , 1 SUB # 5 <- # 64
DO , 1 SUB # 6 <- # 238
DO , 1 SUB # 7 <- # 26
DO , 1 SUB # 8 <- # 248
DO , 1 SUB # 9 <- # 168
DO , 1 SUB # 10 <- # 24
DO , 1 SUB # 11 <- # 16
DO , 1 SUB # 12 <- # 158
DO , 1 SUB # 13 <- # 52
PLEASE READ OUT , 1
PLEASE GIVE UP
HAI;
CAN HAS STDIO?;
VISIBLE "Hello, World!";
KTHXBYE;
HAI 3.4 0 100
IM IN UR CODE EXECUTIN UR KOMANDZ
PLZ PRINT TEXT HELLO WORLD!
IM OUTTA UR CODE
(=<`:9876Z4321UT.-Q+*)M'&%$H"!~}|Bzy?=|{z]KwZY44Eq0/{mlk**hKs_dG5[m_BA{?-Y;;Vb'rR5431M}/.zHGwEDCBA@98\6543W10/.R,+O< hello
"Hello, world!\n"
Not really an esoteric language, but this code uses obfuscation :
qq chop lc and print chr ord uc q chop uc and print chr ord q ne sin and
print chr ord qw q le q and print chr ord q else and print chr ord q pop
and print chr oct oct ord uc qw q bind q and print chr ord q q eq and print
chr ord qw q warn q and print chr ord q pop and print chr ord q qr q and
print chr ord q else and print chr ord qw q do q and print chr hex length
q q semctl setpgrp chop q
Piet programming language uses only colors.
Hello world in piet (see from 41:40 minute on "The Art of Code" on YouTube)
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]
/e+++++++++++++++++++++++++++++.\
./\/\/\ /+++\!>.+++o.l.+++++++l/ #/?\
$H!\++++++\ + \comma.------------ .<w++++++++.\ /?\<!\-/
/++++++/ +/\ /.--------o/ \-/!.++++++++++/?\n
/=\++++++\ +\\!=++++++\ \r+++.l------.d--------.>+.!\-/
\!\/\/\/\/ \++++++++++/
Modular SNUSP:
/@@@@++++# #+++@@\ #-----@@@\n
$@\H.@/e.+++++++l.l.+++o.>>++++.< .<@/w.@\o.+++r.++@\l.@\d.>+.@/.#
\@@@@=>++++>+++++<<@+++++# #---@@/!=========/!==/
1111110010001011111111111101100000110100010100101111111111001000101111111111011000001101 0100101011111110010100010101110010100101111001000101111111111101100000110100010100111110 0100010000000000000011000001101000101001101101101101111100100010111110110000011010001010 0100100010101110010100000000000000000000010100000000000000000000000000010100100101001010
12 (32 35 37 38 42)
13 (35 37 38 39 43)
14 ((31 36 39 42 43))
15 (31 33 34 35 38 40 43)
16 (37 39)
17 ((31 43))
18 ((36 42 43))
20 ((42(43)))
21 44
31 ((31)(44))
32 (32(31))
33 (33(32))
34 (34(33))
35 (35(34))
36 (36(35))
37 (37(36))
38 (38(37))
39 (39(38))
40 (40(39))
41 (41(40))
42 (42(41))
43 (43(42))
44 1
"Hello, World!" is waiting at the Writer's Depot.
Go to Writer's Depot: west 1st left, 2nd right, 1st left, 2nd left.
Pickup a passenger going to the Post Office.
Go to the Post Office: north 1st right, 2nd right, 1st left.
Go to the Taxi Garage: north 1st right, 1st left, 1st right.
%begin @jump $main
%main.0 @echo %msg
%main.1 @end
%main.count 2
%msg Hello, world!
x=Hello,world!
x=print
`r```````````.H.e.l.l.o. .w.o.r.l.di
Note: actually prints "What do you want, universe?" in Klingon.
~ nuqneH { ~ 'u' ~ nuqneH disp disp } name
nuqneH
Note that whitespace has been highlighted (Space , Tab )
empty-line
empty-line
empty-line
empty-line
empty-line
empty-line
empty-line/EOF
<print>Hello, world!</print>
@ HelloWorld . Ya ;
using < stdio . h > ;
$int ( $char [][] args ) main
printf ( "Hello, %s! \n " , args . Length > 1 ? args [ 1 ] : "World" );
return 0 ;
A code language that draws in binary on a braille plotter.
BGN GRPLOT BIN
DRAWPLOT
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0011100111001111111001110000000011100000000001111100000000001000001000011111000001111100000100000000011111110000
0001000010000100001000100000000001000000000010000010000000001000001000100000100010000010000100000000010000001000
0001000010000100000000100000000001000000000010000010000000001000001000100000100010000010000100000000010000001000
0001111110000111100000100000000001000000000010000010000000001001001000100000100011111110000100000000010000001000
0001000010000100000000100000000001000000000010000010000000001011101000100000100010000001000100000000010000001000
0001000010000100001000100000000001000000000010000010000000001100011000100000100010000000100100000000010000001000
0011100111001111111001111111100011111111000001111100000000001000001000011111000010000000100111111100011111110000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
ENDDRAW
END
The OO language looks like C.
use System . Windows . Forms ;
class HelloWorld extends System . Windows . Forms
{
protected :
String hw ;
construct HelloWorld ()
{
this . hw = 'Hello, world!' ;
}
public void function show ()
{
MessageBox . show ( this . hw , '' );
}
}
Copy this and paste in ChatGPT, on a new chat:
Output: Hello, world!
A longer version, which still prints "Hello, world!":
CreateBuf: $Hello$
$Hello$: {
[H]
[e]
[l]
[l]
[o]
[,]
[32] @ The ASCII value for space
[w]
[o]
[r]
[l]
[d]
[!]
}
OpenBuf: $Hello$
JoinAllChars: $Hello$ => $Hello2$
Output: $Hello2$
CloseBuf: $Hello$
Note: The first method is tested and it's working. I don't know about the second one!