Introduction to course, programming paradigms: functional, logic, imperative, object oriented; history of programming languages. Language design issues: orthogonality, abstraction; syntax, semantics, tokens, grammars, compilation, execution model, interpreters. (Sethi Ch. 1, ASU Ch.1). (When possible, we will post lecture notes. Use ghostview to magnify and read them. )
Expression grammars, operator precedence and associativity, abstract syntax, concrete syntax. BNF, EBNF. (Sethi Ch. 2; ASU Ch 2.2).
Regular expressions and their language; finite (deterministic and non-deterministic) automata; the relationship of the two. (ASU Chs 3.3-3.4).
Recursive functions, functions as first-class citizens (lambda, apply, map). Currying; fancier reductions (reduce and fold).
Let, Let*, environments, closures.
(Sethi Ch.10).
Types, their utility, type checking and safety. Simple/primitive
datatypes. Compound datatypes:
arrays (layout, (runtime?) bounds);
record structures (layout, strange C syntax);
pointers (l-value vs. r-value; pointers in C: pointer
arithmetic, space allocation; comparison with "references" (in
languages like Scheme, Java); pointers to functions.
strings: arrays and pointers (in C)
variants and union types, and how they lead to type unsafety.
Type declaration and equivalence, casting, coersion, overloading, subtypes (widening & narrowing).(Sethi Ch 4 except 4.6).
Abstract data types: packages in Ada and classes in C++ (specification vs. implementation, parametric polymorphism, friend classes); (Sethi Ch.6)
Dynamic dispatch at run-time.
(Sethi Ch.7.1-7.6)
Database of facts; queries with variables; backtracking; rules; recursion. Logic Programming (assertions) vs. Prolog (+control). Tracing control. Lists and list manipulation in Prolog. General data structures. Cut and its uses. Arithmetic in Prolog. Parsing in Prolog. "Generate and Test" programming.
(Sethi Ch.11.1-11.3, only guess-an-verify in 11.4, 11.5)
Scope: free/global vs. bound/local variables; procedure activation tree and scope; static vs. dynamic scope. Run-time stack implementation, procedure nesting depth, activation records, displays, central reference table. (Sethi Ch 5.3-5.5, 15.1 - or any other language allowing nested procedure definitions.).