University of Virginia, Department of Computer Science
CS655: Programming Languages
Position Paper 3
28 February 2000
CLUs about Ada
I would like to start this paper by commenting on the question asked. Did Ada satisfy the DOD's requirements better than CLU? I think I have read carefully the papers handed out and I have not found any trace of a serious DOD's list of requirements. So answering this question without any extra source of information appears a bit hazy to me. The only approximative approach I imagine is to compare the two languages and if Ada is different from CLU, I would assume that Ada fills better the DOD's requirements than CLU. Only if Ada and CLU appears similar enough, I could then consider that the money invested in the military research would have rather been invested in anti-missile projects.
Let's answer to the second question first: Did Ada satisfy the DOD's requirements better than CLU? Regarding to my preceding reserves, I would tend to say YES. However, a full justification of this answer should consist of a systematic comparison of the features of Ada and CLU, and, would certainly overflow the Declaration of Independence of the United States of America. I would rather consider another strategy by presenting a brief comparison which will give one example where Ada shows a clear different feature from CLU's mechanisms.
In An Overview of Ada, Ada is presented as a programming language of the "second revolution" i.e. providing data abstraction. CLU does provide abstraction mechanisms including not only data abstraction but also procedural and control abstractions. A bit further in the paper, the key features of Ada are presented as:
- strong typing
- programming in the large
- exception handling
- data abstraction
- generic units
Both Ada and CLU provide a strong typing with a static checking at compile-time.
Programming in the large
described as the mechanisms for encapsulation and separate compilation. By its overall abstract approach, CLU encourages modularity of programs and consolidates the modules through the CLU library.
CLU and Ada both provide exception handlers that can be paramaterized by users. CLU includes exception handling in its general abstraction terminology.
Ada is said to be the first language likely to be widely used which has contained embedded facilities for tasking. This powerful feature allows the programmer to define parallel processes within a procedure. It has no CLU equivalent and it is a difference that I consider important enough to say that Ada fills the DOD's requirements better than CLU.
This feature defining "the second generation of programming languages" is provided by the two languages. CLU's cluster and Ada's package both have the same function: allowing to separate a data abstraction from its implementation. To illustrate these similarities, here are the example of same user-defined type implemented in Ada on the left and in CLU on the right:
PACKAGE wordbag IS
FUNCTION create RETURN wordbag;
PROCEDURE insert(x : wordbag, v : STRING);
PACKAGE BODY wordbag IS
FUNCTION create RETURN wordbag IS
PROCEDURE insert (x : wordbag, v : STRING);
x.total := x.total + 1;
wordbag = CLUSTER IS
REP = RECORD [contents: wordtree, total: INT];
create = PROC() RETURNS (CVT);
insert = PROC(x : CVT, v : STRING);
x.contents := wordtree$insert(x.contents, v);
x.total : =x.total + 1;
They provide the ability to parameterize units over appropriate data types. CLU supports the same feature by allowing to parameterize clusters with a data type.
From its general abstraction, CLU appears to be much more consistent in its terminology than Ada. When Ada tends to add new features (discriminated, access and private types, tasks...) to a classic programming language, CLU surprises by its uniformity of design.
The absence of tasking in CLU makes me think that Ada fills the DOD's requirements better. However, we certainly can ask the question if Ada design effort was an unnecessary governement waste of taxpayer money just to eventually add a tasking feature to CLU (if Ada can be summarized this way). It's true that considering CLU during this study could have saved some money however the answer of this question is again NO from my point of view. I have no idea of the way CLU was designed but Ada is clearly a rational effort to study the programming languages of this period and finally to produce a new standard at least for military purposes. This view comes from a well-known concept that research and development in the United States is mainly generated by military funds and needs. The interest of this effort cannot be reduced to only the resultant programming language. I guess it is one of the reasons why Ada is much more used than CLU today both by the DOD and in Europe. A military project involving millions of dollars is much more trusted than an obscure experimental language.