Hallo-Welt-Programm
aus Wikipedia, der freien Enzyklopädie
Einfache Beispiele von Computerprogrammen, die zum Beispiel zur Demonstration verwendet werden, bestehen häufig nur aus ein paar Zeilen Programmcode, die den Text Hallo, Welt! oder auf Englisch Hello, world! ausgeben. Dieses Programm soll als eines der einfachst möglichen zeigen, was für ein vollständiges Programm (in der betreffenden Programmiersprache) benötigt wird, und einen ersten Einblick in die Syntax geben. Ein solches Programm ist auch geeignet, die erfolgreiche Installation eines Compilers für die entsprechende Programmiersprache zu überprüfen.
Die Verwendung des Textes „Hello, world!“, der natürlich auch durch einen beliebigen Text ersetzt werden kann, aber dennoch gerne unverändert benutzt wird, ist eine Tradition und geht auf ein internes Programmierhandbuch der Bell Laboratories über die Programmiersprache C zurück, das Brian Kernighan dort 1974 verfasste, nachdem er dort schon ein Jahr zuvor die Worte „hello“ und „world“ in einer Einführung in die Programmiersprache B verwendet hatte. Bekanntheit erlangte der Text jedoch erst durch die Veröffentlichung in dem Buch The C Programming Language (deutsch: Programmieren in C) von Brian Kernighan und Dennis Ritchie, auch wenn in dem dortigen Beispiel die Schreibung „hello world“ verwendet wurde.
Viele der folgenden Beispiele geben nicht nur den Text aus, sondern enthalten Kommentare oder definieren zusätzlich noch Parameter wie Position oder Schriftart, die dann rein willkürlich gewählt sind.
[Bearbeiten] Zeilenorientiert (Konsole)
[Bearbeiten] ABAP
REPORT Z_HALLO_WELT. WRITE 'Hallo Welt!'.
[Bearbeiten] Actionscript
trace('Hallo Welt');
[Bearbeiten] Ada
with Ada.Text_IO;
Für eine Erklärung des Programmes siehe wikibooks:Programming:Ada:Basic.
[Bearbeiten] ALGOL 60
'BEGIN' OUTSTRING(2,'('HALLO WELT')'); 'END'
[Bearbeiten] ALGOL 68
( print("Hallo Welt!") )
[Bearbeiten] APL
'Hallo Welt!'
[Bearbeiten] Assembler
start:
MOV AX,@data
MOV DS,AX
MOV DX, OFFSET HW
MOV AH, 09H
INT 21H
MOV AH, 4Ch
INT 21H
end start
x86-CPU, Linux # Kompilieren mit "as -o hallo.o hallo.s; ld -o hallo hallo.o" .section .data s: .ascii "Hallo Welt!\n" .section .text .globl _start _start: movl $4,%eax # Syscall-ID 4 (= __NR_write) movl $1,%ebx # Ausgabe-Filedeskriptor STDOUT (= 1) movl $s,%ecx # Adresse des ersten Zeichens der Zeichenkette movl $12,%edx # Länge der Zeichenkette (12 Zeichen) int $0x80 # Softwareinterrupt 0x80 um Syscall (write(1,s,12))auszuführen movl $1,%eax # Syscall-ID 1 (= __NR_exit) movl $0,%ebx # Rückgabewert 0 (= alles ok) int $0x80 # Softwareinterrupt 0x80 um Syscall (exit(0)) auszuführen
PowerPC-CPU, Linux # Kompilieren mit "gcc -nostdlib -s hallo.s" .section .rodata .align 2 .s: .string "Hallo Welt!\n"
li 0,1 # SYS_exit
li 3,0 # returncode = 0
sc # syscall
680x0-CPU, Amiga ; Getestet mit ASM-One V1.01 move.l 4.w,a6 lea dosn(pc),a1 jsr -408(a6) ; OldOpenLibrary
move.l a6,a1
move.l 4.w,a6
jsr -414(a6) ; CloseLibrary
moveq #0,d0
rts
dosn: dc.b "dos.library",0
s: dc.b "Hallo Welt",10,0
PA-RISC-CPU, HP-UX ; Kompiliert und getestet mit ; "as hallo.s ; ld hallo.o /usr/ccs/lib/crt0" ; unter HP-UX 11.0 auf einer HP9000/L2000 .LEVEL 1.1 .SPACE $TEXT$ .SUBSPA $LIT$,ACCESS=0x2c s .STRING "Hallo Welt\x0a"
ldi 1,%r22 ; SYS_exit
be,l 4(%sr7,%r18) ; Syscall
ldi 0,%r26 ; returncode = 0 (Branch delay slot)
x86-CPU, FreeBSD, Intel-Syntax section .data hello_world db 'hello world', 0x0a hello_world_len equ $ - hello_world section .text align 4 sys: int 0x80 ret global _start _start: push hello_world_len push hello_world push 1 mov eax, 4 call sys push 0 mov eax, 1 call sys
[Bearbeiten] Autohotkey
MsgBox, Hallo Welt!
[Bearbeiten] AutoIt
MsgBox(0, "", "Hallo Welt!")
[Bearbeiten] awk
BEGIN { print "Hallo Welt!" }
[Bearbeiten] B
main() { printf("Hallo Welt"); }
[Bearbeiten] BASIC
Traditionelles, unstrukturiertes BASIC: 10 PRINT "Hallo Welt!"
bzw. im Direktmodus:
[Bearbeiten] BCPL
GET "LIBHDR" LET START () BE $( WRITES ("Hallo Welt!*N") $)
[Bearbeiten] BeanShell
print("Hallo Welt!");
[Bearbeiten] BlitzBasic
print "Hallo Welt!"
[Bearbeiten] Boo
print "Hallo Welt!"
[Bearbeiten] C
#include <stdio.h>
Siehe auch: Hallo-Welt-Programm in C, Varianten der Programmiersprache C
[Bearbeiten] C++
#include <iostream>
using namespace std;
Mit Funktion:
[Bearbeiten] C++/CLI
int main() { System::Console::Out::WriteLine("Hallo Welt!"); }
[Bearbeiten] C#
class MainClass { public static void Main() { System.Console.WriteLine("Hallo Welt!"); } }
oder
class HalloWelt
{
static void Main(string args)
{
Console.WriteLine("Hallo Welt!");
}
}
[Bearbeiten] Chrome
namespace Hallo; interface implementation method Main; begin Console.WriteLine('Hallo Welt!'); end.
[Bearbeiten] CLIST
WRITE HALLO WELT
[Bearbeiten] COBOL
000100 IDENTIFICATION DIVISION. 000200 PROGRAM-ID. HELLOWORLD. 000300 000400* 000500 ENVIRONMENT DIVISION. 000600 CONFIGURATION SECTION. 000700 SOURCE-COMPUTER. RM-COBOL. 000800 OBJECT-COMPUTER. RM-COBOL. 000900 001000 DATA DIVISION. 001100 FILE SECTION. 001200 100000 PROCEDURE DIVISION. 100100 100200 MAIN-LOGIC SECTION. 100300 BEGIN. 100400 DISPLAY " " LINE 1 POSITION 1 ERASE EOS. 100500 DISPLAY "Hello world!" LINE 15 POSITION 10. 100600 STOP RUN. 100700 MAIN-LOGIC-EXIT. 100800 EXIT.
[Bearbeiten] Commodore 64 (Basic)
10 print "Hallo Welt!"
[Bearbeiten] Common Lisp
(write-line "Hallo Welt!")
[Bearbeiten] Component Pascal
MODULE HalloWelt;
PROCEDURE Output*;
BEGIN
Out.String ("Hallo Welt!");
Out.Ln;
END Output;
[Bearbeiten] D
import std.stdio;
[Bearbeiten] DarkBASIC
print "Hallo Welt!" wait key
[Bearbeiten] dBase/Foxpro
? "Hallo Welt!" wait window "Hallo Welt!"
[Bearbeiten] Dylan
define method hallo-welt() format-out("Hallo Welt\n"); end method hallo-welt;
[Bearbeiten] E
PROC main() WriteF('Hallo Welt!') ENDPROC
[Bearbeiten] EASY
in der Variante tdbengine:
[Bearbeiten] Eiffel
class HALLO_WELT create make feature make is do io.put_string("Hallo Welt!%N") end end
[Bearbeiten] Emacs Lisp
(print "Hallo Welt")
[Bearbeiten] Erlang
-module(Hallo). -export([Hallo_Welt/0]). Hallo_Welt() -> io:fwrite("Hallo Welt!\n").
[Bearbeiten] Forth
: halloforth ( -- ) ." Hallo Welt!" ;
[Bearbeiten] Fortran
PROGRAM HALLO WRITE(*,*) "Hallo Welt!" END PROGRAM
[Bearbeiten] Fortress
component HalloWelt export Executable run(args:String...) = print "Hallo Welt!" end
[Bearbeiten] Haskell
main :: IO () main = putStr "Hallo Welt!\n"
[Bearbeiten] Io
"Hallo Welt" print
[Bearbeiten] IL (IL Assembler)
.assembly HalloWelt { } .assembly extern mscorlib { }
ldstr "Hallo Welt!"
call void [mscorlib]System.Console::WriteLine(string)
ret
}
[Bearbeiten] Iptscrae
"Hallo Welt!" SAY
[Bearbeiten] J#
public class HalloWelt { public static void main(String[] args) { System.Console.WriteLine("Hallo Welt!"); } }
oder
[Bearbeiten] Javascript
WriteLn("Hello World"); DebugBreak;
oder …
oder …
[Bearbeiten] Java
public class Hallo { public static void main(String[] args) { System.out.println("Hallo Welt!"); System.out.printf("Hallo Welt!"); // alternativ ab Java 1.5 } }
[Bearbeiten] Lua
print ("Hallo Welt!")
[Bearbeiten] Logo
print [Hallo Welt!]
[Bearbeiten] MATLAB
fprintf('Hallo Welt!');
[Bearbeiten] Maschinensprache (DOS-COM-Programm auf Intel 80x86)
BA 0B 01 B4 09 CD 21 B4 4C CD 21 48 61 6C 6C 6F 2C 20 57 65 6C 74 21 24
[Bearbeiten] mIRC Script
/echo Hallo Welt!
[Bearbeiten] Mixal
TERM EQU 18 the MIX console device number ORIG 1000 start address START OUT MSG(TERM) output data at address MSG HLT halt execution MSG ALF "MIXAL" ALF " HELL" ALF "O WOR" ALF "LD " END START end of the program
[Bearbeiten] MMIX, MMIXAL
string BYTE "Hallo Welt!",#a,0 auszugebende Zeichenkette (#a ist ein Zeilenumbruch und 0 schließt die Zeichenkette ab) Main GETA $255,string Adresse der Zeichenkette in Register 255 ablegen TRAP 0,Fputs,StdOut Zeichenkette, auf die mit Register 255 verwiesen wird in Datei StdOut ausgeben TRAP 0,Halt,0 Prozess beenden
[Bearbeiten] MS-DOS Batch
@echo Hallo Welt!
[Bearbeiten] Mumps
W "Hallo Welt",!
[Bearbeiten] Natural
WRITE 'Hallo Welt' * END
[Bearbeiten] Oberon
MODULE HalloWelt; IMPORT Write; BEGIN Write.Line("Hallo Welt!"); END HalloWelt.
[Bearbeiten] OCaml
print_string "Hallo Welt!\n";;
[Bearbeiten] Objective C
#import <stdio.h>
[Bearbeiten] ObjectPAL (Paradox Application Language)
method run(var eventInfo Event) msginfo("Info", "Hallo Welt!") endMethod
[Bearbeiten] Object Pascal (Delphi)
program HalloWelt; {$APPTYPE CONSOLE} begin writeln('Hallo Welt!'); end.
[Bearbeiten] OPAL
-- Signatur und Implementation sind eigentlich zwei Dateien Signature HelloWorld
Implementation HelloWorld
[Bearbeiten] OPL
PROC Hallo: PRINT "Hallo Welt!" ENDP
[Bearbeiten] Pascal
program Hallo ( output ); begin writeln('Hallo Welt!') end.
[Bearbeiten] Turbo Pascal
begin write ('Hallo Welt!'); end.
[Bearbeiten] Perl
print "Hallo Welt!";
[Bearbeiten] Phalanger
<?
return 0;
}
}
[Bearbeiten] Pike
int main() { write("Hallo Welt!\n"); return 0; }
[Bearbeiten] PILOT
T:Hallo Welt!
[Bearbeiten] PocketC
Konsole: main() { puts("Hallo Welt!"); } Dialogfenster: main() { alert("Hallo Welt!"); } In einer Textbox: main() { box=createctl("EDIT","Test",ES_MULTILINE,0x000,30,30,100,30,3000); editset(box,"Hallo Welt!"); }
[Bearbeiten] PL/I
Test: procedure options(main); put skip list("Hallo Welt!"); end Test;
[Bearbeiten] PL/SQL
BEGIN DBMS_OUTPUT.PUT_LINE('Hallo Welt!'); END;
[Bearbeiten] POV-Ray
camera { location <0, 0, -5> look_at <0, 0, 0> } light_source { <10, 20, -10> color rgb 1 } light_source { <-10, 20, -10> color rgb 1 } background { color rgb 1 } text { ttf "someFont.ttf" "Hello World!", 0.015, 0 pigment { color rgb <0, 0, 1> } translate -3*x }
[Bearbeiten] PowerShell Script
Kommandozeile:
alternativ:
oder:
oder:
Dialogfenster:
[Bearbeiten] Prolog
?- write('Hallo Welt!'), nl.
[Bearbeiten] PureBasic
- In der Konsole
OpenConsole() Print("Hallo Welt!") CloseConsole()
- Im Dialogfenster
MessageRequester("","Hallo Welt")
- Im Fenster
If OpenWindow (1,0,0,300,50,#PB_Window_ScreenCentered|#PB_Window_SystemMenu,"Hallo Welt") If CreateGadgetList(WindowID(1)) TextGadget(1,10,10,280,20,"Hallo Welt!!!",#PB_Text_Border) EndIf Repeat event.l = WaitwindowEvent() Until event.l = #PB_Event_CloseWindow End EndIf
[Bearbeiten] Pure Data
- Patch im Quelltext
#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;
[Bearbeiten] Python
print "Hallo Welt!"
[Bearbeiten] QBASIC
PRINT "Hallo Welt"
[Bearbeiten] R
Gibt folgendes aus: [1] "Hallo Welt!"
oder
cat ("Hallo Welt!\n")
[Bearbeiten] RapidBATCH
echo 'Hallo Welt' end
[Bearbeiten] REXX
say "Hallo Welt!"
[Bearbeiten] RPG
- RPG 3
C MOVE *BLANKS HALLO 10 C MOVEL'HALLO' HALLO C MOVE 'WELT' HALLO C DSPLY HALLO C MOVE '1' *INLR
- RPG 4
D HALLO S 10A C EVAL HALLO = 'Hallo Welt' C DSPLY HALLO C EVAL *INLR = *ON
- RPG 4 (Free)
D HALLO S 10A /FREE HALLO = 'Hallo Welt'; DSPLY HALLO; *INLR = *ON; /END-FREE
[Bearbeiten] RPL
<< "Hallo Welt!" 1 Disp>>
[Bearbeiten] Ruby
puts "Hallo Welt!"
[Bearbeiten] SAS
data _null_; put "Hallo Welt!"; run;
oder
[Bearbeiten] Scheme
(display "Hallo Welt!") (newline)
[Bearbeiten] sed
Benötigt mindestens ein Zeichen als Eingabe:
Oder
[Bearbeiten] Seed7
$ include "seed7_05.s7i";
[Bearbeiten] Self
'Hallo Welt!' print.
[Bearbeiten] Smalltalk
'Hallo Welt!' out.
[Bearbeiten] SNOBOL4
OUTPUT = "Hallo Welt!" END
[Bearbeiten] Spec#
using System;
[Bearbeiten] Standard ML
print "Hallo Welt!\n"
[Bearbeiten] STARLET
RACINE: HELLO_WORLD. NOTIONS: HELLO_WORLD : ecrire("Hallo Welt!").
[Bearbeiten] SPL
debug "Hallo Welt";
[Bearbeiten] SQL
SELECT 'Hallo Welt!' AS message;
Für IBM-DB2
Für MSSQL
[Bearbeiten] StarOffice Basic
sub main print "Hallo Welt!" end sub
[Bearbeiten] Tcl
puts "Hallo Welt!"
[Bearbeiten] Teco
iHallo Welt!$ht$$
[Bearbeiten] TI-Basic
TI-Basic auf dem TI-83 Plus.
oder
oder :Text "Hallo Welt!"
[Bearbeiten] Turing
put "Hallo Welt!"
[Bearbeiten] Unix-Shell
echo 'Hallo Welt!'
[Bearbeiten] Verilog
module hallo_welt; initial begin $display ("Hallo Welt!"); #10 $finish; end endmodule
[Bearbeiten] VHDL
entity HelloWorld is end entity HelloWorld; architecture Bhv of HelloWorld is begin HelloWorldProc: process is begin report "Hallo Welt!"; wait; end process HelloWorldProc; end architecture HelloWorld;
[Bearbeiten] Grafische Benutzeroberflächen – als traditionelle Anwendungen
[Bearbeiten] AppleScript
display dialog "Hallo Welt!"
[Bearbeiten] Autohotkey
gui, font, s20 Gui, Add, Text,cgreen center, Hallo Welt! Gui, Add, Button, x65 default, OK Gui, Show,W200 H150, Hallo Welt Beispiel return GuiClose: ButtonOK: ExitApp
[Bearbeiten] AutoIt
;AutoIt 3.X MsgBox(0, "", "Hallo Welt!")
[Bearbeiten] C mit GTK
/* * Kompilieren mit "gcc hello_world.c -o hello_world `pkg-config --cflags --libs gtk+-2.0`". * (Falls die Datei unter dem Namen "hello_world.c" gespeichert wurde.) */ #include <gtk/gtk.h>
void destroy(GtkWidget *widget, gpointer data) {
gtk_main_quit();
}
int main (int argc, char *argv[]) {
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_set_border_width(GTK_CONTAINER(window), 10);
g_signal_connect(G_OBJECT(window), "delete-event", G_CALLBACK(delete_event), NULL);
g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(destroy), NULL);
gtk_container_add(GTK_CONTAINER(window), button);
gtk_widget_show(window);
[Bearbeiten] C#
using System; using System.Drawing; using System.Windows.Forms;
public HelloWorldForm()
{
Label label = new Label();
label.Text = "Hallo, Welt!";
label.Location = new Point(40, 30);
Controls.Add(label);
Button button = new Button();
button.Text = "OK";
button.Location = new Point(50, 55);
Controls.Add(button);
button.Click += new EventHandler(OnButtonOk);
}
oder mit Hilfe der statischen Klasse MessageBox:
[Bearbeiten] C++ mit gtkmm
/* * Kompilieren mit g++ hello_world.cc -o hello_world `pkg-config --cflags --libs gtkmm-2.4` * (Falls die Datei unter dem Namen "hello_world.cc" gespeichert wurde.) */ #include <iostream> #include <gtkmm/main.h> #include <gtkmm/button.h> #include <gtkmm/window.h> using namespace std; class HalloWelt : public Gtk::Window { public: HalloWelt(); virtual ~HalloWelt(); protected: Gtk::Button m_button; virtual void on_button_clicked(); }; HalloWelt::HalloWelt() : m_button("Hallo Welt!") { set_border_width(10); m_button.signal_clicked().connect(sigc::mem_fun(*this, &HalloWelt::on_button_clicked)); add(m_button); m_button.show(); } HalloWelt::~HalloWelt() {} void HalloWelt::on_button_clicked() { cout << "Hallo Welt!" << endl; } int main (int argc, char *argv[]) { Gtk::Main kit(argc, argv); HalloWelt HalloWelt; Gtk::Main::run(HalloWelt); return 0; }
[Bearbeiten] C++ mit Qt
#include <QLabel> #include <QApplication>
return app.exec();
}
[Bearbeiten] Cauldron
<?xml version="1.0" encoding="UTF-8"?> <c:cauldron xmlns:c="/de/alaun/cauldron/lang" xmlns:x=".">
</c:cauldron>
<c:component name="HelloComponent" extends="h:HtmlPage">
</c:component>
[Bearbeiten] Clarion
program
code
[Bearbeiten] Delphi
program HalloWelt; uses Dialogs; begin ShowMessage('Hallo Welt!'); end.
[Bearbeiten] EASY
in der Variante VDP:
[Bearbeiten] Gambas
PUBLIC SUB Form_Enter() PRINT "Hallo Welt" END
[Bearbeiten] J#
import System.Windows.Forms.MessageBox;
oder
public class HalloWelt
{
public static void main(String[] args)
{
Application.Run( new HalloWeltFenster() );
}
}
Button Button_HelloWorld = new Button();
Button_HelloWorld.set_Name("Button_HelloWorld");
Button_HelloWorld.set_Location(new Point(8, 8));
Button_HelloWorld.set_Size(new Size(128, 24));
Button_HelloWorld.set_Text("\"Hallo Welt!\"");
Button_HelloWorld.add_Click(new System.EventHandler(this.Button_HelloWorld_Click));
private void Button_HelloWorld_Click(Object sender, System.EventArgs e)
{
MessageBox.Show("Hallo Welt!");
}
}
[Bearbeiten] Java
- AWT:
import java.awt.Frame; import java.awt.Label; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; public class HalloWeltFenster extends Frame { public HalloWeltFenster() { super("Hallo Welt!"); Label halloWeltLabel = new Label("Hallo Welt!"); add(halloWeltLabel); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); setResizable(false); setLocation(350, 320); setSize(160, 60); setVisible(true); } public static void main(String[] args) { new HalloWeltFenster(); } }
import javax.swing.JFrame; import javax.swing.JLabel; public class HelloWorld extends JFrame { JLabel halloWeltLabel; public HelloWorld() { setTitle("Hallo Welt!"); setLocation(350, 320); setSize(160, 60); halloWeltLabel = new JLabel("Hallo Welt!"); getContentPane().add(halloWeltLabel); setDefaultCloseOperation(EXIT_ON_CLOSE); setResizable(false); setVisible(true); } public static void main(String[] args) { new HelloWorld(); } }
- SWT:
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell;
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
[Bearbeiten] LabVIEW
[Bearbeiten] Lingo
In das Message-Fenster:
put "Hallo Welt!"
In ein Dialogfenster:
alert "Hallo Welt!"
In ein gestaltbares Dialogfenster mittels MUI Xtra:
set alertObj = new(xtra "MUI")
if objectP(alertObj) then
case result of
1 : -- the user clicked OK
otherwise : -- the user hit ESC
end case
end startMovie
[Bearbeiten] LISP
(alert "Hallo Welt!")
[Bearbeiten] Lj4 (Ljapunow)
MsgBox("Hallo Welt?", MB_ICONINFORMATION BitOr MB_OK, "Meldung")
[Bearbeiten] Perl mit Tk
use Tk;
$label = $init_win -> Label(
-text => "Hallo Welt"
) -> pack(
-side => top
);
$button = $init_win -> Button(
-text => "Ok",
-command => sub {exit}
) -> pack(
-side => top
);
[Bearbeiten] Profan² / XProfan²
Messagebox("Hallo Welt","",0)
oder
oder
[Bearbeiten] PureBasic
MessageRequester("","Hallo Welt")
[Bearbeiten] Pure Data
- Patch als ASCII-art
[hello world( | [print]
[Bearbeiten] Spec#
using System; using System.Windows.Forms;
[Bearbeiten] SPL mit QT
load "qt"; var a = new qt.QApplication(); var l = new qt.QLabel(undef); l.setText("Hello World!"); function click_callback(e) { debug "Click: ${e.x()} / ${e.y()}"; return 1; } qt_event_callback(l, click_callback, qt.QEvent.MouseButtonPress()); a.setMainWidget(l); l.show(); a.exec();
[Bearbeiten] TclTk
label .label1 -text "Hallo Welt" pack .label1 oder kürzer (unter Ausnutzung, dass das Label-Kommando den Namen zurückgibt): pack [label .label1 -text "Hallo Welt"]
[Bearbeiten] REALBasic
MsgBox "Hello World!"
[Bearbeiten] Visual Basic
Public Sub Main() MsgBox "Hallo Welt!" End Sub
[Bearbeiten] Waba / SuperWaba
import waba.ui.*; import waba.fx.*; public class HelloWorld extends MainWindow { public void onPaint(Graphics g) { g.setColor(0, 0, 0); g.drawText("Hallo Welt!", 0, 0); } }
[Bearbeiten] Windows API (in C)
#include <windows.h>
Oder mit eigenem Fenster und Eventhandler
[Bearbeiten] Xbase++
function main() msgbox( "Hallo Welt", "Mein erstes Xbase++ Programm" ) return .T.
[Bearbeiten] Web-Technologien
[Bearbeiten] ASP (Active Server Pages)
<% Response.Write("Hallo Welt!") %>
oder verkürzt
[Bearbeiten] Coldfusion
<cfoutput>Hallo Welt!</cfoutput>
[Bearbeiten] cURL
{curl (Version)applet} Hallo Welt
[Bearbeiten] Java-Applet
Java-Applets funktionieren in Verbindung mit HTML.
Die Java-Datei:
Nachfolgend der Code zum Einbau in eine HTML-Seite.
Vom W3C empfohlen: <object classid="java:HalloWelt.class" codetype="application/java-vm" width="600" height="100"> </object>
Für Kompatibilität zu sehr alten Browsern (nicht empfohlen):
[Bearbeiten] JavaScript
JavaScript ist eine Skriptsprache, die insbesondere in HTML-Dateien verwendet wird. Der nachfolgende Code kann in HTML-Quelltext eingebaut werden:
Oder als direkte Ausgabe:
[Bearbeiten] JSP (Java Server Pages)
<% out.print("Hallo Welt!"); %>
oder verkürzt
[Bearbeiten] PHP
<?php echo 'Hallo Welt!'; // oder auch print 'Hallo Welt!'; ?>
oder verkürzt
oder
(Eigentlich ist der Befehl zum Abbruch des Scripts und nicht für eine reine Ausgabe bestimmt!)
<?php
die ('Hallo Welt!');
?>
Alternativ kann auch PHP beendet werden: <?php /* Hier Steht Programmcode */ ?> Hallo Welt! <?php /* Hier Steht Programmcode */ ?>
[Bearbeiten] VBScript
<script language="VBScript"> MsgBox "Hallo Welt!" </script>
[Bearbeiten] Visual Basic .NET
Module Main Sub Main() System.Console.WriteLine("Hallo Welt!") End Sub End Module
[Bearbeiten] XUL
<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <label value="Hallo Welt!"/> </window>
[Bearbeiten] XAML
<?Mapping ClrNamespace="System" Assembly="mscorlib" XmlNamespace="http://www.gotdotnet.com/team/dbox/mscorlib/System" ?> <Object xmlns="http://www.gotdotnet.com/team/dbox/mscorlib/System" xmlns:def="Definition" def:Class="MyApp.Hello"> <def:Code> <![CDATA[ Shared Sub Main() '{ System.Console.WriteLine("Hallo Welt!")' ; '} End Sub ]]> </def:Code> </Object>
[Bearbeiten] Exotische Programmiersprachen
(auch esoterisch genannt)
[Bearbeiten] 23
30,14,16,101,16,108,16,32,16,111,16,108,1,12,16,72,16,108,16,111,16,87,16,114,16,100,16,33
[Bearbeiten] Ale
\/>>>>>>\+\<<<\+!\>>\+\<<<<\-\<\-!\>>>\+\<<<\-!!+++!\/\-\/>>>>>\+\<<\+\<\+!---!\>>> \+\>\+\<<<\-\<<<\-!\>>>\-!\<<\+\<\+!\>\-\>\-!\>\-!\/\-/>>>>>\+\<<<<<\+!\/\-\/>>>\+\<<\+!
[Bearbeiten] BDAMD
Anmerkung: Dies gibt "HI" statt "Hallo Welt" aus.
[Bearbeiten] Beatnik
Anmerkung: Das folgende Programm gibt "Hi" statt "Hallo Welt" aus.
[Bearbeiten] Befunge
"!tleW ollaH">,:v ^ _@
[Bearbeiten] Borg
main: "Hallo Welt!\n">out :
[Bearbeiten] Brainfuck
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<< +++++++++++++++.>.+++.------.--------.>+.>. Eine Erklärung des Programmes findet sich unter Brainfuck#Beispielprogramme in Brainfuck.
[Bearbeiten] Brainfuck2D
Das Programm gibt "Hello World!" aus. * *0************** * * * * * * *9******************* * * *7*************** * * ** * * * * * * * * * * * * * * * * * **********0* * * * ********** * * * * * * * *44**************************** * * * * * * * * ***********0* * 0 * * * *3*** * * * * * 0 * * * 2 * * * * *7*********** * * * * * * * 0 * * * *4*********** * * * * * * * * * *0**** * * 0 * * * * * * *****************************BRAINFUCK****************************************** * * * * * ********************** * * * * *0*** * ** * * * * * * * * ********************* * * * * * * * * *8**************** * *26**** * * * * * * *0****** * * * * * * * * ** * * * * * * * * * * ** * *4******* * * * * * * * * * * * * * * * * * * * * * * *****0* ***************************** * * * * * * * * * * ******0* * * * * * *92*********** * *3****** * * * * * * * * * ** * * * * * * *0***** * * * * * * 0 * * * ********* * * *5**** * * * * * * 0 *3******** * * * * * * * ************************************************************** * * * * * *****8* * * * 0 * * * ** * * * ** * * ***6* * * * * * * * * ** *0********* * * * * * * * * * * * * * * * * * * ************************************** * * 0 * *91************* *2222***************************** * * * * * *0************************************** * * * * * ** * * * * * * * * * * * * * * * * * * * * * ***** * * *31******* * * * * * * * * *************** * * ***********************
[Bearbeiten] Chef
Hello World Souffle.
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.
[Bearbeiten] Choon
AGb-A#A#+A+%A#DF-AC#
[Bearbeiten] Condit
when a=0 then put "Hallo Welt!" set a=1
[Bearbeiten] Hello
h
[Bearbeiten] Homespring
Universe of bear hatchery says Hallo. Welt!. It powers the marshy things; the power of the snowmelt overrides...
[Bearbeiten] HQ9+
Zweck der Sprache ist vor allem das einfache Schreiben von Hallo-Welt-Programmen.
[Bearbeiten] INTERCAL
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
[Bearbeiten] Java2K
Da es sich bei Java2K um eine wahrscheinlichkeitstheoretische Sprache handelt, lässt sich auch nur ein "Wahrscheinlich Hello World" schreiben.
[Bearbeiten] Malbolge
(=<`:9876Z4321UT.-Q+*)M'&%$H"!~}|Bzy?=|{z]KwZY44Eq0/{mlk**hKs_dG5 [m_BA{?-Y;;Vb'rR5431M}/.zHGwEDCBA@98\6543W10/.R,+O<
[Bearbeiten] Microman
Microman ist eine unter Linux geschriebene, speziell für Windows-User entwickelte Skriptsprache.
[Bearbeiten] Mouse
"HALLO WELT.!" $$
[Bearbeiten] nouse
#0<a>0:0#0>e>0:0#0>f>0>0:0#0^f>0:0#0+4>0:0#0#h>0:0#0^f>0:0#0<g>0:0#0>f >0:0#0<e>0:0#0?4>0:0#0^1>0:0#0>1>0:0^0
[Bearbeiten] Ook!
Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.
[Bearbeiten] Oroogu
d / ("Hallo Welt!")
[Bearbeiten] Orthogonal
0 '!' 't' 'l' 'e' 'W' ' ' 'o' 'l' 'l' 'a' 'H' s 0 c 0 ret
[Bearbeiten] Pandora
Hallo Welt forget come from "Hallo" print "Hallo " return come from "Welt" print "Welt!" return
[Bearbeiten] Piet
Bei Piet ist der Quelltext eine Bilddatei im GIF-Format.
[Bearbeiten] reMorse
Beachten Sie, dass dies kein komplettes Hallo-Welt-Programm ist.