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.
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$
Motivating Application: The language was designed so that a specific kind of program could be written more easily.
Abstract Machine: There is a simple and unambiguous program execution model.
Theoretical Foundations: Theoretical understanding was the basis for including certain capabilities and omitting others.
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) + 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, explaining it in a conceptual manner.
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.