Programming Languages and Compilers

 

Lecture 1

 

This lecture introduces the course. We will look at Programming Language Paradigms and the history of Programming. The lecture will give an overview of what is involved in writing a compiler. The slides for this lecture can be found here.

 

Literature

 

Sebasta, chapter 1 and 2. Chapter 2 should be read as background material or a goodnight storey ;-)

Watt and Brown, chapter 1.

 

Some references on the web worth studying:

 

You can find an almost complete diagram of programming language history on this URL.

 

There is a short, but worthwhile, overview of Compilers, Interpreters and Virtual Machines written by Kashif Manzoor on this URL and a popular version by Alan Joch published in ComputerWorld on this URL.

 

Exercises

 

Exercises for lecture 1 will be done from 12.30 till 14.15 before Lecture 2 on Tuesday the 17th of February.

 

1. Make a list of all the computer languages you know.

(Remember to include command, scripting and text processing languages)

 

2. How well do you know the above languages?

Categorize them according to the following:

·        Daily use

·        Often

·        Written a few programs

·        Looked at it once or twice

 

3. Which language was your first programming language?

 

4. Categorize the above languages according to generations (1st to 5th (or 6th))

 

5. Categorize the above languages according to paradigm

(imperative, object oriented, declarative, special)

 

6. Do Sebesta exercise 1 and 3 page 34.

 

7. Do Sebesta exercise 4, 10, 11 and 12 page 35.

 

8. Do Sebesta exercise 15 page 35 consider Java, SML and Perl or PhP.

 

9. Do Sebesta exercise 14, 16 and 17 page 111.

 

10. Do Watt & Brown exercise 1.4 page 25.

 

11. Do Watt & Brown exercise 1.5 page 25.

 

12. Do Watt & Brown exercise 1.6 page 25.

(This exercise can be solved using pen and paper or by downloading and installing the Triangle compiler and TAM virtual machine from http://www.dcs.gla.ac.uk/~daw/books/PLPJ/

click on the Software link.)