Programming Languages (CSC-302 99S)


Assignment One: Language Design Issues

Assigned: Friday, January 29, 1998
Due: Friday, February 5, 1998

The purpose of this assignment is to help you think about language design issues from a variety of perspectives.

1. Language Evaluation

Choose a language that you know and use. Pick eight criteria from those given in lecture, the book, or Hoare's article and evaluate the language according to those criteria. That is, for each criterion, evaluate how well or how poorly the language meets that criterion, motivate your evaluation, and, if possible, give an example that supports your argument.

You should not repeat examples given in Louden or in class.

2. Iteration vs. Recursion

Write a recursive and an iterative greatest common divisor function in Java (or Pascal, if you don't know Java). Write a program (or programs) that determines which is faster and by how much. If there a reason, other than execution speed, that you might prefer one function to the other?

Note that Louden presents Modula-2 code for both the iterative (page 9) and recursive (page 13) versions of the function.

3. Overloading

In his paper, Hoare promotes the use of operator overloading, in which programmers can define the meaning of the standard operators on new data types. However, the experience of the C++ community (which permits operator overloading) has illustrated some disadvantages of operator overloading. Describe some disadvantages of operator overloading.

4. Coercion in Pascal and Java

In Pascal and Java, integers can be assigned to real variables, but reals cannot be assigned to integer variables. What design principle does this violate? Would it be a good idea to allow reals to be assignable to integer variables? Why or why not? [Modified from Louden, p. 59, q. 5]

5. Simplifying a Language

Choose a feature that you think should be removed from some programming language (you can choose which language). Why should this feature be removed? What problems might arise as a result of this removal? [Modified from Louden, p. 59, q. 6]

You should not repeat examples given in the readings or in class.

6. Extending a Language

Choose a feature that you think should be added to some programming language (you can choose which language). Why should this feature be added? What needs to be stated about the feature for those implementing or using the language to understand it unambiguously? [Modified from Louden, p. 59, q. 7]

You should not repeat examples given in the readings or in class.

7. Orthogonality and Uniformity

Find definitions of orthogonality and uniformity other than those in my notes and Louden. Then, using the various definitions, summarize how these two concepts are similar and different.


History


Disclaimer Often, these pages were created ``on the fly'' with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.

This page may be found at http://www.math.grin.edu/~rebelsky/Courses/CS302/99S/Assignments/assign.01.html

Source text last modified Fri Jan 29 10:13:08 1999.

This page generated on Fri Jan 29 10:15:06 1999 by SiteWeaver. Validate this page.

Contact our webmaster at rebelsky@math.grin.edu