Skip to content

ycaseau/CLAIRE4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

+-----------------------------------------------------------------------------------------------------+
|   CLAIRE4                                                                                           |
|   README                                                                                            |
|   version 4.1.14 - 1/3/2025                                                                         |
+-----------------------------------------------------------------------------------------------------+


1. Content
==========


This repository contains the code for CLAIRE4, the new release of the CLAIRE programming language based on Go.
CLAIRE :   https://en.wikipedia.org/wiki/Claire_(programming_language)
CLAIRE4:   https://sites.google.com/view/claire4/home


CLAIRE is 28 years old, but CLAIRE 4.0 started in September 2020.
The current version is in beta-status. 


2. Organization
===============

The root of this repository contains
- this README
- an InstallationGuide
- an init.cl file that you may customize to run some of the test files

This repository has the following directories

- meta:     the reflexive definition of the interpreter (CLAIRE in CLAIRE)
- compile:  the relexive definition of the compiler (CLAIRE files)
- javascript : the CLAIRE-to-Javascript diet compiler (prototype)
- src:      Go code for building CLAIRE

      - all subdirectories but Kernel are generated by the CLAIRE compiler
      - Kernel contains the go source code for "microCLAIRE" : the core of the interpreter

- test:    test files for CLAIRE

       - perf :     a few performance benchmarks
       - nonreg:    old test files accumulated over the years to avoid regressions
       - rules:     classical rule-based examples
       - toys :     a few toy examples

- docs : a few related documents about CLAIRE including the CLAIRE user guide and two old presentation about CLAIRE.


3. Terms of use
===============

CLAIRE has been built by a team as an open-source project: you are free to use and redistribute the code that is found in the GitHub directory
DISCLAIMER: THE CLAIRE SOFTWARE IS PROVIDED AS IS AND WITHOUT ANY WARRANTY, INCLUDING, WITHOUT LIMITATION,
THE IMPLIED WARRANTIES OF MERCHANTABILTY AND FITNESS FOR A PARTICULAR PURPOSE.


4. Why Claire ?
===============

The two presentations in the /docs directory will tell you more, but here is a short overview.

4.1 Why yet another language ?
------------------------------

4.1.1 CLAIRE is a functional object-oriented language
- CLAIRE is a full-fledged object-oriented language that inherits from SMALLTALK.
- CLAIRE is a functional language that inherits from LISP. Functional languages have regained popularity in the last 10 years, so
- CLAIRE inherits from CECILE - a specification language from the early 90s - with the aim of concision and preciseness. CLAIRE offers a higher level of abstraction than most object-oriented language

4.1.2 CLAIRE is both statically & dynamically typed with a rich type system
- CLAIRE is a fully polymorphic languages where methods may be overloaded in multiple ways, extending traditional single-inheritance class polymorphism
- CLAIRE is dynamically typed for fast prototyping and more expressive power  …A very large part of CLAIRE code fragments can be statically typed …
- CLAIRE supports second-order types

4.1.3 CLAIRE includes a number of features that makes it easier to write complex algorithms
- Set-based programming. This was more original 30 years ago than it is now, but sets and set-based expressions are first-class citizen of the CLAIRE language
- Rule-based programming. Although “production rules” have lost their appeal,
- Search tree primitives : CLAIRE provides “hypothetical reasoning”, that is the ability to create choice points and backtrack to a previous state.


4.2 Claire vs other interpreted language
---------------------------------------

4.2.1 Fast interpreter
CLAIRE4 is much faster than the previous CLAIRE 3.5 version. CLAIRE is now faster than Python (on average, based on a the set of performance benchmark that is included on GitHub)
The included Excel files gives an overview of the performance tests that are included in test/perf
This is ongoing work, the performance will stabilize once CLAIRE 4.0 reaches the beta status.

4.2.2 Fast compiler
CLAIRE 4.0 is also MUCH faster than CLAIRE 3.5 as a compiler.
Based on the preliminary results, CLAIRE is approximately twice slower than Go, C++ or Java, based on a weighted distribution of the performance benchmarks.

4.2.3 CLAIRE is a hybrid interpreted/compiled language: thanks to the reflective nature of CLAIRE (everything is reflexively described and is inspectable as such).

4.2.4 CLAIRE4 is good for the planet !
As most compiled language, runing a CLAIRE program consumes less energy and produces less CO2 than other interpreted high-level languages.


4.3 Claire vs Go
----------------

4.3.1 CLAIRE has interesting features that are missing from GO
- CLAIRE is interpreted 
- it supports "true" object-oriented programming
- it provides Full polymorphism
- Exception handling

4.3.2 microCLAIRE (the Go Kernel) has its own merit for anyone who plans to write an interpreter:
- Fast reflective addition to objects and functions (much faster than the mechanism provided by Go)
- Generic set objects (something that should be improved in the future when comparing with Java)
- Fast buffered character I/O


5. NEW in v4.1.14 
==================

v4.1.14 benefits from a lots of typo fixes (thanks musvaage) and a few bug fixes.
The major improvement is that CLAIRE 4 is now tested on macOS, windows AND Linux (Ubuntu)

Visit the web site https://sites.google.com/view/claire4/home to find more about CLAIRE's versions


6. Why download the CLAIRE 4 Interpreter ?
==========================================

Although CLAIRE is a compiled language, it is quite useful to use it in its simpler form of an interpreted language:

great for fast prototyping  (REPL), as any interpreted language such as Python, LISP or Clojure.
REPL stands for Read-Eval-Print-Loop, together with the introspective capabilities of interpreted language,  it supports using the langguage for querying and debugging the system that you build.

As a stand alone file, the CLAIRE4 interpreter is very easy to install  and it does not hit the wall of administrative rights for compiling or installing.

CLAIRE is a very powerful expressive language, with first-class citizen support for sets, hypothetical reasonning or high order relations, in addition to being an object-oriented functional programming language.

About

CLAIRE programming language Version 4 (2021)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages