pp01 - Intro Basic Consepts Programming Concept
pp01 - Intro Basic Consepts Programming Concept
J. Gamper
1 Introduction
Outline
1 Introduction
Programming Paradigms/1
Programming Paradigms/2
Programming Paradigms/3
Imperative / Procedural
Functional
Object-Oriented
Concurrent
Logic
Scripting
Brief recapitulation
Elements of programming languages
Imperative/procedural paradigm
Paradigms and languages
Object-oriented: Ruby
Logic programming: Prolog
Functional: Haskell
Concurrent: Erlang
Books/Literature
Outline
1 Introduction
Compiled languages are translated into machine code that can be run
directly on a computer’s processor
Usually the whole program is translated before it is run
Interpreted languages are processed by a higher-level virtual machine
Usually a program is translated on the fly, i.e., a statement is translated and
then immediately executed
Compiled Languages
Source code
↓
Lexical/Syntactical Analysis
Type Checker
Code generation/optimization
Interpreted Languages
Source code
↓
Lexical/Syntactical Analysis
Type Checker
↓↑
Computer
Syntax/1
Syntax/2
Semantics
Operational Semantics
Axiomatic Semantics
{P}S{Q},{Q}T {R}
Composition rule: {P}S;T {R}
Denotational Semantics
Typing
Type System
Data Types
Type Casting
Although some people feel quite strongly about this, each approach has
pros and cons
Static typing:
+ less error-prone
- sometimes too
restrictive
Dynamic typing:
+ more flexible
- harder to debug (if
things go wrong)
Summary