Functional Programming
Transcript
-
Functional Programming Ionut G. Stan - OpenAgile 2010
-
Functional Programming what why how
-
Functional Programming what why how
-
What is FP a programming style
-
Imperative Programming programming: telling a computer what to do
-
von Neumann architecture
-
What is FP a programming style conceptually derived from lambda
calculus (1930s) not procedural programming functions as in mathematical functions trying to plug the abstraction leak tell the computer what to do, not how mutations not allowed (no variables, just identifiers) no statements, just expressions (if/then/else is expression)
-
What is FP a programming style conceptually derived from lambda
calculus (1930s) not procedural programming functions as in mathematical functions trying to plug the abstraction leak tell the computer what to do, not how mutations not allowed (no variables, just identifiers) no statements, just expressions (if/then/else is expression) functions are deterministic and side-effect free
-
What is FP a programming style conceptually derived from lambda
calculus (1930s) not procedural programming functions as in mathematical functions trying to plug the abstraction leak tell the computer what to do, not how mutations not allowed (no variables, just identifiers) no statements, just expressions (if/then/else is expression) functions are deterministic and side-effect free functions are all we need to model computation
-
What is FP a programming style conceptually derived from lambda
calculus (1930s) not procedural programming functions as in mathematical functions trying to plug the abstraction leak tell the computer what to do, not how mutations not allowed (no variables, just identifiers) no statements, just expressions (if/then/else is expression) functions are deterministic and side-effect free functions are all we need to model computation execution order is not guaranteed
-
Functional Programming what why how
-
Why FP easier to reason about programs
-
Why FP easier to reason about programs heisenbugs
-
Why FP easier to reason about programs heisenbugs race conditions
-
Why FP easier to reason about programs
-
Why FP easier to reason about programs easier to parallelize
-
Functional Programming what why how
-
Functional Programming what why how (even in imperative languages)
-
How to FP avoid side-effects/mutation as much as possible
-
Functional Programming what why how example
-
Example
-
Example
-
Example
-
"Conventional programming languages are growing ever more enormous, but not
stronger. Inherent defects at the most basic level cause them to be both fat and weak: their primitive word- at-a-time style of programming inherited from their common ancestor -- the von Neumann computer, their close coupling of semantics to state transitions, their division of programming into a world of expressions and a world of statements, their inability to effectively use powerful combining forms for building new programs from existing ones, and their lack of useful mathematical properties for reasoning about programs." John Backus, known for Fortran, Algol and BNF
-
Thank You igstan.ro | [email protected] | @igstan
-
Questions? igstan.ro | [email protected] | @igstan