Claire (programming Language)
   HOME

TheInfoList



OR:

Claire is a high-level
functional Functional may refer to: * Movements in architecture: ** Functionalism (architecture) ** Form follows function * Functional group, combination of atoms within molecules * Medical conditions without currently visible organic basis: ** Functional sy ...
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 pro ...
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 ...
with rule processing abilities. It was designed by
Yves Caseau Yves may refer to: * Yves, Charente-Maritime, a commune of the Charente-Maritime department in France * Yves (given name), including a list of people with the name * Yves (single album), ''Yves'' (single album), a single album by Loona * Yves (fil ...
at
Bouygues Bouygues S.A. () is a French industrial group headquartered in the 8th arrondissement of Paris, 8th arrondissement of Paris, France. Bouygues is listed on the Euronext, Euronext Paris exchange and is a blue chip (stock market), blue chip in the C ...
' e-Lab research laboratory, and received its final definition in 2004. Claire provides: *a simple object system with parametric classes and
methods Method ( grc, μέθοδος, methodos) literally means a pursuit of knowledge, investigation, mode of prosecuting such inquiry, or system. In recent centuries it more often means a prescribed process for completing a task. It may refer to: *Scien ...
* polymorphic and parametric functional programming * production rules triggered by
events Event may refer to: Gatherings of people * Ceremony, an event of ritual significance, performed on a special occasion * Convention (meeting), a gathering of individuals engaged in some common interest * Event management, the organization of ev ...
*versioned snapshots of the state of the whole system, or any part, supporting
rollback In political science, rollback is the strategy of forcing a change in the major policies of a state, usually by replacing its ruling regime. It contrasts with containment, which means preventing the expansion of that state; and with détente, w ...
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 In linguistics, syntax () is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure ( constituency) ...
for set-based programming *an expressive set-based type system allowing both
second-order Second-order may refer to: Mathematics * Second order approximation, an approximation that includes quadratic terms * Second-order arithmetic, an axiomatization allowing quantification of sets of numbers * Second-order differential equation, a di ...
static Static may refer to: Places *Static Nunatak, a nunatak in Antarctica United States * Static, Kentucky and Tennessee *Static Peak, a mountain in Wyoming **Static Peak Divide, a mountain pass near the peak Science and technology Physics *Static el ...
and
dynamic Dynamics (from Greek δυναμικός ''dynamikos'' "powerful", from δύναμις ''dynamis'' "power") or dynamic may refer to: Physics and engineering * Dynamics (mechanics) ** Aerodynamics, the study of the motion of air ** Analytical dyna ...
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 o ...
, 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 exam ...
, 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 c ...
requiring sophisticated data modeling, 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 services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
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++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
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 List ...
: 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 programming language, general-purpose, multi-paradigm programming language which extends the Caml dialect of ML (programming language), ML with object-oriented programming, object-oriented ...
, 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 Backtracking is a class of algorithms for finding solutions to some computational problems, notably constraint satisfaction problems, that incrementally builds candidates to the solutions, and abandons a candidate ("backtracks") as soon as it d ...
, as found in
logic programming Logic programming is a programming paradigm which is largely based on formal logic. Any program written in a logic programming language is a set of sentences in logical form, expressing facts and rules about some problem domain. Major logic prog ...
, 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 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 Deductive reasoning is the mental process of drawing deductive inferences. An inference is deductively valid if its conclusion follows logically from its premises, i.e. if it is impossible for the premises to be true and the conclusion to be false ...
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, 8th arrondissement of Paris, France. Bouygues is listed on the Euronext, Euronext Paris exchange and is a blue chip (stock market), blue chip in the C ...
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, regarded him ...
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