Question 1

Estimated completion time: 60 minutes

Read Chapter 3 (lisp) and Chapter 5 (Algol family) from Concepts in Programming Languages, Mitchell. Write brief notes on what you read paying attention to the motivation and new innovations of each language.

Question 2

Estimated completion time: 50 minutes

This course has a lot in common with Software Engineering. You need to be able to discuss the pros and cons of different programming language choices and present evidence for your arguments (case studies) based on the languages in the course. Your answers to the questions should reflect this.

a) An author writes:

Most successful language design efforts share three important characteristics $\ldots$

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.

b) For the programming languages FORTRAN, LISP, Java, C, C++ and ML briefly discuss and evaluate their typing disciplines. Further compare the advantages and disadvantages that their designs impose on the programmer.

c) 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) +
      val x = y + 3
   end ;
f(2) ;

What are their respective output values when run in their corresponding interpreters? Justify your answer, explaining it in a conceptual manner.

Question 3

Estimated completion time: 20 minutes

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

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

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