Claire is a high-level
functional and
object-oriented
Object-oriented programming (OOP) is a programming paradigm based on the concept of " objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of ...
programming language
A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language.
The description of a programming l ...
with
rule processing abilities. It was designed by
Yves Caseau at
Bouygues
Bouygues S.A. () is a French industrial group headquartered in the 8th arrondissement of Paris, France. Bouygues is listed on the Euronext Paris exchange and is a blue chip in the CAC 40 stock market index. The company was founded in 1952 by ...
' e-Lab research laboratory, and received its final definition in 2004.
Claire provides:
*a simple object system with
parametric classes and
methods
*
polymorphic and parametric functional programming
*
production rules triggered by
events
*versioned snapshots of the state of the whole system, or any part, supporting
rollback and easy exploration of
search spaces
*explicit relations between entities; for example, two entities might be declared inverses of one another
*
first-class sets with convenient
syntax for set-based programming
*an expressive set-based type system allowing both
second-order static and
dynamic typing
Claire's
reference implementation
In the software development process, a reference implementation (or, less frequently, sample implementation or model implementation) is a program that implements all requirements from a corresponding specification. The reference implementation ...
, consisting of an interpreter and compiler, was fully open-sourced with the release of version 3.3.46 in February 2009. Another implementation, WebClaire, is commercially supported.
Overview
Claire is a
general-purpose programming language
In computer software, a general-purpose programming language (GPL) is a programming language for building software in a wide variety of application domains. Conversely, a domain-specific programming language is used within a specific area. For ex ...
, best suited to
application software
Application may refer to:
Mathematics and computing
* Application software, computer software designed to help the user to perform specific tasks
** Application layer, an abstraction layer that specifies protocols and interface methods used in a ...
requiring sophisticated
data modeling
Data modeling in software engineering is the process of creating a data model for an information system by applying certain formal techniques.
Overview
Data modeling is a process used to define and analyze data requirements needed to su ...
, rule processing or problem solving. WebClaire adds extensions for fuller integration with the
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
and for programming
web application
A web application (or web app) is application software that is accessed using a web browser. Web applications are delivered on the World Wide Web to users with an active network connection.
History
In earlier computing models like client-serve ...
s.
Though Claire can be used for complete projects, it is designed to integrate smoothly with
C++ or
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
: Claire programs may include C++ or Java code, and Claire code may be translated into C++ or Java for use in C++ or Java projects.
The key set of features that distinguishes Claire from other programming languages has been dictated by experience in solving complex optimization problems. Two features not found in other mixed functional/object-oriented languages, such as
OCaml
OCaml ( , formerly Objective Caml) is a general-purpose, multi-paradigm programming language which extends the Caml dialect of ML with object-oriented features. OCaml was created in 1996 by Xavier Leroy, Jérôme Vouillon, Damien Doligez, D ...
,
Scala and
F#, are ''versioning'' and ''production rules''.
Versions can be viewed as a stack of snapshots of some part of the system, which can be made as large (for expressiveness) or small (for efficiency) as necessary. Creation and roll-back of versions permit
backtracking, as found in
logic programming
Logic programming is a programming paradigm which is largely based on formal logic
Logic is the study of correct reasoning. It includes both formal and informal logic. Formal logic is the science of deductively valid inferences or of log ...
, though Claire's backtracking may cover any user-defined structure rather than just a set of logic variables.
A production rule in Claire is composed of an event, a condition and a response to be evaluated if the condition is satisfied. An event may be any change in an object's slot or the instantiation of a class, and a response may itself set off further events. Such production rules are especially useful in describing reactive algorithms, such as those for
constraint
Constraint may refer to:
* Constraint (computer-aided design), a demarcation of geometrical characteristics between two or more entities or solid modeling bodies
* Constraint (mathematics), a condition of an optimization problem that the solution ...
propagation.
Claire was created as a successor to LAURE, an expressive but complex language designed by Caseau in the 1980s that combined many paradigms. Claire was intended to be both easier to learn than its predecessor and to impose no performance overhead relative to C++; it is thus a much smaller language, omitting features such as
constraints and
deductive rules, and is closer to
C in spirit and syntax. Its main users in industry have been the
Bouygues
Bouygues S.A. () is a French industrial group headquartered in the 8th arrondissement of Paris, France. Bouygues is listed on the Euronext Paris exchange and is a blue chip in the CAC 40 stock market index. The company was founded in 1952 by ...
and
Thales
Thales of Miletus ( ; grc-gre, Θαλῆς; ) was a Greek mathematician, astronomer, statesman, and pre-Socratic philosopher from Miletus in Ionia, Asia Minor. He was one of the Seven Sages of Greece. Many, most notably Aristotle, regard ...
groups.
Example
A function to compute the ''n''th Fibonacci number:
fib(n:integer) : integer
-> (if (n < 2) 1
else fib(n - 1) + fib(n - 2))
External links
*
*The latest version of Claire and its documentation are available from the "claireprogramminglanguage" Yahoo! group, which requires free registration.
Documentation for Claire and WebClaire.
Introduction to the CLAIRE Programming Language Version 3.2 by Yves Caseau and François Laburthe.
CLAIRE: Combining Sets, Search and Rules to Better Express Algorithms{dead link, date=August 2017 , bot=InternetArchiveBot , fix-attempted=yes " by Yves Caseau, François-Xavier Josset and François Laburthe (2002). A 26-page overview, intended for an academic audience, with benchmarks.
Experimental programming languages
Functional languages
Multi-paradigm programming languages
Object-oriented programming languages