>_ Das ist der erste Artikel aus dem CompareBuch.

Das CompareBuch ist kein Programmierhandbuch im herkömmlichen, klassischen Sinn.
Vielmehr stellt es die Syntax verschiedener Sprachen kurz vor und dann gegenüber.

Es soll Entwicklern helfen, die von einer auf die andere Sprachen wechseln müssen, bzw. eine neue Sprache erlernen wollen.

Wir beginnen trotzdem klassisch 😉 mit dem allseits bekannten „Hello world!“ Programm.

print("Hello world!")

 

void main() {
  print('Hello, World!');
}

 

 

package main

import "fmt"

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

 

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

 

 

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

 

#include <stdio.h>

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

 

 

#include <iostream>

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

 

program HelloWorld;

begin
  writeln('Hello, World!');
end.

 

<?php
    echo "Hello, World!";
?>

 

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
PROCEDURE DIVISION.
    DISPLAY "Hello, World!".
    STOP RUN.

 

section .data
    msg db "Hello, World!", 0xA
    len equ $ - msg

section .text
    global _start

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

    mov rax, 60
    xor rdi, rdi
    syscall

 

 

#!/bin/bash
echo "Hello, World!"

 

CompareBuch

Inhaltsverzeichnis