OSDN Git Service

[pf3gnuchains/gcc-fork.git] / gcc / ch / chill.brochure
1               GNU CHILL: A Complete CHILL Implementation
2
3 CHILL (the CCITT High Level Language) is a strongly-typed, block
4 structured language designed primarily for the implementation of large
5 and complex embedded systems.  Tens of millions of lines of CHILL code
6 exist, and about 15,000 programmers world-wide use CHILL.  Many
7 central-office telephone switching systems use CHILL for their control
8 software.
9
10 CHILL was designed to
11
12   - enhance reliability and run time efficiency by means of extensive
13     compile time checking;
14   - provide sufficient flexibility and power to encompass the required 
15     range of applications and to exploit a variety of hardware;
16   _ provide facilities that encourage piecewise and modular development
17     of large systems;
18   - cater to real-time implementations by providing built-in concurrency
19     and time supervision primitives;
20   - permit the generation of highly efficient object code;
21   - facilitate ease of use and a short learning curve.
22
23 CHILL is specified in the "Blue Book":
24         CCITT High Level Language (CHILL) Recommendation Z.200
25         ISO/IEC 9496, Geneva 1989           ISBN 92-61-03801-8
26
27 Cygnus Support has completed the first level implementation of the 
28 GNU CHILL compiler.  Our compiler now supports the core features of
29 the CHILL language.  Our goal is a fully retargetable, complete
30 implementation of the Z.200 specification.  The next phase of
31 implementation will include:
32
33         . a minimal real-time kernel for demonstration use
34         . more rigorous type checking
35         . retargetable input/output
36         . interprocess communications
37         . fully compliant exception handling.
38
39 The State of the Implementation
40
41 The GNU CHILL compiler is in early beta state, performing correct
42 compilation and execution of correctly coded programs.  Like most
43 CHILL compilers, the GNU compiler implements a large subset of the
44 language (as described below).
45
46 Since it uses the same compiler back-ends as the GNU C and C++
47 compilers, GNU CHILL is almost instantly available on all
48 platforms supported by GNU C, including the following:
49
50         m680xx, i960, i80x86, AMD29K, R3000, R4000, SPARClite,
51         Hitachi H8 and SH families, Z8001/2
52
53 It has been specifically tested under SunOS on SPARCs and under
54 SCO Unix on 80386s.
55
56 All of the GCC optimizations apply to CHILL as well, including 
57 function inlining, dead code elimination, jump-to-jump elimination, 
58 cross-jumping (tail-merging), constant propagation, common 
59 subexpression elimination, loop-invariant code motion, strength 
60 reduction, loop unrolling, induction variable elimination, flow
61 analysis (copy propagation, dead store elimination and elimination
62 of unreachable code), dataflow-driven instruction scheduling, and
63 many others.
64
65 I/O statements are parsed. The anticipated timeframe for I/O code
66 generation is Q1 1994.
67
68 What's Next
69
70 The multi-tasking functions require a small real time kernel.
71 A free implementation of such a kernel is not yet available.
72 We plan to offer a productized P-threads interface in Q2 1994.
73 Other runtime functions involving strings and powersets are 
74 working.
75
76 GDB, the GNU Debugger, has been modified to provide simple CHILL
77 support.  Some CHILL expressions are not yet recognized.
78 \f
79 For those who aren't familiar with CHILL, here's a small but
80 useful example program:
81
82 --
83 -- Convert binary integers to decimal-coded ASCII string
84 --
85 vary1: MODULE
86
87   -- include declarations so we can output the test results
88   <> USE_SEIZE_FILE 'chprintf.grt' <>
89   SEIZE chprintf;
90
91   -- create a new name for the CHAR array mode
92   SYNMODE dec_string = CHAR (6) VARYING;
93
94   int_to_dec_char: PROC (decimal_num INT IN)
95                    RETURNS (dec_string);
96
97     DCL neg_num BOOL := FALSE;        -- save sign of parameter
98     DCL out_string dec_string;
99
100     IF decimal_num < 0 THEN           -- positive numbers are easier
101       decimal_num := -decimal_num;
102       neg_num := TRUE;
103     FI
104
105     IF decimal_num = 0 THEN
106       out_string := '0';                 /* handle zero */
107     ELSE
108       out_string := '';
109       DO WHILE decimal_num /= 0;         -- loop until number is zero
110         -- concatenate a new digit in front of the output string
111         out_string := CHAR (ABS (decimal_num REM D'10) + H'30) 
112                       // out_string;
113         decimal_num := decimal_num / D'10;
114       OD;
115       IF neg_num THEN
116         -- prepend a hyphen for numbers < zero
117         out_string := '-' // out_string;   -- restore sign
118       FI;
119     FI;
120     RESULT out_string;               -- remember result
121
122     decimal_num := 0;                -- reset for next call
123     neg_num := FALSE;
124     out_string := '      ';
125
126   END int_to_dec_char;
127
128   /* Try some test cases */
129   chprintf (int_to_dec_char (123456), 0);
130   chprintf ("^J", 0);
131
132   chprintf (int_to_dec_char (-654321), 0);
133   chprintf ("^J", 0);
134
135   chprintf (int_to_dec_char (0), 0);
136   chprintf ("^J", 0);
137
138 END vary1;
139 \f
140 Completeness
141
142 GNU CHILL currently supports the following features.  This outline
143 generally follows the structure of the Blue Book specification:
144
145         CCITT High Level Language (CHILL) Recommendation Z.200
146         ISO/IEC 9496, Geneva 1989           ISBN 92-61-03801-8
147
148
149   Modes (types)
150         no DYNAMIC modes yet
151         discrete modes
152                 integer, boolean, character, real
153                 multiple integer/real precisions (an extension)
154         set modes, range modes
155         powersets
156         references
157           (no ROW modes)        
158         procedure modes
159         instance modes
160         event modes
161         buffer modes
162         (no input/output modes yet)
163         (no timing modes yet)
164         composite modes
165           strings
166           arrays
167           structures
168         VARYING string/array modes
169         (type-checking is not fully rigorous yet)
170         forward references
171
172   Expressions
173         literals
174         tuples
175         slices, ranges
176         the standard operators
177
178   Actions (statements)
179         assignments
180         if .. then .. else .. fi
181         cases
182         do action
183         do .. with
184         exits
185         calls
186         results/returns
187         gotos
188         assertions
189         cause exception
190         start/stop/continue process
191
192   Input/Output
193         (not yet)
194
195   Exception handling
196         fully compiled, but exceptions aren't
197         generated in all of the required situations
198
199   Time Supervision
200         (syntax only)
201
202   Inter-process communications
203         delay/delay case actions
204         send signal/receive case actions
205         send buffer/receive case actions
206
207   Multi-module programming
208         Seize/grant processing
209         multiple modules per source file
210
211
212 Bibliography
213
214 This list is included as an invitation.  We'd appreciate hearing 
215 of CHILL-related documents (with ISBN if possible) which aren't
216 described here.  We're particularly interested in getting copies
217 of other conference Proceedings.
218
219         CCITT High Level Language (CHILL) Recommendation Z.200
220         ISO/IEC 9496, Geneva 1989                ISBN 92-61-03801-8
221         (The "blue book". The formal language definition; mostly a
222          language-lawyer's document, but more readable than most.)
223
224         Study Group X - Report R 34
225         This is the May 1992 revision of Z.200.
226
227         An Analytic Description of CHILL, the CCITT high-level
228         language, Branquart, Louis & Wodon, Springer-Verlag 1981
229                                                  ISBN 3-540-11196-4
230
231         CHILL User's Manual
232         CCITT, Geneva 1986                       ISBN 92-61-02601-X
233         (Most readable, but doesn't cover the whole language).  
234
235         Introduction to CHILL
236         CCITT, Geneva 1983                       ISBN 92-61-017771-1
237
238         CHILL CCITT High Level Language
239         Proceedings of the 5th CHILL Conference
240         North-Holland, 1991                      ISBN 0 444 88904 3
241
242         Introduction to the CHILL programming Language
243         TELEBRAS, Campinas, Brazil 1990
244
245         CHILL: A Self-Instruction Manual
246         Telecommunication Institute - PITTC
247         Available from KVATRO A/S, N-7005 Trondheim, Norway
248         Phone: +47 7 52 00 90
249         (Great discussion of novelty.)
250
251 Some of these documents are available from Global Engineering
252 Documents, in Irvine, CA, USA.  +1 714 261 1455.