CLU (programming language)

CLU is a programming language that was developed in 1974 and 1975 at the Massachusetts Institute of Technology by Barbara Liskov and her students. CLU was the first implemented programming language according to Liskov, which offered a direct linguistic support for data abstraction, which was a key element in the development of object-oriented programming languages.

The idea of ​​data abstraction came up in the course of work on programming methodology. The primary goal of the project which led to the development of CLU, the research was to advance to the programming methodology. According to own statements, the developers of the language did not see their destination in the same distribution, but rather in the dissemination of concepts for software development; which were implemented in CLU. They dimensioning your success in the influence that their publications on the development of future programming languages ​​and their application in practice should have. Thus CLU received a symbolic character. The development of CLU was supported by DARPA and the National Science Foundation.

CLU is not intended to be so-called low-level programming, applying in the development of operating systems and their components, eg. The language should appeal to experienced programmers. Although it is not intended as a learning language for academic purposes such as Pascal, it can also be used as such. CLU favors the readability and comprehensibility of software systems compared to the simplicity of being able to write functioning code. It is thought technically as a tool for development in a big way. Emphasis was placed on the development of large software systems that require multiple developers and their scope includes several thousand to a hundred thousand lines of code.

Development of language

CLU was originally developed by four people: Barbara Liskov and students Russ Atkinson, Craig Schaffert and Alan Snyder. Steve Zilles was heavily involved in the initial work on CLU. However, starting in 1974, he increased his activities to the specifications of abstract types and acted in the end more and more as an interested onlookers and critics of the design process. With time, more students were added, and others, Bob Scheifler and Eliot Moss. The development was a strong focus on teamwork. It is therefore not possible to offer individual language elements assigned to individual developers. It was implemented in parallel with the language design. It was never approved that the implementation given the design of the language elements. The completion of speech elements is delayed until the design was completed those.

There are various programming languages ​​studied in order to clarify which of them would possibly as a basis for CLU in question. The developers came to the conclusion that none of the languages ​​would be suitable, since none of them supports data abstraction. The developers wanted to know where this idea would bring them, without having to worry about how it might interact with pre-existing properties. Nevertheless, different language elements have been adopted by existing programming languages. The semantic model is based largely on in Lisp; the syntax was taken from ALGOL.

Language elements

Cluster

One of the most important elements of CLU is the concept of the cluster. This corresponds to an object in an object oriented language such as C , and has approximately the same syntax.

One example is an implementation for complex numbers cited:

Complex_number = cluster is add, subtract, multiply, ...          rep = record [ real_part: real, imag_part: real]          add = proc ... end add;          subtract = subtract proc ... end;          multiply = proc ... end multiply;          ...      end complex_number; Although the concept of cluster represented a times this advanced tool for structuring of program code, there is no mechanism to structure the cluster itself. This means that cluster names are global and not group as well as nesting of clusters are possible. CLU does not support implicit type conversion: in a cluster change the explicit conversions using the commands up and down between the abstract type and the representation. Furthermore, a universal data type any, and provided a procedure force [ ] are available. The procedure checks whether an object has a particular type. Objects, the properties of mutable and immutable have. The latter are defined as so-called native data types such as integers.

Other language elements

Many of the features of object-oriented languages ​​such as heredity was not intentionally implemented for design reasons, on the other hand, CLU supports voice features such as exception handling, iterators and parameterized types.

Exception Handling ( exception handling )

→ Main article: Exception Handling

CLU also supports exception handling. It provides a mechanism that is based on the scheduling model exceptions. A function call can terminate itself under different conditions, one of the conditions is the termination of the function with a defined normal return value. Any other value is an exception and the mechanism of CLU is unusual in its treatment of unhandled exceptions. Most mechanisms for exception handling pass this through the tree of function calls in a program code further: If the function in which the exception was raised, they are not treated, they will be passed in the previous tree function. In CLU, however, all unhandled exceptions in so-called " failures " are converted and passed as such. Based on many experiments in other programming languages ​​exceptions are raised with signal and intercepted with except. Since the focus is set to the type design, there is also no way to create enumerated types.

Iterators

→ Main article: iterator

Another important element of the CLU iterators. These denote a pointer to the can iterate over the elements of a list or through the elements of a set. Iterators were inspired by a construct called generator, which was used in the programming language Alphard. The developers of CLU got the idea of ​​generators to know during a conference with the Alphard Group. The concept was interested in the CLU - developers because it solved many problems related to data abstraction. However, they also feared that this construct would be too complex. Nevertheless designed Russ Atkinson, inspired from the generators, the concept of iterators in CLU during a return flight from the conference to Boston. He described this in a so-called " design note" in September 1975. Provide iterators in CLU " black boxes " that the independently of the data on which they are applied, a programming interface. Thus, for example, the iterators for complex numbers and those would be the same for integer data fields. Iterators are now a common language element in many modern programming languages.

Multiple assignment

CLU also supports the multiple assignment, with which more than one variable can stand on the left side of the assignment operator. For example, y would x = y, x has a value exchange between the variables x and y. Functions in the same manner, multiple values, such as x, y, z = return f (t).

Influence on other programming languages

  • Python and Ruby took on different concepts of CLU such as the yield statement, and the multiple assignment.
  • CLU and Ada were the main models for templates in C .
  • The mechanisms of exception handling of CLU influenced modern programming languages ​​such as C and Java.
  • All properties of CLU exist in the heap and the memory management is automatic. This influenced Java in direct form.
  • Python and C # offer the concept of generators which first appeared as iterators in CLU.
  • Lua took over the multiple assignment as well as multiple return of function values ​​of CLU.
194785
de