Zum Inhalt springen

„Hallo-Welt-Programm“ – Versionsunterschied

aus Wikipedia, der freien Enzyklopädie
[ungesichtete Version][gesichtete Version]
Inhalt gelöscht Inhalt hinzugefügt
K Vorlagenfehler korrigiert, Nachweise präzisiert
 
Zeile 1: Zeile 1:
[[Datei:Hello world c.svg|mini|hochkant=1.4|''Hello-world''-Quelltext in [[C (Programmiersprache)|C]] aus dem Handbuch ''Programming in C – A Tutorial'' von 1974.<ref name="tutorial">{{cite web|url=https://www.bell-labs.com/usr/dmr/www/ctut.pdf |author=Brian W. Kernighan|title=Programming in C – A Tutorial|publisher=[[Bell Laboratories]]|language=en |year=1974|format=PDF}}</ref>]]
'''Hallo Welt!''' oder auch '''"Hello, world!"''' (englisch),
[[Datei:PSP-Homebrew.jpeg|mini|''Hello world'' eines [[Homebrew]]-Programms auf [[PlayStation Portable]]]]
ist ein bekanntes Beispielprogramm, das am Anfang fast jedes Programmierkurses vorkommt.


Das fertige [[Computerprogramm]] gibt lediglich den Text "Hallo Welt!" (oder etwas ähnliches) auf dem [[Bildschirm]] aus. Dieses Programm soll dem angehenden [[Programmierer]] zeigen, was alles für ein vollständiges Programm (in der betreffenen [[Programmiersprache]]) benötigt wird, und einen ersten Einblick in die [[Syntax]] geben. Dies gelingt je nach verwendeter Sprache nur mäßig. Auf jeden Fall ist das Programm aber geeignet zu prüfen, ob die Installation einer Programmiersprache gelungen ist und man die grundsätzliche Verwendung (Aufruf, eventuell [[Kompilierung]]) verstanden hat.
Ein '''Hallo-Welt-Programm''' ist ein kleines [[Computerprogramm]], das auf möglichst einfache Weise zeigen soll, welche Anweisungen oder Bestandteile für ein vollständiges Programm in einer [[Programmiersprache]] benötigt werden, und somit einen ersten Einblick in die [[Syntax]] gibt. Aufgabe des Programms ist, den Text ''Hallo Welt!'' oder auf Englisch ''Hello World!'' auszugeben. Wegen der einfachen Aufgabenstellung eignen sich solche Programme insbesondere für didaktische Zwecke. Deshalb wird es in vielen Programmier-Lehrbüchern als Einsteigerprogramm verwendet.


== Geschichte ==
Der Ausruf "Hallo Welt" ist ein [[Anglizismus]], der in der Praxis oft durch einen anderen Text ersetzt wird, wobei meistens keine literarischen Höhenflüge entstehen.
Die Verwendung des Textes „Hello World!“ ist eine Tradition und geht auf ''Programming in C – A Tutorial''<ref name="tutorial" /> zurück, ein internes Programmierhandbuch der [[Bell Laboratories]] über die Programmiersprache [[C (Programmiersprache)|C]], das [[Brian W. Kernighan|Brian Kernighan]] 1974 verfasste, nachdem er dort schon ein Jahr zuvor die Wörter „hello“ und „world“ in einer Einführung in die Programmiersprache [[B (Programmiersprache)|B]] verwendet hatte.<ref>{{Literatur |Autor=Brian W. Kernighan |Titel=A Tutorial Introduction to the Language B|Sammelwerk=The Programming Language B |Sprache=en |Ort=Murray Hill, NJ |Datum=1973-01 |Reihe=Bell Laboratories Computing Science Technical Report |BandReihe=8 |Online=https://www.bell-labs.com/usr/dmr/www/bintro.html}}</ref> Bekanntheit erlangte der Text jedoch erst durch die 1978 erfolgte Veröffentlichung in dem Buch ''[[The C Programming Language]]'' ({{deS|''Programmieren in&nbsp;C''}}) von [[Brian W. Kernighan|Brian Kernighan]] und [[Dennis Ritchie]].<ref>{{Literatur |Autor=Brian W. Kernighan, Dennis M. Ritchie |Titel=The C Programming Language |Auflage=1 |Verlag=[[Prentice Hall]] |Ort=Englewood Cliffs, NJ |Datum=1978-02 |Sprache=en |ISBN=0-13-110163-3}}</ref>


Auch wenn in beiden Veröffentlichungen noch die Schreibweise ''hello, world'' (ohne Großbuchstaben und Ausrufezeichen) verwendet wurde, hat sich heute ''Hello World!'' durchgesetzt.
==Zeilenorientiert ([[Konsole]])==


== Siehe auch ==
=== [[Ada (Programmiersprache)|Ada]] ===
* [[Liste von Hallo-Welt-Programmen/Höhere Programmiersprachen]]

* [[Liste von Hallo-Welt-Programmen/Assembler]]
with Ada.Text_Io; use Ada.Text_Io;
* [[Liste von Hallo-Welt-Programmen/Sonstige]]
procedure Hallo is
begin
Put_Line ("Hallo Welt!");
end Hallo;

=== [[ALGOL]] ===

'BEGIN'
OUTSTRING(2,'('HALLO, WELT')');
'END'
=== [[Assemblersprache|Assembler]] ([[x86]] CPU, [[DOS (Betriebssystem)|DOS]], TASM syntax) ===

MODEL SMALL
IDEAL
STACK 100H
&nbsp;
DATASEG
HW DB 'Hallo Welt!$'
&nbsp;
&nbsp;
CODESEG
MOV AX, @data
MOV DS, AX
MOV DX, OFFSET HW
MOV AH, 09H
INT 21H
MOV AX, 4C00H
INT 21H
END

=== [[awk]] ===

BEGIN { print "Hallo Welt!" }

=== [[BASIC]] ===

Traditionelles, unstrukturiertes BASIC:
10 PRINT "Hallo Welt!"
20 END

Eher modernes, strukturiertes BASIC:
print "Hallo Welt!"

=== [[BCPL]] ===
GET "LIBHDR"
&nbsp;
LET START () BE
$(
WRITES ("Hallo Welt!*N")
$)

=== [[BeanShell]] ===
print("Hallo Welt!");

=== [[C (Programmiersprache)|C]] ===

#include <stdio.h>
&nbsp;
int main(void)
{
printf("Hallo Welt!\n");
return 0; <!-- Rückgabewert darf (im Unterschied zu C++) nicht fehlen!-->
}

=== [[C-Plusplus|C++]] ===

#include <iostream>
&nbsp;
int main()
{
std::cout << "Hallo Welt!" << std::endl;
<!-- Rückgabewert ist (im Unterschied zu C) implizit vorhanden, fehlt also nicht!-->
}

=== [[C-Sharp|C#]] ===

class HalloWeltApp {
public static void Main() {
System.Console.WriteLine("Hallo Welt!");
}
}

=== [[COBOL]] ===

IDENTIFICATION DIVISION.
PROGRAM-ID. HALLO-WELT.
&nbsp;
ENVIRONMENT DIVISION.
&nbsp;
DATA DIVISION.
&nbsp;
PROCEDURE DIVISION.
DISPLAY "Hallo Welt!".
STOP RUN.

=== [[LISP|Common LISP]] ===

(format t "Hallo Welt!~%")

=== [[Delphi (Programmiersprache)|Delphi]] ===

program HalloWelt;
{$APPTYPE CONSOLE}
&nbsp;
begin
writeln ('Hallo Welt!');
end.

=== [[EASY]] ===

module helloworld
procedure Main
cgiclosebuffer
cgiwriteln("content-type: text/html")
cgiwriteln("")
cgiwriteln("Hallo Welt!")
endproc

=== [[Eiffel (Programmiersprache)|Eiffel]] ===

class HALLO_WELT
&nbsp;
creation
make
feature
make is
do
io.put_string("Hallo Welt!%N")
end -- make
end -- class HALLO_WELT

=== [[Erlang (Programmiersprache)|Erlang]] ===

-module(Hallo).
-export([Hallo_Welt/0]).
&nbsp;
Hallo_Welt() -> io:fwrite("Hallo Welt!\n").

=== [[Forth (Programmiersprache)|Forth]] ===

." Hallo Welt!" CR

=== [[Fortran]] ===

PROGRAM HALLO
WRITE(*,10)
10 FORMAT('Hallo Welt!')
STOP
END

=== [[Haskell]] ===

main = putStrLn "Hallo Welt!"

=== [[Io (Programmiersprache)|Io]] ===
"Hallo Welt" print

=== [[Iptscrae]] ===

ON ENTER {
"Hallo " "Welt!" & SAY
}

=== [[Java (Programmiersprache)|Java]] ===

public class Hallo {
public static void main(String[] args) {
System.out.println("Hallo Welt!");
}
}

=== [[Lua]] ===

print "Hallo Welt!"


=== [[Logo]] ===

print word "Hallo Welt!"


=== [[MIXAL programming language|MIXAL]] ===

TERM EQU 19 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

=== [[MS-DOS]] batch ===

@echo Hallo Welt!

=== [[Ocaml programming language|OCaml]] ===
let main () =
print_endline "Hallo Welt!";;

=== [[OPL]] ===
PROC Hallo:
PRINT "Hallo Welt"
ENDP

=== [[Pascal (Programmiersprache)|Pascal]] ===
program Hallo;
begin
writeln('Hallo Welt!');
end.

=== [[Perl]] ===

print "Hallo Welt!\n";

=== [[PHP]] ===

<?php
echo 'Hallo Welt!';
?>

=== [[Pike (Programmiersprache)|Pike]] ===
#!/usr/local/bin/pike
int main() {
write("Hallo Welt!\n");
return 0;
}

=== [[PL/1]] ===

Test: procedure options(main);
declare My_String char(20) varying initialize('Hallo Welt!');
put skip list(My_String);
end Test;

=== [[PL/SQL]] ===
BEGIN
DBMS_OUTPUT.PUT_LINE('Hallo Welt!');
END;

=== [[Prolog (Programmiersprache)|Prolog]] ===

?- write("Hallo Welt!"), nl.

=== [[PureBasic (Programmiersprache)|PureBasic]] ===

OpenConsole()
Print("Hallo Welt!")
CloseConsole()

=== [[Python (Programmiersprache)|Python]] ===

print "Hallo Welt!"

=== [[REXX]] ===

say "Hallo Welt!"

=== [[RPL]] ===

<< "Hallo Welt!" 1 Disp>>

=== [[Ruby]] ===

puts "Hallo Welt!"

=== [[Scheme]] ===

(display "Hallo Welt!")
(newline)

=== [[sed]] ===
Benötigt mindestens eine Zeile als Eingabe:

sed -ne '1s/.*/Hallo Welt!/p'

=== [[Smalltalk (Programmiersprache)|Smalltalk]] ===

Transcript show: 'Hallo Welt!'

=== [[SML]] ===

print "Hallo Welt!\n";

=== [[SNOBOL]] ===

OUTPUT = "Hallo Welt!"
END

=== [[STARLET]] ===

RACINE: HELLO_WORLD.
&nbsp;
NOTIONS:
HELLO_WORLD : ecrire("Hallo Welt!").

=== [[SQL]] ===

select 'Hallo Welt!' as message;

Für [[Oracle]]-[[Datenbanken]]

select 'Hallo Welt!' from dual;

=== [[StarOffice Basic]] ===

sub main
print "Hallo Welt!"
end sub

=== [[Tcl]] ===

puts "Hallo Welt!"

=== [[TI-BASIC]] ===

:Disp "Hallo Welt!"

=== [[Turing programming language|Turing]] ===

put "Hallo Welt!"

=== [[Unix-Shell]] ===

echo 'Hallo Welt!'

=== [[VB.net|VB.NET]] ===

Imports System
&nbsp;
Module Main
Sub Main()
Console.WriteLine("Hallo Welt!")
End Sub
End Module

==Grafische Benutzeroberflächen – als traditionelle Anwendungen==

=== [[Applescript]] ===
display dialog "Hallo Welt!"

=== [[C-Plusplus|C++]]-Bindungen für [[GTK]] ===

#include <iostream>
#include <gtkmm/main.h>
#include <gtkmm/button.h>
#include <gtkmm/window.h>
using namespace std;
&nbsp;
class HalloWelt : public Gtk::Window {
public:
HalloWelt();
virtual ~HalloWelt();
protected:
Gtk::Button m_button;
virtual void on_button_clicked();
};
&nbsp;
HalloWelt::HalloWelt()
: m_button("Hallo Welt!") {
set_border_width(10);
m_button.signal_clicked().connect(SigC::slot(*this,
&HalloWelt::on_button_clicked));
add(m_button);
m_button.show();
}
&nbsp;
HalloWelt::~HalloWelt() {}
&nbsp;
void HalloWelt::on_button_clicked() {
cout << "Hallo Welt!" << endl;
}
&nbsp;
&nbsp;
int main (int argc, char *argv[]) {
Gtk::Main kit(argc, argv);
HalloWelt HalloWelt;
Gtk::Main::run(HalloWelt);
return 0;
}
=== [[Delphi (Programmiersprache)|Delphi]] ===
program HalloWelt;
&nbsp;
uses Dialogs;
&nbsp;
begin
ShowMessage('Hallo Welt!');
end.

=== [[Delphi (Programmiersprache)|Delphi]] ===
ShowMessage('Hallo Welt!');

=== [[Gambas (Computer)|Gambas]] ===
PUBLIC SUB Form_Enter()
PRINT "Hallo Welt"
END

=== [[Java (Programmiersprache)|Java]] ===
*[[AWT]]:
import java.awt.Frame;
import java.awt.Label;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
&nbsp;
public class HalloWeltFenster extends Frame{
&nbsp;
public HalloWeltFenster(){
Label halloWeltLabel = new Label("Hallo Welt!");
this.add(halloWeltLabel);
&nbsp;
addWindowListener( new WindowAdapter() {
public void windowClosing(WindowEvent e){
System.exit(0);
}
}
);
&nbsp;
setTitle("Hallo Welt!");
setResizable(false);
setLocation(350,320);
setSize(160,60);
setVisible(true);
}
&nbsp;
public static void main(String[] args){
new HalloWeltFenster();
}
}
*[[Swing (Java)|Swing]]:
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JLabel;
&nbsp;
public class HelloWorld
extends JFrame {
&nbsp;
public HelloWorld() {
JLabel halloWeltLabel = new JLabel("Hallo Welt!");
this.getContentPane().add(halloWeltLabel);
&nbsp;
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
}
);
&nbsp;
this.setTitle("Hallo Welt!");
this.setResizable(false);
this.setLocation(350, 320);
this.setSize(160, 60);
this.setVisible(true);
}
&nbsp;
public static void main(String[] args) {
HelloWorld helloWorld1 = new HelloWorld();
}
}

=== [[LISP]] ===
(alert "Hallo Welt!")

=== [[PureBasic (Programmiersprache)|PureBasic]] ===
MessageRequester("","Hallo Welt")

=== [[Tk|TclTk]] ===
label .label1 -text "Hallo Welt"
pack .label1

=== [[VB.net|VB.NET]] ===
MessageBox.Show("Hallo Welt!")

=== [[Visual Basic]] ===
MsgBox "Hallo Welt!"

=== [[Waba / SuperWaba]] ===
import waba.ui.*;
import waba.fx.*;
&nbsp;
public class HelloWorld extends MainWindow
{
&nbsp;
public void onPaint(Graphics g)
{
g.setColor(0, 0, 0);
g.drawText("Hallo Welt!", 0, 0);
}
}

=== [[Windows API]] (in C) ===
#include <windows.h>
&nbsp;
LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM);
&nbsp;
char szClassName[] = "MainWnd";
HINSTANCE hInstance;
&nbsp;
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
HWND hwnd;
MSG msg;
WNDCLASSEX wincl;
&nbsp;
hInstance = hInst;
&nbsp;
wincl.cbSize = sizeof(WNDCLASSEX);
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.style = 0;
wincl.hInstance = hInstance;
wincl.lpszClassName = szClassName;
wincl.lpszMenuName = NULL; //No menu
wincl.lpfnWndProc = WindowProcedure;
wincl.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); //Color of the window
wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION); //EXE icon
wincl.hIconSm = LoadIcon(NULL, IDI_APPLICATION); //Small program icon
wincl.hCursor = LoadCursor(NULL, IDC_ARROW); //Cursor
&nbsp;
if (!RegisterClassEx(&wincl))
return 0;
&nbsp;
hwnd = CreateWindowEx(0, //No extended window styles
szClassName, //Class name
"", //Window caption
WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX,
CW_USEDEFAULT, CW_USEDEFAULT, //Let Windows decide the left and top positions of the window
120, 50, //Width and height of the window,
NULL, NULL, hInstance, NULL);
&nbsp;
//Make the window visible on the screen
ShowWindow(hwnd, nCmdShow);
&nbsp;
//Run the message loop
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
&nbsp;
LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hdc;
switch (message)
{
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
TextOut(hdc, 15, 3, "Hallo Welt!", 13);
EndPaint(hwnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, message, wParam, lParam);
}
return 0;
}

== Grafische Benutzeroberflächen – [[Webbrowser]]-basiert==

=== [[Java-Applet]] ===

Java-Applets funktionieren in Verbindung mit [[HTML]].

Die HTML-Seite:

<HTML>
<HEAD>
<TITLE>Hallo Welt</TITLE>
</HEAD>
<BODY>
&nbsp;
<APPLET CODE="HalloWelt.class" WIDTH=600 HEIGHT=100>
</APPLET>
&nbsp;
</BODY>
</HTML>

Die Java-Datei:

import java.applet.*;
import java.awt.*;
&nbsp;
public class HalloWelt extends Applet {
public void paint(Graphics g) {
g.drawString("Hallo Welt!", 100, 50);
}
}

=== [[JavaScript]], alias ECMAScript ===

JavaScript ist ein Skriptsprache, die insbesondere in [[HTML]]-Dateien verwendet wird. Der nachfolgende Kode kann in HTML-Quelltext eingebaut werden:

<script type="text/javascript">
function HalloWelt()
{
window.alert("Hallo Welt!");
}
</script>
&nbsp;
<a href="#"
onclick="HalloWelt();">Hallo Welt Example</a>

Eine einfachere Methode verwendet JavaScript implizit, durch Aufruf der reservierten ''alert''-Funktion. Schneiden Sie die folgende Zeile aus und fügen Sie sie innerhalb der [[HTML]]-Tags <code>&lt;body&gt;</code> und <code>&lt;/body&gt;</code> ein:

<a href="#" onclick="window.alert('Hallo Welt!');">Hallo-Welt-Beispiel</a>

Eine noch einfachere Methode verwendet die Unterstützung vieler Browser für das "javascript"-Protokoll, um JavaScript auszuführen. Geben Sie Folgendes als Internet-Adresse ein (normalerweise durch Einfügen in den Adresseintrag):

javascript:alert('Hallo Welt!')

=== [[XUL]] ===

<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<box align="center">
<label value="Hallo Welt!" />
</box>
</window>

=== [[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>

==[[Exotik|Exotische]] Programmiersprachen (auch [[esoterische_Programmiersprache|esoterisch]] genannt)==


=== [[23 (Programmiersprache)|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

=== [[4DL (Programmiersprache)|4DL]] ===

''Siehe [http://www.cliff.biffle.org/esoterica/4dl-hello.gif] für ein Hallo-Welt-Programm in 4DL.''

=== [[Ale (Programmiersprache)|Ale]] ===

\/>>>>>>\+\<<<\+!\>>\+\<<<<\-\<\-!\>>>\+\<<<\-!!+++!\/\-\/>>>>>\+\<<\+\<\+!---!\>>>
\+\>\+\<<<\-\<<<\-!\>>>\-!\<<\+\<\+!\>\-\>\-!\>\-!\/\-/>>>>>\+\<<<<<\+!\/\-\/>>>\+\<<\+!

=== [[BDAMD]] ===

Anmerkung: Dies gibt "HI" statt "Hallo Welt" aus.

84 > 84 > 84 > 84 > 84 > 84 > 84 > 85
\/
85 < 86 < 86 < 86 < 86 < 86 < 0E < 66
\/ /\
84 > 84 > 0C > 8C > E5 > 0F 84 > 85
\/ /\ \/
85 < 86 < 86 < 3E < 0E 84 > 83 < 86
\/ /\ \/
84 > 84 > 84 > 84 > 84 > 0F 84 > 85
\/
00 < 00 < 00 < B6 < 0E < B6 < 0E < 86

=== [[Befunge]] ===

"!dlrow olleH">v
&nbsp;
,
^_@

=== [[Borg (Programmiersprache)|Borg]] ===

main: "Hallo Welt!\n">out :

=== [[Brainfuck]] ===

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<
+++++++++++++++.>.+++.------.--------.>+.>.

=== [[Choon (Programmiersprache)|Choon]] ===

AGb-A#A#+A+%A#DF-AC#

=== [[Condit (Programmiersprache)|Condit]] ===

when a=0 then put "Hallo Welt!" set a=1

=== [[Homespring (Programmiersprache)|Homespring]] ===

Universe of bear hatchery says Hallo. Welt!.
It powers the marshy things;
the power of the snowmelt overrides.

=== [[HQ9 Plus|HQ9+]] ===

H

=== [[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
&nbsp;
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

=== [[Malbolge (Programmiersprache)|Malbolge]] ===

(=<`:9876Z4321UT.-Q+*)M'&%$H"!~}|Bzy?=|{z]KwZY44Eq0/{mlk**hKs_dG5
[m_BA{?-Y;;Vb'rR5431M}/.zHGwEDCBA@98\6543W10/.R,+O<

=== [[Mouse (Programmiersprache)|Mouse]] ===

"WIlli

$$

=== [[nouse (Programmiersprache)|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

=== [[Ook#]] ===

Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.

=== [[Oroogu (Programmiersprache)|Oroogu]] ===

d / ("Hallo Welt!")

=== [[Orthogonal (Programmiersprache)|Orthogonal]] ===

0 'd' 'l' 'r' 'o' 'w' ' ' ',' 'o' 'l' 'l' 'e' 'h' s 0 c 0 ret

=== [[Pandora (Programmiersprache)|Pandora]] ===

Hallo Welt
&nbsp;
forget
&nbsp;
come from "Hallo" print "Hallo " return
&nbsp;
come from "Welt" print "Welt!" return

=== [[Piet (Programmiersprache)|Piet]] ===

''Please see [http://www.dangermouse.net/esoteric/Piet_hello_big.png] for a Hallo Welt program in Piet.''

=== [[ReMorse (Programmiersprache)|reMorse]] ===

Beachten Sie, dass dies kein komplettes Hallo-Welt-Programm ist.

- - - ..- ...-.---.;newline
- - - .-. - ..-.- ...-. ---.;!
- - - ...- . . -.---.;d
----. . . -.---.;l
----. . -...---.;r
----. -...---.;o
----...-.- ..-. ---.;W
<!--
<i didn't feel like doing this part>
-..............;output all characters

(macht den Text kaputt (tb)

-->

=== [[RUBE (Programmiersprache)|RUBE]] ===

0a21646c726f77202c6f6c6c6548
, :::::::::::::::::::::::::::: ,
)
==============================
F
O F
c
=

=== [[Sally (Programmiersprache)|Sally]] ===

sidefxio
void main
print 'H
print 'e
print 'l
print 'l
print 'o
print ',
&nbsp;
print as char 32
print 'w
print 'o
print 'r
print 'l
print 'd
print '!

=== [[Sansism (Programmiersprache)|Sansism]] ===

G GGG
>++++++++++>!+++++++!++++++++++!+++!+##!!!!##-G+G
G.+++++++++++++++##!!##.++!.+++..+++++++.+!.++! G
G!.+++.------.--------.!+.!.G GG

=== [[Shelta (Programmiersprache)|Shelta]] ===

[ `Hallo, _32 `Welt! _13 _10 ] \15 outs \0 halt

=== [[SMITH (Programmiersprache)|SMITH]] ===


; Hallo Welt in SMITH - version 2 (loop)
; R0 -> index into string (starts at R10)
; R2 -> -1
MOV R0, 10
MOV R2, 0
SUB R2, 1
MOV R[R0], "Hallo Welt!"
MOV TTY, R[R0]
SUB R0, R2
MOV R1, R0
SUB R1, 23
NOT R1
NOT R1
MUL R1, 8
COR +1, -7, R1

=== [[Toadskin (Programmiersprache)|Toadskin]] ===

:V+++++;:XVV;:v-----;:xvv;XXXXXXX++.<XXXXXXXXXX+.V
++..+++.<XXX++.>>XV.XX++++.+++.v-.x++.<XXX+++.<X.>

=== [[Unlambda (Programmiersprache)|Unlambda]] ===

`
``si`k``s.H``s.e``s.l``s.l``s.o``s.
``s.w``s.o``s.r``s.l``s.d``s.!``sri
``si``si``si``si``si``si``si``si`ki

=== [[Var'aq (Programmiersprache)|var'aq]] ===

Anmerkung: Gibt "Was möchtest du, Universum?" auf [[Klingonisch]] aus.

~ nuqneH { ~ 'u' ~ nuqneH disp disp } name
nuqneH

=== [[Star W (Programmiersprache)|*W]] ===

Functions:
|| No functions for this program !!
Stuff:
1/Hallo is chrs!
1/Sz, 1/Total are all cplx!
Text:
|| Initialize the data !!
Hallo < "Hallo Welt!"!
Size Hallo > Sz!
Total < 0!
|| Take the string length and multiply by 100 !!
- Size - 0 Total > Total %10000!
|| Print and delete a character that many times !!
& WELT < FCHRS (Hallo)!
& Hallo < - Hallo FCHRS (Hallo)!
&& %Total!
|| Add a newline !!
WELT < nl!
:Endtext

=== [[Whenever (Programmiersprache)|Whenever]] ===

1 print("Hallo Welt!");

=== [[Whitespace (Programmiersprache)|Whitespace]] ===

''In [ http://compsoc.dur.ac.uk/whitespace/hworld.ws [1]] finden sie ein "Hallo Welt" Programm in Whitespace.''

=== [[XS (Programmiersprache)|XS]] ===

<print>Hallo Welt</print>

=== [[ZT (Zer0 Tolerance)]] ===
<pre>
48<>>>>>ZT<>ZT<> Hello |
<>ZT>>ZT<>ZT<>ZT World!|
<<<<65<>6F<>6F<>6C<>>>>>
>>>2<>ZT<>ZT<>ZT<>ZT<<<8
ZT<<<<<<6C<>20<>72<>64<<
><ZT<<<<<>ZT<>ZT<>ZT><<5
>>>>ZT><<<<<6C<>57<>ZT<<
>>ZT><ZT><<<<<ZT<<ZT><<7
ZT<<21<>ZT><ZT>>ZT<<<<<|
><ZT<>ZT><42<<<<<>ZT by|
>>>>ZT><21<>>>> Philipp|
>>>>><ZT<<ZT Winterberg|
-------EXIT--[ ZT ]----|
-[www.winterbergs.de]-/
</pre>

== Textauszeichnungssprachen ==
Die folgenden Sprachen sind keine Programmiersprachen, sondern [[Textauszeichnungssprachen]], also Sprachen, mit denen man einen im Computer gespeicherten Text für die Ausgabe auf dem Bildschirm oder mit dem Drucker formatieren kann. (Allerdings kann man PostScript und TeX durchaus auch als vollwertige Programmiersprachen ansehen.) Analog zum "Hallo Welt!"-Programm ist ein "Hallo Welt!"-Dokument in einer dieser Sprachen ein Beispieldokument, das nur den Text "Hallo Welt" enhält.

=== [[ASCII]] ===

Hallo Welt!
oder in [[Hexadezimalsystem|hexadezimaler]] Schreibweise:
48 61 6C 6C 6F 2C 20 57 65 6C 74 21

oder in [[Binär|binärer]] Schreibweise:
01001000 01100001 01101100 01101100 01101111 00100000 01010111 01100101 01101100 01110100 00100001

=== [[HTML]] ===
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Hallo Welt!&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p>Hallo Welt!&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;

=== [[PostScript]] ===

/Courier findfont
24 scalefont
setfont
100 100 moveto
(Hallo Welt!) show
showpage

=== [[Rich Text Format|RTF]] ===

{\rtf1\ansi\deff0
{\fonttbl {\f0 Courier New;}}
\f0\fs20 Hallo Welt!
}

=== [[TeX]] ===

\font\HW=cmr10 scaled 3000
\leftline{\HW Hallo Welt}
\bye


== Weblinks ==
== Weblinks ==
{{Commonscat|Hello World}}
* [http://www.wikiservice.at/dse/wiki.cgi?HelloWorld Eine weitere Liste von "Hallo Welt!" Programmen]
* [http://helloworldcollection.de/ Hello-World-Sammlung] mit über 500 Programmiersprachen und über 70 natürlichen Sprachen.


== Einzelnachweise ==
<references/>


{{SORTIERUNG:Halloweltprogramm}}
[[Kategorie:Programmierung]]
[[Kategorie:Programmiersprachklasse]]
[[cs:Hello world]]
[[en:Hello world program]]
[[fr:Hello world]]
[[ia:Hello World]]
[[id:Hello world]]
[[ja:Hello world]]
[[no:Hello World]]
[[nl:Hello world]]
[[pl:Hello world]]
[[sv:Hello,_World!]]
[[vi:Chào thế giới!]]
[[zh:Hello World程序]]

Aktuelle Version vom 20. Dezember 2024, 22:17 Uhr

Hello-world-Quelltext in C aus dem Handbuch Programming in C – A Tutorial von 1974.[1]
Hello world eines Homebrew-Programms auf PlayStation Portable

Ein Hallo-Welt-Programm ist ein kleines Computerprogramm, das auf möglichst einfache Weise zeigen soll, welche Anweisungen oder Bestandteile für ein vollständiges Programm in einer Programmiersprache benötigt werden, und somit einen ersten Einblick in die Syntax gibt. Aufgabe des Programms ist, den Text Hallo Welt! oder auf Englisch Hello World! auszugeben. Wegen der einfachen Aufgabenstellung eignen sich solche Programme insbesondere für didaktische Zwecke. Deshalb wird es in vielen Programmier-Lehrbüchern als Einsteigerprogramm verwendet.

Die Verwendung des Textes „Hello World!“ ist eine Tradition und geht auf Programming in C – A Tutorial[1] zurück, ein internes Programmierhandbuch der Bell Laboratories über die Programmiersprache C, das Brian Kernighan 1974 verfasste, nachdem er dort schon ein Jahr zuvor die Wörter „hello“ und „world“ in einer Einführung in die Programmiersprache B verwendet hatte.[2] Bekanntheit erlangte der Text jedoch erst durch die 1978 erfolgte Veröffentlichung in dem Buch The C Programming Language (deutsch Programmieren in C) von Brian Kernighan und Dennis Ritchie.[3]

Auch wenn in beiden Veröffentlichungen noch die Schreibweise hello, world (ohne Großbuchstaben und Ausrufezeichen) verwendet wurde, hat sich heute Hello World! durchgesetzt.

Commons: Hello World – Sammlung von Bildern, Videos und Audiodateien

Einzelnachweise

[Bearbeiten | Quelltext bearbeiten]
  1. a b Brian W. Kernighan: Programming in C – A Tutorial. (PDF) Bell Laboratories, 1974; (englisch).
  2. Brian W. Kernighan: A Tutorial Introduction to the Language B. In: The Programming Language B (= Bell Laboratories Computing Science Technical Report. Band 8). Murray Hill, NJ Januar 1973 (englisch, bell-labs.com).
  3. Brian W. Kernighan, Dennis M. Ritchie: The C Programming Language. 1. Auflage. Prentice Hall, Englewood Cliffs, NJ 1978, ISBN 0-13-110163-3 (englisch).