Concepts of Programming Languages

Overview

Sebastian Macke

Rosenheim Technical University

Categorization of programming languages

Programming languages can be categorized in many ways

2

Evolution of Programming Languages

3

Fortran I looks familiar

4

But not all used equal

5

Programming language Paradigms

6

Imperative vs Declarative I

<html>
    <body>
        <script>
            let btn = document.createElement("button");
            btn.innerHTML = "Click Me";
            document.body.appendChild(btn);
        </script>
    </body>
</html>
<html>
    <body>
        <button>Click Me</button>
    </body>
</html>
7

Degress of Declarative Code

List<Integer> integers = Arrays.asList(1, 2, 3, 4, 5);
int sum = 0;
for(int i = 0; i < integers.size(); i++) {
    sum += integers.get(i);
}
sum = 0;
integers.forEach(n -> {sum += n;});

sum = integers.stream().mapToInt(Integer::intValue).sum();
int sum = math.sum(integers);
8

Declarative

Sum the array of integers.
9

Categorization of Programming Language by Domains

10

Orthogonal Classifications I

11

Orthogonal classification II

Java Javascript Python C
Static / Dynamic S D D S
Compiled / Interpreted C I* I* C
Sequential / Parallel P** S** P P**
Static Linked / Dynamic Linked D -*** -*** S/D
Safe / Unsafe S S S U
Bytecode / Assembler B - - A
Platform Dependent / Cross C C C P
* But uses just in time compiler
** Depends on standard or version
*** interpreted languages are not linked
12

Language Design Trade-Offs

Java bounds checking of all arrays accesses is expensive.

C++ allows for many abstractions, allows complex computations to be written in a compact form, but is hard to read.

C pointers are powerful and very flexible but are unreliable and error prone.

13

Some Thoughts

“There are only two kinds of languages: the ones people complain about and the ones nobody uses.”
( Bjarne Stroustrup, The C++ Programming Language)


14

Thank you

Sebastian Macke

Rosenheim Technical University

Use the left and right arrow keys or click the left and right edges of the page to navigate between slides.
(Press 'H' or navigate to hide this message.)