Presentation is loading. Please wait.

Presentation is loading. Please wait.

Implementation of a Functional Programming Language

Similar presentations


Presentation on theme: "Implementation of a Functional Programming Language"— Presentation transcript:

1 Implementation of a Functional Programming Language
Jason Koenig Computer Systems Lab TJHSST

2 Introduction Creation of a functional language
Both design and implementation Working Parsing Optimization Execution Todo: Multiple Files, I/O

3 What is a Functional Language?
Two approaches: Imperative – like a recipe, or a how to. Declarative – like a mathematical formula. Functions are first class citizens Functions are like data

4 Design Goals Small and lightweight Core language highly portable Other functionality in standard library Easily embedded in other programs as scripting language Driven by implementation, rather than some external metric

5 Implementation File, Input Optimizer Executor Parser Program Output
Characters Optimized Code Tree Lexical Analysis Syntax Tree Executor Tokens Bytes Parser Program Output

6 Sample Programs let even = {x| if x == 1 then false else odd.x-1},
odd = {x| if x == 1 then true else even.x-1} in (even.2000)

7 Sample Program let even = {x| if x == 1 then false else odd.x-1},
odd = {x| if x == 1 then true else even.x-1} in (even.2000)

8 Sample Program let compose = {f, g, x | f.(g.x)}, add2 = {a| a+2},
mult3 = {a| a*3}, mult3add6 = compose.mult3.add2 in mult3add6.5

9 Future Work Tail Recursion G-machine compilation of functions Language
Imperative style constructs Standard Library Implementation: C for speed


Download ppt "Implementation of a Functional Programming Language"

Similar presentations


Ads by Google