Presentation is loading. Please wait.

Presentation is loading. Please wait.

SCHEME Scheme is elegant, clear, small, and powerful programming language. It is a dialect of LISP and can be classified as a semi-functional programming.

Similar presentations


Presentation on theme: "SCHEME Scheme is elegant, clear, small, and powerful programming language. It is a dialect of LISP and can be classified as a semi-functional programming."— Presentation transcript:

1 SCHEME Scheme is elegant, clear, small, and powerful programming language. It is a dialect of LISP and can be classified as a semi-functional programming language. Scheme is based on a formal model the lambda calculus.

2 History of Scheme

3 1975 Scheme came into existence as a “toy'' Lisp interpreter that Guy Steele and Gerald Sussman wrote to study some aspects of Carl Hewitt's theory of actors, an object-oriented computational paradigm. 1978 Rabbit -1st scheme compiler by Guy Steele Jr. It was used at the Massachusetts Institute of Technology AI department for reasearching new semantic concepts in programming language.

4 History (cont’n) Scheme rapidly became popular not only among groups interested in the theoretical and mathematical aspects of programming languages, but also as a tool for research and as the basis for computer science curricula at the universities and colleges

5 History (cont) Scheme standardization is an ongoing process. Today Reports are now written by an informal group of “Scheme Authors”. They communicate on a regular basis, and new features must be decided on unanimously by the authors. –This ensures the language remains relatively stable and small.

6 Features of Scheme Functions are first class citizens - stored in a variable or a list - passed to another function - returned from another function Scheme's philosophy is unashamedly Minimalist –Its goal is not to pile feature upon feature, but to remove weaknesses and restrictions that make new features appear necessary.

7 Features (cont) First variety of Lisp to use lexical variable scoping exclusively –the scope of certain variables is determined according to its position in program code - Like Lisp, Scheme supports garbage collection of unreferenced data.

8 Features(cont) Listing capabilities - It uses lists as the primary data structure. (a (b (c d))) Scheme has very little syntax compared to many other programming languages.

9 Some Disadvantages Things that are simple in other languages tend to be hard in Scheme, yet some simple Scheme tricks are hard to do in other languages. Scheme is not standardized beyond its core. –Functions that exist in one Scheme implementation do not need to exist in another or may have a completely different name and/or interface

10 Disadvantages (cont) One of the drawbacks of Scheme is that they are dynamically typed.This means that functions are written without saying what type of arguments they expect. - If the wrong type of value is passed to a function, the error is only detected at run-time when an operation is applied to a value that is incorrect (e.g., adding a string to a number or subtracting one from a function).

11 Sample Programs

12 Hello World HELLO WORLD (BEGIN (display “Hello,World”) (newline))

13 Hello World BEGIN –evaluates the expessions sequentially from left to right, and the value of the last expression is returned. (display obj) - standard output for printing to screen

14 Factorial (define (fact n) (if (zero? n) 1 (* n (fact (- n 1)))))

15 Length of Argument in List (define (len x) (if (null? x) 0 ;else (+ 1 (len (cdr x)))))

16 Lexical Scoping (define counter 50) (define (inc-counter) (set! counter (+ 1 counter)) counter) (let ((counter 100)) (display (inc-counter)) (newline) (display counter) (newline) (display (inc-counter))(newline))

17 Let specifies binding of variables to a value -The variables bound by let are visible only within the body of the let - The variables are bound to fresh locations holding the results -let ((variable init)...) expression expression

18 Sample Scheme Programs BRL. The "Beautiful Report Language"; a framework for building server-side web applications. See http://sourceforge.net/projects/brl/.http://sourceforge.net/projects/brl/ Naughty Dog. The game developer Naughty Dog Inc have used Scheme in the development of a several of their games. See http://www.naughtydog.com/. http://www.naughtydog.com/ Siag Office. A free Office package for Unix that features Scheme as one of its extension languages. See http://siag.nu/index.shtml.http://siag.nu/index.shtml  Scribe. A text processor for writing technical documents and producing output in a variety of formats. See http://www-sop.inria.fr/mimosa/fp/Scribe/.http://www-sop.inria.fr/mimosa/fp/Scribe/ JACAL. An interactive symbolic mathematics program. See http://swissnet.ai.mit.edu/~jaffer/JACAL.html. http://swissnet.ai.mit.edu/~jaffer/JACAL.html

19 Some Scheme Implementations Bigloohttp://www-sop.inria.fr/mimosa/fp/Bigloo/http://www-sop.inria.fr/mimosa/fp/Bigloo/ Chez Schemehttp://www.scheme.com/http://www.scheme.com/ DrScheme http://drscheme.orghttp://drscheme.org Chickenhttp://www.call-with-current-continuation.org/http://www.call-with-current-continuation.org/ EdSchemehttp://www.schemers.com/http://www.schemers.com/ Guilehttp://www.gnu.org/software/guile/http://www.gnu.org/software/guile/ JSchemehttp://jscheme.sourceforge.net/http://jscheme.sourceforge.net/ Lunahttp://sourceforge.net/projects/luna-scheme/http://sourceforge.net/projects/luna-scheme/ MIT Schemehttp://www.swiss.ai.mit.edu/projects/scheme/http://www.swiss.ai.mit.edu/projects/scheme/ MSchemehttp://drscheme.orghttp://drscheme.org OpenSchemehttp://www.open-scheme.com/http://www.open-scheme.com/

20 Links Scheme Documentations 1.IEEE:http://standards.ieee.org/reading/ieee/std_public/description/ busarch/1178-990_desc.htm 2.R5RS:http://schemers.org/Documents/Standards/R5RS/


Download ppt "SCHEME Scheme is elegant, clear, small, and powerful programming language. It is a dialect of LISP and can be classified as a semi-functional programming."

Similar presentations


Ads by Google