comparison interps/clc-intercal/README @ 996:859f9b4339e6

<Gregor> tar xf egobot.tar.xz
author HackBot
date Sun, 09 Dec 2012 19:30:08 +0000
parents
children
comparison
equal deleted inserted replaced
995:6883f5911eb7 996:859f9b4339e6
1 CLC-INTERCAL 1.-94.-2
2
3 "human beings are given free will in order to choose between
4 insanity on the one hand and lunacy on the other"
5 Aldous Huxley
6
7 -- - --------
8 -2 - Contents
9 -- - --------
10
11 -2 - Contents
12 -1 - Foreword
13 0 - Introduction to CLC-INTERCAL pre-pre-escape 1.-94.-2
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)
17 4 - Important notes about the new INTERNET library
18 5 - Licence
19
20
21 -- - --------
22 -1 - Foreword
23 -- - --------
24
25 A few years ago, I had, for several reasons, decided to completely GIVE UP
26 working on INTERCAL or, if you prefer, ABSTAIN FROM developing CLC-INTERCAL
27 any farther.
28
29 Of course, the flesh is weak and here I am at it again. It just so happens
30 that I am using the "compiler compiler compiler compiler" for a serious
31 project, so I am going to develop it further.
32
33
34 - - ------------ -- ------------ -------------- --------
35 0 - Introduction to CLC-INTERCAL pre-pre-escape 1.-94.-2
36 - - ------------ -- ------------ -------------- --------
37
38 It has been decided during the development of CLC-INTERCAL 0.06 that there
39 would be no further releases of CLC-INTERCAL. However, the compiler has
40 been left unattended on an FTP server, and appears to have escaped. For this
41 reason, we refer to this as an "escape" rather than a "release".
42
43 Additionally, development of CLC-INTERCAL version 0 has effectively stopped
44 before the escape of 0.06; a new versioning scheme has been introduced for
45 CLC-INTERCAL version 1. The main points to note are:
46
47 * The term "version" has been replaced by "perversion" for correctness
48 * The perversion number consists of a floating-point number with
49 independent signs for the integer and fractional part. Negative
50 fractions indicate pre-escapes (so 1.-94 means "94 pre-escapes to
51 go before 1.00". Or you can just add the numbers together and get
52 0.06, which is entirely a coincidence since 0.06 is not being
53 developed)
54 * The fractional part of a perversion number can be integer or floating
55 point, with a similar meaning for the parts. The current pre-escape is
56 1.-94.-2 which means "2 pre-pre-escapes to go before pre-escape 1.-94".
57
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.
60
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.
65
66
67 - - ---- --- ------- ----- ------------ ----
68 1 - What has changed since CLC-INTERCAL 0.05
69 - - ---- --- ------- ----- ------------ ----
70
71 Just about everything. See the file "Changes" for a complete list, or see
72 the following executive summary.
73
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.
80
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.
87
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.
95
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.
105
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.
111
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. Some of
115 the HTML documents are included as templates: the actual documentation
116 will be produced in blib/htmldoc
117
118
119 - - --- -- ------- ---- ------
120 2 - How to install this escape
121 - - --- -- ------- ---- ------
122
123 To unpack the distribution you need the following:
124
125 * A command interpreter compatible with the Bourne shell
126 * the "dd" program
127 * optionally, gzip and/or bzip2
128
129 If necessary, uncompress the distribution:
130
131 gzip -d CLC-INTERCAL-1.-94.-2.ddsh.gz
132
133 or:
134
135 bzip2 -d CLC-INTERCAL-1.-94.-2.ddsh.bz2
136
137 Unpack the distribution:
138
139 sh CLC-INTERCAL-1.-94.-2.ddsh
140
141 Create the Makefile:
142
143 cd CLC-INTERCAL-1.-94.-2
144 perl Makefile.PL
145
146 Build the compilers:
147
148 make
149
150 See if everything works:
151
152 make test
153
154 And install:
155
156 make install
157
158 It is possible that, by the time you read this, we have provided two
159 alternative versions of some modules: pure Perl and Perl-with-C. The latter
160 is likely to be better in some way (speed, size), otherwise we would not
161 provide it. If Makefile.PL finds that alternative versions are available,
162 it will ask which one you want to install. In general, the pure Perl versions
163 will work as long as your Perl installation works; the Perl-with-C should
164 work but might break because your C compiler is not the same as mine, or
165 simply because it's C and it's more self-obfuscating than INTERCAL. If it
166 does not work, install the pure Perl version. If that does not work either,
167 you have found an unimplemented feature. Congratulations.
168
169 The "make" and "make test" will take some time: "make" will run IACC (the
170 INTERCAL Astonishing Compiler Compiler) to build itself and all the other
171 compilers, and this is not quite a quick job. The "make test" will test
172 all parts of the compiler, including the Virual Machine, the Quantum
173 Emulator and the Just-Too-Late compiler. Have a coffee break, or read the
174 source code and try to figure out how it works. If you can figure out how
175 it works, please tell me, because I cannot.
176
177
178 - - --- -- ------ --- -----------
179 3 - How to modify the compiler(s)
180 - - --- -- ------ --- -----------
181
182 The compiler and the compiler compiler are currently underdocumented
183 (which means that there is no documentation whatsoever). If you feel
184 the urge to modify the compiler itself, ignore the Perl runtime library
185 and edit the file "sick.iacc", which would have been installed somewhere
186 system dependent. If you have write permission to this system dependent
187 location and your command interpreter is compatible with the Bourne Shell,
188 you can locate the file and edit it by simply typing (all in one line, we
189 show it in separate lines for readability):
190
191 sh -c '${EDITOR-vi} `sick -vo/dev/null sick.iacc 2>&1 |
192 head -1 | sed -e "s/\.\.\. \[.*$//"`'
193
194 If you would rather not type the above, or you have no write permission to
195 the appropriate place (or if you have an inferior command interpreter), try:
196
197 sick -vo/dev/null sick.iacc
198
199 The complete path will appear in the first line of the output, so you can copy
200 or edit it. You do want to copy it in case you break it:
201
202 sh -c 'cp `sick -vo/dev/null sick.iacc 2>&1 |\
203 head -1 | sed -e "s/\.\.\. \[.*$//"` iacc.io.SAFE'
204
205 When you have edited the file, rebuild the compiler object with:
206
207 sick sick.iacc
208
209 If you have edited a copy, type that from the directory where you left the
210 edited copy, or "sick" won't find it (but see the "-I" command line option)
211
212 A similar consideration applies to rebuilding IACC (the INTERCAL Astonishing
213 Compiler Compiler). However, in this case you need to make a copy of "iacc.io"
214 as well as "iacc.iacc":
215
216 sh -c 'cp `sick -vo/dev/null iacc.iacc 2>&1 |\
217 head -1 | sed -e "s/\.\.\. \[.*$//"` iacc.io.SAFE'
218 sh -c 'cp `sick -vo/dev/null iacc.io 2>&1 |\
219 head -1 | sed -e "s/\.\.\. \[.*$//"` iacc.io.SAFE'
220 sh -c '${EDITOR-vi} `sick -vo/dev/null iacc.iacc 2>&1 |\
221 head -1 | sed -e "s/\.\.\. \[.*$//"`'
222 sick iacc.iacc
223
224 If you break "iacc.io" you won't be able to recompile "iacc" unless you
225 re-install CLC-INTERCAL or use the copy you just made.
226
227
228 - - --------- ----- ----- --- --- -------- -------
229 4 - Important notes about the new INTERNET library
230 - - --------- ----- ----- --- --- -------- -------
231
232 A new INTERNET library is now available as an extension to the "sick"
233 compiler (it may work with other compilers, but this is not very likely
234 for now). See directory doc/INTERNET for details.
235
236 When this extension is loaded, the program will automatically start a
237 theft server if one isn't found already running on the local computer.
238 As there isn't yet an official port assignment for this, the port is
239 stored in the file system.sickrc, and should be changed when an official
240 assignment is available. Look for the line:
241
242 I CAN UNDERSTAND "..INTERNET.PORT" AS "64928"
243
244 and change the number as appropriate. You may also want to run your
245 INTERNET applications using a nonstandard port, but doing so will make
246 locally running programs incompatible with programs running elsewhere,
247 so stealing from remote systems will not succeed - unless of course one
248 has agreed on a port number with the remote system's admin.
249
250 Some of the forms of the CASE statement, and the STEAL/SMUGGLE without an
251 IP address, require knowledge of the IP address and netmask of local LANs.
252 In some cases, it may be possible to obtain these automatically, however this
253 is not possible in some systems. If the information is not available, no
254 broadcasts are possible. To work around this problem it is possible to specify
255 the list of interface in sickrc (user or system) with options like:
256
257 I CAN UNDERSTAND "..INTERNET.DEVICE.eth0" AS "192.168.1.2" WITH 24
258 I CAN UNDERSTAND "..INTERNET.DEVICE.eth1" AS "10.3.6.9" WITH 8
259
260 Note that the option specifies the IP address and netmask of each interface;
261 in this case, 192.168.1.2/24 and 10.3.6.9/8; the device name is ignored at
262 present, but it may be a good idea to leave it the same as the name known to
263 the kernel. Also note that you must install Net::Netmask to be able to use
264 the list of devices from sickrc.
265
266 An unusual feature of the INTERNET is that one can steal filehandles and they
267 will continue working. For example, if an INTERCAL program with the INTERNET
268 extension runs on computer A and has standard write redirected from a file,
269 then another program on computer B can steal that standard write filehandle
270 and will be able to write in from that file, even if the file is not on a
271 networked filesystem (because it's been stolen, however, the program which
272 opened the file can no longer use it - smuggling, on the other hand will allow
273 to share a file between computers). This feature has been used to create a
274 network-wide clipboard in which a server (a simple INTERCAL program) just
275 opens a file and then does nothing; clients then SMUGGLE the filehandle
276 and store the clipboard contents on it - automagically sharing it over the
277 network. Moreover, the server can be found using broadcasts, so there is
278 never any need for the user to know where it is running.
279
280
281 - - -------
282 5 - Licence
283 - - -------
284
285 Copyright (c) 2006-2008 Claudio Calvelli <intercal@sdf.lonestar.org>
286 (Please include the word INTERLEAVING in the subject when emailing that
287 address, or the email may be ignored)
288
289 In addition to the above, permission is hereby granted to use, misuse,
290 modify, distribute, break, fix again, etcetera CLC-INTERCAL-1.-94.-2
291 provided that the following conditions are met:
292
293 1. Redistributions of source code must retain the above copyright
294 notice, this list of conditions and the following disclaimer.
295 2. Redistributions in binary form must reproduce the above copyright
296 notice, this list of conditions and the following disclaimer in the
297 documentation and/or other materials provided with the distribution.
298 3. Neither the name of the Author nor the names of its contributors
299 may be used to endorse or promote products derived from this software
300 without specific prior written permission.
301
302 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
303 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
304 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
305 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
306 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
307 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
308 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
309 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
310 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
311 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
312 SUCH DAMAGE.
313