A "Hello, World!" program generally is a computer program that outputs or displays the message "Hello, World!". Such a program is very simple in most programming languages, and is often used to illustrate the basic syntax of a programming language. It is often the first program written by people learning to code. [1]
with Text_IO; use Text_IO;
procedure hello is
begin
Put_Line("Hello world!");
end hello;
$ gnatmake hello-world.adb
$ ./hello-world
#include <stdio.h>
int main(void)
{
printf("Hello world!\n");
return 0;
}
$ make hello-world
$ ./hello-world
using System;
class Pogram
{
static void Main(string[] argv)
{
Console.WriteLine("Hello world!");
}
}
$ csc hello-world.cs
$ mono hello-world.exe
#include <iostream>
int main(void)
{
std::cout << "Hello world\n";
return 0;
}
$ g++ -o hello-world hello-world.cpp
$ ./hello-world
void main()
{
print("Hello world!");
}
$ dart hello-world.dart
open System
[<EntryPoint>]
let main argv =
printfn "Hello world!"
0
$ fsharpc hello-world.fs
$ mono hello-world.exe
package main
import "fmt"
func main()
{
fmt.Println("Hello world!")
}
$ go run hello-world.go
main :: IO ()
main = do
putStrLn "Hello world!"
return ()
$ ghc hello-world.hs
./hello-world
public class Main
{
public static void main(String[] args)
{
System.out.println("Hello world!");
}
}
$ javac hello-world.java
$ java hello-world
console.log("Hello world!");
$ node hello-world.js
fun main()
{
println("Hello world!")
}
$ kotlinc hello-world.kt -include-runtime -d hello-world.jar
$ java -jar hello-world.jar
#import <Foundation/Foundation.h>
int main(void)
{
NSLog(@"Hello world!");
return 0;
}
$ clang -framework Foundation hello-world.m -o hello-world
$ ./hello-world
#!usr/bin/perl
use warnings;
print("Hello world!\n");
$ perl hello-world.pl
print('Hello world!')
$ python3 hello-world.py
print("Hello world!", quote=False)
$ chmod +x hello-world.r
./hello-world.r
puts "Hello world!"
$ ruby hello-world.rb
fn main()
{
println!("Hello world!");
}
$ rustc hello-world.rs
$ ./hello-world
object Main {
def main(args: Array[String]): Unit = {
println("Hello world!")
}
}
scala hello-world.scala
echo "Hello world!"
$ sh hello-world.sh
print("Hello world!")
$ swift hello-world.swift
Imports System
Module HelloWorld
Sub Main()
Console.WriteLine("Hello world!")
End Sub
End Module
$ vbc hello-world.vb
$ mono hello-world.exe
global start
section .text
start:
mov rax, 0x02000004
mov rdi, 1
mov rsi, message
mov rdx, 13
syscall
mov rax, 0x02000001
xor rdi, rdi
syscall
section .data
message:
db "Hello world!", 10
$ ./hello-world