title |
---|
Languages Timeline w/ Hello, World! Programs |
The program prints Hello, World! on the terminal, including a newline (\n
) character.
C - Static, weak, manifest, nominal ++ Imperative (procedural), structured
/* Hello world in C */
#include <stdio.h>
main() {
printf("Hello, World!\n");
}
C++ - Static, nominative, partially inferred ++ Multi-paradigm: procedural, functional, object-oriented, generic
// Hello world in C++
#include <iostream.h>
main() {
cout << "Hello, World!" << endl;
}
Erlang - Dynamic, strong ++ Multi-paradigm: concurrent, functional, distributed, process-oriented
%% Hello world in Erlang
-module(hello).
-export([hello/0]).
hello() ->
io:format("Hello, World!~n", []).
Perl - Dynamic ++ Multi-paradigm: functional, imperative, object-oriented (class-based), reflective, procedural, event-driven, generic
# Hello world in perl
print "Hello, World!\n";
Python - Dynamic, strong, duck ++ Object-oriented, imperative, functional, procedural, reflective
# Hello world in Python
print("Hello, World!")
Lua - Dynamic, strong, duck ++ Multi-paradigm: scripting, imperative (procedural, prototype-based, object-oriented), functional
# Hello world in Lua
print "Hello, World!"
Ruby - Dynamic, strong, duck ++ Multi-paradigm: object-oriented, imperative, functional, reflective
# Hello World in Ruby
puts "Hello, World!"
PHP - Dynamic, weak ++ Imperative, functional, object-oriented, procedural, reflective
<?php
// Hello world in PHP
echo 'Hello, World!';
?>
Java - Static, strong, safe, nominative, manifest ++ Multi-paradigm: object-oriented (class-based), structured, imperative, generic, reflective, concurrent
// Hello world in Java
class HelloWorld {
static public void main( String args[] ) {
System.out.println( "Hello, World!" );
}
}
JavaScript - Dynamic, duck ++ Multi-paradigm: object-oriented (prototype-based), imperative, functional, event-driven
// Hello world in JavaScript
console.log("Hello, World!");
Go - Static, strong, inferred, structural ++ Compiled, concurrent, imperative, structured
// Hello world in Go
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
Rust - Static, strong, inferred, nominal, linear ++ Multi-paradigm: compiled, concurrent, functional, imperative, structured, generic
// Hello world in Rust
fn main() {
println!("Hello, World!");
}
Elixir (on Erlang) - Dynamic, strong ++ Multi-paradigm: functional, concurrent, distributed, process-oriented
# Hello world in Elixir
defmodule HelloWorld do
IO.puts "Hello, World!"
end
Crystal - Static ++ Multi-paradigm: object-oriented
# Hello world in Crystal
puts "Hello, World!"
Dynamic vs Static (Manifest vs Inferred) - Strong vs Weak - Implicit (Structural/Duck) vs Explicit Interface/Protocol Declarations
Lang | Typing Discipline |
---|---|
Ruby | Dynamic, strong, duck |
- vs - | |
Perl | Dynamic |
Python | Dynamic, strong, duck |
PHP | Dynamic, weak |
Lua | Dynamic, strong, duck |
JavaScript | Dynamic, duck |
Erlang | Dynamic, strong |
Elixir (on Erlang) | Dynamic, strong |
C | Static, weak, manifest, nominal |
C++ | Static, nominative, partially inferred |
Java | Static, strong, safe, nominative, manifest |
Go | Static, strong, inferred, structural |
Rust | Static, strong, inferred, nominal, linear |
Crystal | Static |
Lang | Object-Oriented | Functional | Reflective | Concurrent |
---|---|---|---|---|
Ruby | Yes | Yes (*) | Yes | X |
- vs - | ||||
Perl | Yes | Yes (*) | Yes | X |
Python | Yes | Yes (*) | Yes | X |
PHP | Yes | Yes (*) | Yes (*) | X |
Lua | Yes (*) | Yes (*) | Yes | X |
JavaScript | Yes (*) | Yes (*) | Yes | X |
Erlang | X | Yes | ? | Yes |
Elixir (on Erlang) | X | Yes | Yes | Yes |
C | X | X | X | X |
C++ | Yes | Yes (*) | X | Yes (*) |
Java | Yes | Yes (*) | Yes (*) | Yes (*) |
Go | X | Yes (*) | X | Yes |
Rust | X | Yes | X | Yes (*) |
Crystal | Yes | Yes (*) | X | Yes |