-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathREADME
133 lines (88 loc) · 6.48 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
+-----------------------------------------------------------------------------------------------------+
| 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.