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.

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

C-LISP. LISP 2 Lisp was invented by John McCarthy in 1958 while he was at the Massachusetts Institute of Technology (MIT).John McCarthyMassachusetts Institute.
1 Copyright © 1998 by Addison Wesley Longman, Inc. Chapter 14 Functional Programming Languages - The design of the imperative languages is based directly.
1 Scheme and Functional Programming Aaron Bloomfield CS 415 Fall 2005.
Scheme in Scheme. Why implement Scheme in Scheme  Implementing a language is a good way to learn more about programming languages  Interpreters are.
Variables, Environments and Closures. Overview We will Touch on the notions of variable extent and scope Introduce the notions of lexical scope and.
1 Programming Languages (CS 550) Lecture Summary Functional Programming and Operational Semantics for Scheme Jeremy R. Johnson.
Functional Programming. Pure Functional Programming Computation is largely performed by applying functions to values. The value of an expression depends.
Peter Seibel Practical Common Lisp Peter Seibel
Chapter 3 Functional Programming. Outline Introduction to functional programming Scheme: an untyped functional programming language.
SYSTEM PROGRAMMING & SYSTEM ADMINISTRATION
CS 355 – PROGRAMMING LANGUAGES Dr. X. Apply-to-all A functional form that takes a single function as a parameter and yields a list of values obtained.
1-1 An Introduction to Scheme March Introduction A mid-1970s dialect of LISP, designed to be a cleaner, more modern, and simpler version than.
1 Functional programming Languages And a brief introduction to Lisp and Scheme.
Scheme for Python Programmers CSE Valeria Montero.
The Scheme Programming Language History and Significance Dmitry Nesvizhsky CIS24 Professor Danny Kopec.
Chapter 15 Functional Programming Languages. Copyright © 2007 Addison-Wesley. All rights reserved. 1–2 Introduction Design of imperative languages is.
Common Lisp! John Paxton Montana State University Summer 2003.
Functional programming: LISP Originally developed for symbolic computing First interactive, interpreted language Dynamic typing: values have types, variables.
TES3111 October 2001 Artificial Intelligence LISP.
SchemeCOP Introduction to Scheme. SchemeCOP Scheme Meta-language for coding interpreters –“ clean ” semantics Scheme = LISP + ALGOL –simple.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Multilisp: Concurrent Functional Programming Ed Walters and Tim Richards University.
Dr. Muhammed Al-Mulhem ICS An Introduction to Functional Programming.
PROGRAMMING LANGUAGES The Study of Programming Languages.
SCHEME By: Krista and Brett. What is Scheme? Best known for its functional style of programming One of two main dialects of Lisp Developed in 1975 –MIT.
Functional Programing Referencing material from Programming Language Pragmatics – Third Edition – by Michael L. Scott Andy Balaam (Youtube.com/user/ajbalaam)
Functional Programming Universitatea Politehnica Bucuresti Adina Magda Florea
Programming Languages –14 David Watt (Glasgow) Steven Wong (Singapore) Moodle : Computing Science → Level 3 → Programming Languages 3 © 2012 David.
LISP – Not just a Speech Impediment Jim Lowe. Brief History of LISP Initial development begins at the Dartmouth Summer Research Project in 1956 by Dr.
CSC3315 (Spring 2009)1 CSC 3315 Programming Paradigms Scheme Language Hamid Harroud School of Science and Engineering, Akhawayn University
Sigma Lisp Σλ Sam Davis Nick Alexander. What is Sigma Lisp? ● New dialect of Lisp ● Designed to be as expressive as possible.
ISBN Chapter 15 Functional Programming Languages.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Functional Programming in Scheme and Lisp. Overview In a functional programming language, functions are first class objects. You can create them, put.
CS 330 Programming Languages 11 / 21 / 2006 Instructor: Michael Eckmann.
CSE S. Tanimoto Lambda Calculus 1 Lambda Calculus What is the simplest functional language that is still Turing complete? Where do functional languages.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 7.
Simula Programming Language Lenar Uri T. Barcelona.
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
Functional Programming and Lisp. Overview In a functional programming language, functions are first class objects. In a functional programming language,
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
ISBN Chapter 15 Functional Programming Languages.
Functional Programming CS331 Chapter 14. Functional Programming Original functional language is LISP –LISt Processing –The list is the fundamental data.
Variables, Environments and Closures. Overview Touch on the notions of variable extent and scope Introduce the notions of lexical scope and dynamic.
1-1 An Introduction to Functional Programming Sept
Scheme Profs Tim Sheard and Andrew Black CS 311 Computational Structures.
Milos Hauskrecht (PDF) Hieu D. Vu (PPT) LISP PROGARMMING LANGUAGE.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 1 Overview A good programming language is.
CS 330 Programming Languages 11 / 15 / 2007 Instructor: Michael Eckmann.
1 FP Foundations, Scheme In Text: Chapter Chapter 14: FP Foundations, Scheme Mathematical Functions Def: A mathematical function is a mapping of.
Chapter – 8 Software Tools.
Functional Programming. Some Functional Languages Lisp Scheme - a dialect of Lisp Haskell Miranda.
CSE 425: Functional Programming I Programs as Functions Some programs act like mathematical functions –Associate a set of input values from the function’s.
Ada, Scheme, R Emory Wingard. Ada History Department of Defense in search of high level language around Requirements drafted for the language.
Comparative Programming Languages Functional programming with Lisp/Scheme.
C H A P T E R E I G H T Functional Programming Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
Programming Languages Concepts Chapter 1: Programming Languages Concepts Lecture # 4.
Functional Programming
Functional Programming Languages
Functional Programming
Variables, Environments and Closures
CS 326 Programming Languages, Concepts and Implementation
Variables, Environments and Closures
Lecture 15 (Notes by P. N. Hilfinger and R. Bodik)
FP Foundations, Scheme In Text: Chapter 14.
Bindings, Scope, and Extent
Lisp, Then and Now.
6.001 SICP Variations on a Scheme
topics interpreters meta-linguistic abstraction eval and apply
Chapter 15 Functional Programming 6/1/2019.
Presentation transcript:

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.

History of Scheme

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 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.

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

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.

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.

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.

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.

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

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).

Sample Programs

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

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

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

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

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))

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

Sample Scheme Programs BRL. The "Beautiful Report Language"; a framework for building server-side web applications. See Naughty Dog. The game developer Naughty Dog Inc have used Scheme in the development of a several of their games. See Siag Office. A free Office package for Unix that features Scheme as one of its extension languages. See  Scribe. A text processor for writing technical documents and producing output in a variety of formats. See JACAL. An interactive symbolic mathematics program. See

Some Scheme Implementations Bigloohttp://www-sop.inria.fr/mimosa/fp/Bigloo/ Chez Schemehttp:// DrScheme Chickenhttp:// EdSchemehttp:// Guilehttp:// JSchemehttp://jscheme.sourceforge.net/ Lunahttp://sourceforge.net/projects/luna-scheme/ MIT Schemehttp:// MSchemehttp://drscheme.orghttp://drscheme.org OpenSchemehttp://

Links Scheme Documentations 1.IEEE: busarch/ _desc.htm 2.R5RS: