Theory of Programming Languages

Homework #1
Due: September 7, 2011

  1. In C/C++, you can increment a variable using any of:
    x += 1;
    x = x+1;
    Do some research on these statements to answer the following questions such as:
    1. Why have multiple ways of doing the same thing (non-orthogonality)?
    2. Why is the syntax x += 1; rather than x =+ 1; ?  See if you can track down a version of a language that actually did this.
    3. Is there any real difference with today's compilers?  A bit of programming can be done here (hint: look at the assembly/intermediate language).
    4. What other factors come into play?

  2. Early versions of COBOL had a limited version of the IF statement.  Track down information on this limitation(s?) and report on it.

  3. The original designer of Java intentionally left user-defined operator overloading out of the language.  What was his reasoning?  There are advocates of putting this feature back into the language.  Discuss the pros and cons of doing so.

  4. Chapter 1, Problem Set. Problems 11, 12, and 18.

  5. Chapter 2, Problem Set. Problems 8, 11, 12, 14, 18, and 24.