1
CLC-INTERCAL 0.05 is a major rewrite of the Perl INTERCAL compiler. I still
2
consider it alpha quality, but I've redesigned some parts of the compiler
3
and improved other parts, and I feel confident that there'll be a beta soon.
5
CLC-INTERCAL is designed to be almost compatible with the original (Princeton
6
1972) compiler. See the POD included in Language/INTERCAL.pod for a discussion
7
of extensions and limitations to the language, or consult the on-line reference at
9
http://www.assurdo.com/INTERNCAL/reference/
11
The name CLC-INTERCAL stands for "INTERCAL compiler in Perl".
13
To install the compiler, obtain the tar file (CLC-INTERCAL-x.xx.tar.gz,
14
for appropriate values of x.xx, preferably x.xx >= 0.05) and unpack it
15
somewhere. Then change directory to that somewhere and type:
3
"human beings are given free will in order to choose between
4
insanity on the one hand and lunacy on the other"
13
0 - Introduction to CLC-INTERCAL pre-pre-escape 1.-94.-4
14
1 - What has changed since CLC-INTERCAL 0.05
15
2 - How to install this escape
16
3 - How to modify the compiler(s)
24
A few years ago, I had, for several reasons, decided to completely GIVE UP
25
working on INTERCAL or, if you prefer, ABSTAIN FROM developing CLC-INTERCAL
28
Of course, the flesh is weak and here I am at it again. It just so happens
29
that I am using the "compiler compiler compiler compiler" for a serious
30
project, so I am going to develop it further.
33
- - ------------ -- ------------ -------------- --------
34
0 - Introduction to CLC-INTERCAL pre-pre-escape 1.-94.-4
35
- - ------------ -- ------------ -------------- --------
37
It has been decided during the development of CLC-INTERCAL 0.06 that there
38
would be no further releases of CLC-INTERCAL. However, the compiler has
39
been left unattended on an FTP server, and appears to have escaped. For this
40
reason, we refer to this as an "escape" rather than a "release".
42
Additionally, development of CLC-INTERCAL version 0 has effectively stopped
43
before the escape of 0.06; a new versioning scheme has been introduced for
44
CLC-INTERCAL version 1. The main points to note are:
46
* The term "version" has been replaced by "perversion" for correctness
47
* The perversion number consists of a floating-point number with
48
independent signs for the integer and fractional part. Negative
49
fractions indicate pre-escapes (so 1.-94 means "94 pre-escapes to
50
go before 1.00". Or you can just add the numbers together and get
51
0.06, which is entirely a coincidence since 0.06 is not being
53
* The fractional part of a perversion number can be integer or floating
54
point, with a similar meaning for the parts. The current pre-escape is
55
1.-94.-4 which means "4 pre-pre-escapes to go before pre-escape
58
The fact that the compiler has escaped does not allow you to use without
59
reference to its licence: see the end of this document or the file COPYING.
61
Since this is a pre-pre-escape, there are parts which are unimplemented
62
or partially implemented. The file "MISSING" describes what is missing.
63
There might also parts which are implemented but are intended to be left
64
implemented: these will be removed from the final escapes.
67
- - ---- --- ------- ----- ------------ ----
68
1 - What has changed since CLC-INTERCAL 0.05
69
- - ---- --- ------- ----- ------------ ----
71
Just about everything. See the file "Changes" for a complete list, or see
72
the following executive summary.
74
The code is a complete rewrite. The "CREATE" statement which was documented
75
but not implemented has now been implemented (in a different form) and not
76
documented. This means that the compiler only needs to know about one
77
statement, "CREATE", and everything else can be created on-the-fly. This is
78
why the compiler itself and the various compatibility modules now include
79
INTERCAL source code consisting almost exclusively of "CREATE" statements.
81
This made it a lot easier to extend the language by specifying new features
82
in INTERCAL instead of Perl. Most statements have been modified to allow
83
creation of quantum bits. For example, it is possible to create 16 quantum
84
bits in one operation by assigning to a register while not assigning to it.
85
It goes without saying that the practice is not recommended if you don't
86
actually possess a quantum computer.
88
A new statement, "NEXT FROM", combines all the advantages of "COME FROM" and
89
"NEXT". It has been implemented essentially to provide a system call
90
interface, where the operating system is supposed to have a "NEXT FROM"
91
lurking in its darkest corner. See the last entry in the file "Changes"
92
for a complete description of the system call interface. Since this is
93
INTERCAL, the syscall interface is entirely system independent. System
94
dependent system calls are not supported.
96
All old programs should work unchanged (modulo the unimplemented parts, but
97
this is due to change as the perversion number progresses towards 1.00).
98
Programs intended for different compilers can also be compiled by selecting
99
a different compiler object (for example, "ick.iacc" provides compatibility
100
with the C-INTERCAL compiler "ick", and "1972.iacc" with the original
101
Princeton compiler). All these compiler object must be first compiled using
102
"iacc.iacc", the INTERCAL Astonishing Compiler Compiler, which is also used to
103
compile itself before compiling other compilers. A pre-compiled version is
104
provided in this escape otherwise you'll never get started.
106
The command-line compiler "oo, ick" and the inline module "Language::INTERCAL"
107
are not currently provided. They have been replaced by the compiler "sick"
108
and the module "Language::INTERCAL::Sick" respectively, which have a rather
109
different usage. A compatibility "oo, ick" and "Language::INTERCAL" is
110
intended to appear in a future pre-escape, and certainly before the escape.
112
The former "on-line reference", has been included in the distribution in
113
directory doc/html; it has been adapted for CLC-INTERCAL 1.-94; however
114
some new features might be still undocumented or underdocumented.
117
- - --- -- ------- ---- ------
118
2 - How to install this escape
119
- - --- -- ------- ---- ------
121
To unpack the distribution you need the following:
123
* A command interpreter compatible with the Bourne shell
125
* optionally, gzip and/or bzip2
127
If necessary, uncompress the distribution:
129
gzip -d CLC-INTERCAL-1.-94.-4.ddsh.gz
133
bzip2 -d CLC-INTERCAL-1.-94.-4.ddsh.bz2
135
Unpack the distribution:
137
sh CLC-INTERCAL-1.-94.-4.ddsh
141
cd CLC-INTERCAL-1.-94.-4
148
See if everything works:
22
The third step might take a long time, depending on your CPU and memory speeds.
23
It performs about 2260 tests, checking every part of the compiler and repeating
24
tests up to six times to make sure you get consistent results when giving
25
different options to the compiler. Have a cup of coffee while it runs.
27
If you are running a proper operating system, you might need superusers
28
privileges for the last step, depending on who owns the Perl library
31
If any test program fails, please let me know (email to <lunatic@assurdo.com>
32
would be the best way). The name of the test program(s) which failed, the list
33
of test they reported as failed, what standard output produced, and any
34
information you might think relevant will be useful.
36
To consult the extensive documentation which comes with the compiler you can
39
perldoc Language::INTERCAL
41
Version 0.04 of the compiler used modified EBCDIC for all input (including the
42
source code of INTERCAL programs), but could be persuaded to use ASCII or
43
extended Baudot. Version 0.05 will accept input in modified EBCDIC, extended
44
Baudot, and ASCII, and will guess the character set used for each source file.
45
Output can also be in any installed character set, defaulting to ASCII.
46
Internally, the programs generated by the compiler will use extended Baudot.
47
The two non-ASCII character sets are fully documented using the commands:
49
perldoc Charset::EBCDIC
50
perldoc Charset::Baudot
52
The test scripts (in directory t) show simple INTERCAL programs which can
53
be very confusing^H^H^H^H^H^H^H^Huseful to the learner. Other examples can
54
be found in the directory eg.
56
Before I stop typing and go back to extending INTERCAL even further for the
57
next version, I would like to thank all the people who post on the newsgroup
58
and the mailing list for the steady supply of ideas, insane or otherwise.
156
It is possible that, by the time you read this, we have provided two
157
alternative versions of some modules: pure Perl and Perl-with-C. The latter
158
is likely to be better in some way (speed, size), otherwise we would not
159
provide it. If Makefile.PL finds that alternative versions are available,
160
it will ask which one you want to install. In general, the pure Perl versions
161
will work as long as your Perl installation works; the Perl-with-C should
162
work but might break because your C compiler is not the same as mine, or
163
simply because it's C and it's more self-obfuscating than INTERCAL. If it
164
does not work, install the pure Perl version. If that does not work either,
165
you have found an unimplemented feature. Congratulations.
167
The "make" and "make test" will take some time: "make" will run IACC (the
168
INTERCAL Astonishing Compiler Compiler) to build itself and all the other
169
compilers, and this is not quite a quick job. The "make test" will test
170
all parts of the compiler, including the Virual Machine, the Quantum
171
Emulator and the Just-Too-Late compiler. Have a coffee break, or read the
172
source code and try to figure out how it works. If you can figure out how
173
it works, please tell me, because I cannot.
176
- - --- -- ------ --- -----------
177
3 - How to modify the compiler(s)
178
- - --- -- ------ --- -----------
180
The compiler and the compiler compiler are currently underdocumented
181
(which means that there is no documentation whatsoever). If you feel
182
the urge to modify the compiler itself, ignore the Perl runtime library
183
and edit the file "sick.iacc", which would have been installed somewhere
184
system dependent. If you have write permission to this system dependent
185
location and your command interpreter is compatible with the Bourne Shell,
186
you can locate the file and edit it by simply typing (all in one line, we
187
show it in separate lines for readability):
189
sh -c '${EDITOR-vi} `sick -vo/dev/null sick.iacc 2>&1 |
190
head -1 | sed -e "s/\.\.\. \[.*$//"`'
192
If you would rather not type the above, or you have no write permission to
193
the appropriate place (or if you have an inferior command interpreter), try:
195
sick -vo/dev/null sick.iacc
197
The complete path will appear in the first line of the output, so you can copy
198
or edit it. You do want to copy it in case you break it:
200
sh -c 'cp `sick -vo/dev/null sick.iacc 2>&1 |\
201
head -1 | sed -e "s/\.\.\. \[.*$//"` iacc.io.SAFE'
203
When you have edited the file, rebuild the compiler object with:
207
If you have edited a copy, type that from the directory where you left the
208
edited copy, or "sick" won't find it (but see the "-I" command line option)
210
A similar consideration applies to rebuilding IACC (the INTERCAL Astonishing
211
Compiler Compiler). However, in this case you need to make a copy of "iacc.io"
212
as well as "iacc.iacc":
214
sh -c 'cp `sick -vo/dev/null iacc.iacc 2>&1 |\
215
head -1 | sed -e "s/\.\.\. \[.*$//"` iacc.io.SAFE'
216
sh -c 'cp `sick -vo/dev/null iacc.io 2>&1 |\
217
head -1 | sed -e "s/\.\.\. \[.*$//"` iacc.io.SAFE'
218
sh -c '${EDITOR-vi} `sick -vo/dev/null iacc.iacc 2>&1 |\
219
head -1 | sed -e "s/\.\.\. \[.*$//"`'
222
If you break "iacc.io" you won't be able to recompile "iacc" unless you
223
re-install CLC-INTERCAL or use the copy you just made.
230
Copyright (c) 2006 Claudio Calvelli <intercal@sdf.lonestar.org>
232
In addition to the above, permission is hereby granted to use, misuse,
233
modify, distribute, break, fix again, etcetera CLC-INTERCAL-1.-94.-4
234
provided that the following conditions are met:
236
1. Redistributions of source code must retain the above copyright
237
notice, this list of conditions and the following disclaimer.
238
2. Redistributions in binary form must reproduce the above copyright
239
notice, this list of conditions and the following disclaimer in the
240
documentation and/or other materials provided with the distribution.
241
3. Neither the name of the Author nor the names of its contributors
242
may be used to endorse or promote products derived from this software
243
without specific prior written permission.
245
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
246
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
247
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
248
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
249
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
250
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
251
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
252
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
253
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
254
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF