Tools Setup for Linux_week1-1.pdf

(9937 KB) Pobierz
Functional Programming Principles in Scala
Martin Odersky
September 12, 2012
Programming Paradigms
Paradigm: In science, a
paradigm
describes distinct concepts or
thought patterns in some scientific discipline.
Main programming paradigms:
imperative programming
functional programming
logic programming
Orthogonal to it:
object-oriented programming
Review: Imperative programming
Imperative programming is about
modifying mutable variables,
using assignments
and control structures such as if-then-else, loops, break,
continue, return.
The most common informal way to understand imperative programs
is as instruction sequences for a Von Neumann computer.
Imperative Programs and Computers
There’s a strong correspondence between
Mutable variables
Variable dereferences
Variable assignments
Control structures
memory cells
load instructions
store instructions
jumps
Problem:
Scaling up. How can we avoid conceptualizing programs
word by word?
Reference:
John Backus, Can Programming Be Liberated from the
von. Neumann Style?, Turing Award Lecture 1978.
Scaling Up
In the end, pure imperative programming is limited by the “Von
Neumann” bottleneck:
One tends to conceptualize data structures word-by-word.
We need other techniques for defining high-level abstractions such
as collections, polynomials, geometric shapes, strings, documents.
Ideally: Develop
theories
of collections, shapes, strings, …
Zgłoś jeśli naruszono regulamin