본문 바로가기
컴퓨터/프로그래밍

Hello, World!

by All That Guy 2015. 4. 29.

Knowing how to write Hello, World! in a programming language is the first step to learn  how to code. Some of Hello World! codes in languages I know of a bit (no syntax hightlight):

;;; bash

echo Hello, World!

;;; C, Kernighan and Ritchie, The C Programming Language, 2nd edition:

#include <stdio.h>
int main()
{
printf(“Hello, World!\n”);
}

;;; D programming language:

import std.stdio;
void main()
{
writeln(“Hello, world!”);
}

;;; Fortran 90 <:

program hello
write(*,*) ‘Hello, World!’
end program hello

or

program hello
print *, ‘Hello, World!’
end program hello

;;; Haskell:

main = putStrLn “Hello, World!”

;;; JavaScript:

document.write(‘Hello, World!’);

;;; Julia:

println(“Hello, World!”)

;;; Emacs Lisp or ELips:

(message “Hello, World!”)

;;; Racket:

#lang racket
(display “Hello, World!”)

;;; Scheme

(display “Hello, World!”)

;;; OCaml:

print_endline “Hello, World!”

;;; Python2:

print “Hello, World!”

;;; Python3:

print(“Hello, World!”)

;;; Rust:

fn main() {
println!(“Hello, World!”)l
}

;;; Sed:

s/.*/Hello, World!/
q

;;; Tcl:

puts “Hello, World!”