The SCHEME Programming Language. MIT Press, 2002. 2. Robert W. Sebesta.
Concepts of Programming Languages. (8th Edition). Addison-Wesley. CSI 311: ...
CSI 311: Principles of programming languages Paliath Narendran
[email protected]
CSI 311: Spring 2008 – p.1/12
Office Hours
Paliath Narendran
LI-95B
Ben Carle
LI-95D
M 3–4pm, Tu 2–3pm
Ning Ying
CSI 311: Spring 2008 – p.2/12
Textbooks
1. R. Kent Dybvig. The SCHEME Programming Language. MIT Press, 2002.
2. Robert W. Sebesta. Concepts of Programming Languages. (8th Edition) Addison-Wesley.
CSI 311: Spring 2008 – p.3/12
Evaluation
Midterm I
–
Feb 27, 2008 (W)
:
12:35 to 1:30 PM
–
20%
Midterm II
–
April 2, 2008 (W)
:
12:35 to 1:30 PM
–
20%
Final
–
May 15, 2008 (Th)
:
10:30am to 12:30 PM
–
40%
Homework
–
–
20%
If your homework grade is 0, you will get an E in the course regardless of your performance in the exams.
CSI 311: Spring 2008 – p.4/12
Outline
•
•
Syntax of programming languages
•
regular expressions
•
context-free grammars, BNF
Subprograms — procedures, functions
• •
•
parameter passing
Semantics
•
Static — attribute grammars
•
Dynamic — axiomatic semantics
Declarative programming
•
Functional programming — SCHEME
•
Logic programming — PROLOG
CSI 311: Spring 2008 – p.5/12
Milestones
1957 1959 1960 1964 1971 1972 1975 1984 1995
FORTRAN LISP ALGOL 60, COBOL BASIC PASCAL C, PROLOG SCHEME, ML C++ JAVA
CSI 311: Spring 2008 – p.6/12
Compiling
Source program
Compiler Machine code Input
Computer
Output
CSI 311: Spring 2008 – p.7/12
Compiling
Source program
Syntax checker
Code generator
Machine code Input
Computer
Output
CSI 311: Spring 2008 – p.8/12
Interpreting
Source program Input Interpreter
Output
CSI 311: Spring 2008 – p.9/12
Interpreting
Source program
Syntax checker
Input Interpreter
Output
CSI 311: Spring 2008 – p.10/12
Compiling vs Interpreting
•
compiled languages — C, C++, Java
•
interpreted — Perl, Scheme, Maple
CSI 311: Spring 2008 – p.11/12
A Sample Program
#include int x; int foo (int y) {x = x + 1; return (x + y); }
main() { x = 10; x = foo(x); x = foo(x); cout