Why

1. Rationale


CLAIRE is a high-level functional and object-oriented language with rule processing capabilities. It is intended to allow the programmer to express complex algorithms with fewer lines and in an elegant and readable manner.


To provide a high degree of expressivity, CLAIRE uses

· a rich type system including type intervals and second-order types (with static/dynamic typing),

· parametric classes and methods,

· propagation rules based on events,

· dynamic versioning that supports easy exploration of search spaces.

To achieve its goal of readability, CLAIRE uses

· set-based programming with an intuitive syntax,

· simple-minded object-oriented programming,

· truly polymorphic and parametric functional programming,

· an entity-relation approach with explicit relations, inverses and unknown values.

 

CLAIRE was designed for advanced applications that involve complex data modeling, rule processing and problem solving. claire was first meant to be used in a C++ environment, either as a satellite (linking claire programs to C++ programs is straightforward) or as an upper layer (importing C++ programs is also easy). The CLAIRE 4.0 release has substituted Go to C++ to increase the robustness. The key set of features that distinguishes CLAIRE from other programming languages has been dictated by our experience in solving complex optimization problems. Of particular interest are two features that distinguish CLAIRE from procedural languages such as C++, Go or Java:

CLAIRE provides automatic memory allocation/de-allocation. Also, set-oriented programming is much easier with a set-oriented language like claire than with libraries. CLAIRE is close to 30 years old, but this new 4.1.0 release reaches a new level of robustness and performance. Appendix C, CLAIRE’s user guide, provides a release history that details the changes from CLAIRE 2.0 to 3.0 and 3.0 to 4.0, and gives some insights about earlier versions.

CLAIRE is a high-level language that can be used as a complete development language, since it is a general purpose language, but also as a pre-processor to Go, since a claire program can be naturally translated into a Go program (We now use Go as our target language of choice, but CLAIRE’s compiler could be extended to produce Java as it did in the past). CLAIRE is a set-oriented language in the sense that sets are first-class objects, typing is based on sets and control structures for manipulating sets are parts of the language kernel. Similarly, CLAIRE makes manipulating lists easy since lists are also first-class objects. Sets and lists may be typed to provide a more robust and expressive framework. claire can also be seen as a functional programming language, with full support for lambda abstraction, where functions can be passed as parameters and returned as values, and with powerful parametric polymorphism.

CLAIRE is an object-oriented language with single inheritance. As in SMALLTALK, everything that exists in claire is an object. Each object belongs to a unique class and has a unique identity. Classes are the corner stones of the language, from which methods (procedures), slots and tables (relations) are defined. Classes belong themselves to a single inheritance hierarchy. However, classes may be grouped using set union operators, and these unions may be used in most places where a class would be used, which offers an alternative to multiple inheritance. In a way similar to Modula-3, claire is a modular language that provides recursively embedded modules with associated namespaces. Module decomposition can either be parallel to the class organization (mimicking C++ encapsulation) or orthogonal (e.g., encapsulating one service among multiple classes). CLAIRE module approach is a close match to the concept of “packages” in Go.

CLAIRE is a typed language, with full inclusion polymorphism. This implies that one can use claire with a variety of type disciplines ranging from weak typing in a manner that is close to SMALLTALK up to a more rigid manner close to C++. This flexibility is useful to capture programming styles ranging from prototyping to production code development. The more typing information available, the more claire's compiler will behave like a statically typed language compiler. This is achieved with a rich type system, based on sets, that goes beyond types in C++. This type system provides functional types (second-order types) similar to ML, parametric types associated to parametric classes and many useful type constructors such as unions or intervals. Therefore, the same type system supports the naive user who simply wishes to use classes as types and the utility library developer who needs a powerful interface description language.


2. Performance

The following table shows the performance of CLAIRE vs a few common programming languages, using simple or classical test cases.

Last edited: December 2023.
Version : 4.10
Go version : 1.21.5

This table is the best explanation of CLAIRE's why:

A few caveats are necessary: