This is the first post on my site. What better way to start than the program everyone writes first? Here is β€œHello, World” across a spread of languages ~ old and new, practical and absurd.

C

#include <stdio.h>

int main(void) {
    printf("Hello, World\n");
    return 0;
}

C++

#include <iostream>

int main() {
    std::cout << "Hello, World" << std::endl;
}

Rust

fn main() {
    println!("Hello, World");
}

Go

package main

import "fmt"

func main() {
    fmt.Println("Hello, World")
}

Python

print("Hello, World")

JavaScript

console.log("Hello, World");

TypeScript

const greeting: string = "Hello, World";
console.log(greeting);

Java

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, World");
    }
}

C#

using System;

class Program {
    static void Main() {
        Console.WriteLine("Hello, World");
    }
}

Ruby

puts "Hello, World"

Swift

print("Hello, World")

Kotlin

fun main() {
    println("Hello, World")
}

PHP

<?php
echo "Hello, World\n";

Shell (Bash)

echo "Hello, World"

Lua

print("Hello, World")

Haskell

main :: IO ()
main = putStrLn "Hello, World"

Lisp (Common Lisp)

(format t "Hello, World~%")

Assembly (x86-64, Linux)

section .data
    msg db "Hello, World", 10
    len equ $ - msg

section .text
    global _start

_start:
    mov rax, 1          ; sys_write
    mov rdi, 1          ; stdout
    mov rsi, msg
    mov rdx, len
    syscall

    mov rax, 60         ; sys_exit
    xor rdi, rdi
    syscall

BASIC

10 PRINT "Hello, World"
20 END

Borland C++ 3.1

A contribution from the archives ~ Hello, World running in the classic Borland C++ 3.1 IDE.

Hello World from Borland C++ 3.1, shown in the classic blue Borland DOS IDE

Contributed by SPK.

That’s enough to say hello. More posts ~ in slightly fewer languages ~ to follow.