aboutsummaryrefslogtreecommitdiff
path: root/gcc/ch/chill.brochure
blob: 44301edff92658efa8134d262979b2a5ba3948c2 (plain)
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
              GNU CHILL: A Complete CHILL Implementation

CHILL (the CCITT High Level Language) is a strongly-typed, block
structured language designed primarily for the implementation of large
and complex embedded systems.  Tens of millions of lines of CHILL code
exist, and about 15,000 programmers world-wide use CHILL.  Many
central-office telephone switching systems use CHILL for their control
software.

CHILL was designed to

  - enhance reliability and run time efficiency by means of extensive
    compile time checking;
  - provide sufficient flexibility and power to encompass the required 
    range of applications and to exploit a variety of hardware;
  _ provide facilities that encourage piecewise and modular development
    of large systems;
  - cater to real-time implementations by providing built-in concurrency
    and time supervision primitives;
  - permit the generation of highly efficient object code;
  - facilitate ease of use and a short learning curve.

CHILL is specified in the "Blue Book":
	CCITT High Level Language (CHILL) Recommendation Z.200
	ISO/IEC 9496, Geneva 1989           ISBN 92-61-03801-8

Cygnus Support has completed the first level implementation of the 
GNU CHILL compiler.  Our compiler now supports the core features of
the CHILL language.  Our goal is a fully retargetable, complete
implementation of the Z.200 specification.  The next phase of
implementation will include:

	. a minimal real-time kernel for demonstration use
	. more rigorous type checking
	. retargetable input/output
	. interprocess communications
	. fully compliant exception handling.

The State of the Implementation

The GNU CHILL compiler is in early beta state, performing correct
compilation and execution of correctly coded programs.  Like most
CHILL compilers, the GNU compiler implements a large subset of the
language (as described below).

Since it uses the same compiler back-ends as the GNU C and C++
compilers, GNU CHILL is almost instantly available on all
platforms supported by GNU C, including the following:

	m680xx, i960, i80x86, AMD29K, R3000, R4000, SPARClite,
	Hitachi H8 and SH families, Z8001/2

It has been specifically tested under SunOS on SPARCs and under
SCO Unix on 80386s.

All of the GCC optimizations apply to CHILL as well, including 
function inlining, dead code elimination, jump-to-jump elimination, 
cross-jumping (tail-merging), constant propagation, common 
subexpression elimination, loop-invariant code motion, strength 
reduction, loop unrolling, induction variable elimination, flow
analysis (copy propagation, dead store elimination and elimination
of unreachable code), dataflow-driven instruction scheduling, and
many others.

I/O statements are parsed. The anticipated timeframe for I/O code
generation is Q1 1994.

What's Next

The multi-tasking functions require a small real time kernel.
A free implementation of such a kernel is not yet available.
We plan to offer a productized P-threads interface in Q2 1994.
Other runtime functions involving strings and powersets are 
working.

GDB, the GNU Debugger, has been modified to provide simple CHILL
support.  Some CHILL expressions are not yet recognized.

For those who aren't familiar with CHILL, here's a small but
useful example program:

--
-- Convert binary integers to decimal-coded ASCII string
--
vary1: MODULE

  -- include declarations so we can output the test results
  <> USE_SEIZE_FILE 'chprintf.grt' <>
  SEIZE chprintf;

  -- create a new name for the CHAR array mode
  SYNMODE dec_string = CHAR (6) VARYING;

  int_to_dec_char: PROC (decimal_num INT IN)
                   RETURNS (dec_string);

    DCL neg_num BOOL := FALSE;        -- save sign of parameter
    DCL out_string dec_string;

    IF decimal_num < 0 THEN           -- positive numbers are easier
      decimal_num := -decimal_num;
      neg_num := TRUE;
    FI

    IF decimal_num = 0 THEN
      out_string := '0';                 /* handle zero */
    ELSE
      out_string := '';
      DO WHILE decimal_num /= 0;         -- loop until number is zero
	-- concatenate a new digit in front of the output string
        out_string := CHAR (ABS (decimal_num REM D'10) + H'30) 
		      // out_string;
        decimal_num := decimal_num / D'10;
      OD;
      IF neg_num THEN
	-- prepend a hyphen for numbers < zero
        out_string := '-' // out_string;   -- restore sign
      FI;
    FI;
    RESULT out_string;               -- remember result

    decimal_num := 0;                -- reset for next call
    neg_num := FALSE;
    out_string := '      ';

  END int_to_dec_char;

  /* Try some test cases */
  chprintf (int_to_dec_char (123456), 0);
  chprintf ("^J", 0);

  chprintf (int_to_dec_char (-654321), 0);
  chprintf ("^J", 0);

  chprintf (int_to_dec_char (0), 0);
  chprintf ("^J", 0);

END vary1;

Completeness

GNU CHILL currently supports the following features.  This outline
generally follows the structure of the Blue Book specification:

	CCITT High Level Language (CHILL) Recommendation Z.200
	ISO/IEC 9496, Geneva 1989           ISBN 92-61-03801-8


  Modes (types)
	no DYNAMIC modes yet
	discrete modes
		integer, boolean, character, real
		multiple integer/real precisions (an extension)
	set modes, range modes
	powersets
	references
	  (no ROW modes)	
	procedure modes
	instance modes
	event modes
	buffer modes
	(no input/output modes yet)
	(no timing modes yet)
	composite modes
	  strings
	  arrays
	  structures
	VARYING string/array modes
	(type-checking is not fully rigorous yet)
	forward references

  Expressions
	literals
	tuples
	slices, ranges
	the standard operators

  Actions (statements)
	assignments
	if .. then .. else .. fi
	cases
	do action
	do .. with
	exits
	calls
	results/returns
	gotos
	assertions
	cause exception
	start/stop/continue process

  Input/Output
	(not yet)

  Exception handling
	fully compiled, but exceptions aren't
	generated in all of the required situations

  Time Supervision
	(syntax only)

  Inter-process communications
	delay/delay case actions
	send signal/receive case actions
	send buffer/receive case actions

  Multi-module programming
	Seize/grant processing
	multiple modules per source file


Bibliography

This list is included as an invitation.  We'd appreciate hearing 
of CHILL-related documents (with ISBN if possible) which aren't
described here.  We're particularly interested in getting copies
of other conference Proceedings.

	CCITT High Level Language (CHILL) Recommendation Z.200
	ISO/IEC 9496, Geneva 1989                ISBN 92-61-03801-8
	(The "blue book". The formal language definition; mostly a
	 language-lawyer's document, but more readable than most.)

	Study Group X - Report R 34
	This is the May 1992 revision of Z.200.

	An Analytic Description of CHILL, the CCITT high-level
	language, Branquart, Louis & Wodon, Springer-Verlag 1981
                                                 ISBN 3-540-11196-4

	CHILL User's Manual
	CCITT, Geneva 1986                       ISBN 92-61-02601-X
	(Most readable, but doesn't cover the whole language).  

	Introduction to CHILL
	CCITT, Geneva 1983                       ISBN 92-61-017771-1

	CHILL CCITT High Level Language
	Proceedings of the 5th CHILL Conference
	North-Holland, 1991                      ISBN 0 444 88904 3

	Introduction to the CHILL programming Language
	TELEBRAS, Campinas, Brazil 1990

	CHILL: A Self-Instruction Manual
	Telecommunication Institute - PITTC
	Available from KVATRO A/S, N-7005 Trondheim, Norway
	Phone: +47 7 52 00 90
	(Great discussion of novelty.)

Some of these documents are available from Global Engineering
Documents, in Irvine, CA, USA.  +1 714 261 1455.