160 likes | 286 Vues
This lecture integrates critical concepts of implementation in functional programming, discussing the differences between lambda calculus and combinators. Key topics include graph reduction, abstract machines, automatic memory management, and garbage collection. The presentation emphasizes compiler functionality, highlighting how languages like Miranda (lazy) and SML (strict) operate within different memory allocation contexts. It also delves into challenges such as memory fragmentation and resource limitation, offering insights into efficient programming practices within these frameworks.
E N D
GC16/3011 Functional ProgrammingLecture 16Introduction to Implementation
Contents • What is “implementation”? • Lambda calculus versus combinators • Graph Reduction • “Abstract machines” • Automatic Memory Management • Memory allocation • Garbage Collection • Parallel Graph Reduction
Combinators Compiler translates to: l-calculus string tree graph = instruction set memory management Language implementation Language (e.g. Miranda (lazy) or SML (strict)) Fixed set or Variable set combinator rewriting/reduction environment reduction graph reduction AMs: interpreted/compiled/strict/lazy
Language implementation Language (e.g. Miranda (lazy) or SML (strict)) Compiler translates to: l-calculus
string tree graph Language implementation Language (e.g. Miranda (lazy) or SML (strict)) Compiler translates to: l-calculus
string tree graph Language implementation Language (e.g. Miranda (lazy) or SML (strict)) Compiler translates to: l-calculus environment reduction
string tree graph Language implementation Language (e.g. Miranda (lazy) or SML (strict)) Compiler translates to: l-calculus environment reduction graph reduction
string tree graph Language implementation Language (e.g. Miranda (lazy) or SML (strict)) Compiler translates to: l-calculus environment reduction graph reduction AMs: interpreted/compiled/strict/lazy
Combinators Compiler translates to: l-calculus string tree graph Language implementation Language (e.g. Miranda (lazy) or SML (strict)) environment reduction graph reduction interpreted/compiled/strict/lazy AMs: interpreted/compiled/strict/lazy
Combinators Compiler translates to: l-calculus string tree graph Language implementation Language (e.g. Miranda (lazy) or SML (strict)) Fixed set or Variable set environment reduction graph reduction interpreted/compiled/strict/lazy AMs: interpreted/compiled/strict/lazy
Combinators Compiler translates to: l-calculus string tree graph Language implementation Language (e.g. Miranda (lazy) or SML (strict)) Fixed set or Variable set environment reduction graph reduction interpreted/compiled/strict/lazy AMs: interpreted/compiled/strict/lazy
Combinators Compiler translates to: l-calculus string tree graph = instruction set Language implementation Language (e.g. Miranda (lazy) or SML (strict)) Fixed set or Variable set environment reduction graph reduction interpreted/compiled/strict/lazy AMs: interpreted/compiled/strict/lazy
Combinators Compiler translates to: l-calculus string tree graph = instruction set Language implementation Language (e.g. Miranda (lazy) or SML (strict)) Fixed set or Variable set combinator rewriting/reduction environment reduction graph reduction interpreted/compiled/strict/lazy AMs: interpreted/compiled/strict/lazy
Combinators Compiler translates to: l-calculus string tree graph = instruction set memory management Language implementation Language (e.g. Miranda (lazy) or SML (strict)) Fixed set or Variable set combinator rewriting/reduction environment reduction graph reduction interpreted/compiled/strict/lazy AMs: interpreted/compiled/strict/lazy
Memory management • Recycling / reusing memory • Limited resources • Programmer does not control placement of data in memory • Issues: • Memory Allocation • Garbage Identification • Garbage Collection • Fragmentation
Summary • What is “implementation”? • Lambda calculus versus combinators • Graph Reduction • “Abstract machines” • Automatic Memory Management • Memory allocation • Garbage Collection • Parallel Graph Reduction