Posted on April 29, 2018

# Concepts in Programming Languages I

1. Read and make notes on chapters 3 (on LISP) & 5 (on ALGOL) of Mitchell (2003). In your notes, pay particular attention to motivation and new innovations of the language.

2. An author writes

Briefly discuss the merits and/or shortcomings of the above three statements, giving examples and/or counterexamples from procedural, applicative, logical, and/or object-oriented programming languages.

3. For the programming languages FORTRAN, LISP, Java, C, C++ and ML briefly discuss and evaluate their typing disciplines.

4. Consider the following two program fragments:

( defvar x 1 )
( defun g(z) (+ x z) )
( defun f(y)
(+ (g 1)
( let
( ( x (+ y 3) ) )
(
g(+ y x)
) ) ) )
( f 2 )

val x = 1 ;
fun g(z) = x + z ;
fun f(y)
= g(1) +
let
val x = y + 3
in
g(y+x)
end ;
f(2) ;


What are their respective output values when run in their corresponding interpreters? Justify your answer, relating it to the concepts in the course.

5. Give an overview of the LISP abstract machine (or execution model) and comment on its merits and drawbacks from the viewpoints of programming, compilation, execution, etc.

6. Define the following parameter-passing mechanisms: pass-by-value,pass-by-reference, pass-by value/result, and pass-by-name. Briefly comment on their merits and drawbacks.

7. What is aliasing in the context of programming languages? Explain the contexts in which it arises and provide examples of the phenomenon.

8. As many exam questions as you would like me to mark.

Mitchell, J.C., 2003. Concepts in programming languages. Cambridge University Press.