Hello, World!

November 18, 2024 (1mo ago)

Let's give 👋 to world in some programming languages!

  1. JavaScript

    console.log("Hello, World!");
  2. C++

    #include <iostream>
    int main()
    {
      std::cout << "Hello, World!" << std::endl;
      return 0;
    }
  3. Python

    print("Hello, World!")
  4. Java

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

    #include <stdio.h>
     
    int main() {
    printf("Hello, World!");
    return 0;
    }
     
  6. Assembly

    section .data
        hello db 'Hello, World!', 0  ; String will be showed
     
    section .text
        global _start                  ; Start point program
     
    _start:
        mov rax, 1                     ; syscall: write
        mov rdi, 1                     ; file descriptor: stdout
        mov rsi, hello                 ; string address
        mov rdx, 13                    ; string length
        syscall                         ; call kernel
     
        mov rax, 60                    ; syscall: exit
        xor rdi, rdi                   ; exit code: 0
        syscall                         ; call kernel
     
  7. Brainfuck

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

    I wish this will return 'Hello, World!'.

  8. Haskell

    main :: IO ()
    main = putStrLn "Hello, World!"
  9. Prolog

    :- initialization(main).
     
    main :- write('Hello, World!'), nl.
  10. Rust

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