forked from ycaseau/CLAIRE4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
117 lines (71 loc) · 5.04 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
+-----------------------------------------------------------------------------------------------------+
| CLAIRE4 |
| README |
| version 4.0.4 - 1/2/2022 |
+-----------------------------------------------------------------------------------------------------+
1. Content
==========
This repository contains the code for CLAIRE4, the new release of the CLAIRE programming language based on Go.
https://en.wikipedia.org/wiki/Claire_(programming_language)
CLAIRE is 28 years old, but CLAIRE 4.0 started in September 2020.
The current version is in alpha-status. Beta status is expected this summer of 2022
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)
- 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
- 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.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