Programming Language Concepts Review
Guide
Understand the different programming paradigms:
- imperative/procedural
- object-oriented
- functional
- logical/declarative
(only the basic idea and the example language Prolog)
Understand the difference between syntax and semantics.
Understand the difference between static and dynamic
properties of programs.
Understand the difference between static and dynamic
allocation
- fully
static (e.g., Fortran)
- fully
dynamic (e.g., LISP)
- mixed/stack-based
(e.g., C)
Know some history of programming languages:
- Fortran
- Cobol
- LISP
- C
- Java
Be ready to discuss language design criteria
- efficiency
(of operation, implementation, programming, maintenance)
- writability
- readability
- regularity:
generality, orthogonality, uniformity
- expressiveness,
extensibility, restrictability, machine-independence, security, etc.
Understand the lexical structure of languages
- tokens
& token categories (reserved words, identifiers, etc.)
- context-free
grammars
- BNF
& EBNF notation
- parse
trees and abstract syntax trees
- ambiguous
grammars
- expressing
operator associativity and precedence in grammars
Understand basic semantics
- attributes
of variables (type, location, value, scope, lifetime)
- different
binding times for attributes of variables
- static
vs. dynamic bindings
- scope
of binding
- symbol
table
- static
vs. dynamic scope
- stack/automatic
allocation, and activation records
- heap/dynamic
(manual) allocation
- R-value
and L-value
- variable
aliases
- dangling
references & garbage
Control flow
- Short-circuiting
- Expression
(returns a value) vs. Statement (results in assignment)
- "Side
effects" in procedural vs. functional languages
- Iteration
vs. recursion
Data Types
- Denotational
(name) vs. structural definitions
- Purpose
of a type system
- What
does "strong typing" mean?
Example language?
- Static
typing -- example language?
- Scalar
vs. composite types
- Casting
vs. coercion
- Shallow
vs. deep variable comparisons
Subroutines
- Formal
vs. Actual parameters
- Function
vs. procedure
- General
layout of stack -- static & dynamic links
- Content
of stack frame
- Calling
sequence specifications
- Passing
by value, passing by reference, passing by value/result
Programming:
- Be
ready to write a simple function in Scheme
- Be
ready to write either a functional or procedural rountine in C or Java
(simple)
- Be ready
to interpret/debug example functional and procedural programs
- Be
ready to write a simple Perl program, or interpret/debug an example
- Understand
the Perl data types and how to use them.
- Understand
regular expressions and be ready to create or debug regular expressions
- Understand
the difference between G2 variables and local names
- Be
ready to debug simple G2 rules or procedures
- Be
able to differentiate event-driven and data-driven processing in G2
- Be
ready to compare and contrast Scheme, Perl, and G2 with respect to
- variables
and scope
- regularity
- language
paradigm
- applications
- advantages
and disadvantages
For the Final Exam, you may bring 1 sheet of paper with
notes, to which you may refer during the exam.