CLC-INTERCAL Reference

... The command-line compiler tool

Table of contents:

The command-line compiler tool

Starting from CLC-INTERCAL 1.-94, the preferred method to compile programs is to use the Integrated Programming Environment, sick (which stands for Superior INTERCAL Compiler Kluge or something like that). A program compatible with the old "oo, ick" is planned and will be made available if and when.

sick requires CLC-INTERCAL 1.-94 and newer. It won't work with older versions.

Although there are plans to provide some sort of interesting user interface to sick, at present it only works in batch mode, compiling programs using options specified on the command line, and either producing objects or running the program as soon as the compiler finishes.

The arguments on the command line are either options (in the form --name=value or -xvalue), or filenames. If a filename is encountered, it is immediately compiled with the options which precede it in the command line, and then optionally executed. After processing the command line, sick terminates.

Command-line options

There is a large number of command-line options, which are grouped by type for easy reference.

Source character set options

Before compiling a program, sick needs to know what character set has been used to encode the source. These days it's mostly ASCII but you never can tell. The default is --guess.

Long optionShortMeaning
--ascii-aASCII
--baudot-bExtended Baudot
--ebcdic-eNonstandard EBCDIC
--hollerith-hHollerith, straight from punched cards
--charset=NAMESelect a character set
--guess-gTry to guess looking at the program source

See the chapter about character sets for more information on supported character sets.

Compiler options

Once sick has loaded the source, and converted it to ASCII if necessary, it needs to compile it. This requires loading a compiler object and any necessary compiler options and extensions. This is done by specifying preloads, which, as the name suggests, are loaded before the program source. If no preloads are specified, sick attempts to guess the correct list of preloads by looking at the program suffix (or an alternative suffix specified on the command line).

Long optionShortMeaning
--include=DIR-IDIRAdd directory to search path for compiler objects
--nopreloadClears the list of preloads, reverting to the suffix-based guess
--preload=NAME-pNAMEAdd NAME to the list of preloads
--suffix=SUFFIXIf using suffix-based guess, use SUFFIX instead of the source file's suffix

The suffix-based guessing of preloads relies on the file system.sickrc or .sickrc which should be somewhere in the search path for compiler objects. The one provided with the distributions will use the following table (if a suffix belongs to more than one row, it will use the first matching one):

SuffixPreloadsMeaning
.iacciaccCompiler source
.tiick, thickThreaded INTERCAL source
.ciickC-INTERCAL source
.iasmasmCLC-INTERCAL assembler
.isickCLC-INTERCAL source
.clcisickCLC-INTERCAL source
.19721972Traditional INTERCAL source

In addition to the above, extra letters can be present between the spot and the rest of the suffix, indicating extra preloads. Such extra letters can only be used with the ick or sick compilers, because 1972, iacc and iasm do not accept options or extensions.

LetterPreloadMeaning
22Change base to 2
33Change base to 3
44Change base to 4
55Change base to 5
66Change base to 6
77Change base to 7
dbitwise-divideSelect bitwise behaviour for unary divide
gcome-from-gerundEnable COME FROM gerund and NEXT FROM gerund
lcomputed-labelsAllow computed statement labels
nnextAllow NEXT statements
rinternetEnable INTERcal NETworking
ssyscallEnable system call interface on label (666)
tthickEnable threads with COME FROM
wwimpSet wimp mode as default for compiled program

CLC-INTERCAL 1.-94.-2 no longer includes the INTERNET extensions by default. The "r" suffix will only work if the optional package CLC-INTERCAL-INET has been installed.

Not all these extra options are compatible with ick. See the chapter about compiler extensions for more details.

Code generation options

Once the program source has been compiled, sick needs to use a module to generate the actual code. The default is Object, which produces an INTERCAL object, which can be executed directly or loaded back into sick as a preload.

Long optionShortMeaning
--nooptimiseDisable optimiser (default)
--optimise-OEnable optimiser
--backend=NAME-lNAMESelects the module used to generate code
--output=NAME-oNAMEThe output file, defaults to the source file name with a new suffix
--name=NAME-nNAMEA name passed to the backend. Most backends don't use one
--bug=NUMBERChange the probability of the compiler bug
--ubug=NUMBERChange the probability of the unexplainable compiler bug

The following backends are currently provided:

BackendSuffixMeaning
ListObject.iasmAssembler listing of the object
Object.ioExecutable object
Perl.plPerl program
RunRun program immediately - does not save object

If an output file name is not specified with --output, the backend will generate a file name by appending its own suffix (shown in the table) to the base name of the source program.

Objects produced by the Object and Perl backends will accept the following command-line arguments when executed:

OptionMeaning
--nouserrcIgnore .sickrc files, use only first system.sickrc found
--rcfile=NAMEUses specified file instead of searching for .sickrc and system.sickrc
--traceEnable tracing for the object
--stdtrace=FILEEnable tracing and redirect tracing data to FILE
--notraceDisable tracing (default)
--wimpSelect wimp mode (default if the wimp object was preloaded)
--nowimpSelect normal mode (default if the wimp object was not preloaded)

Misc options

The following options control the way sick operates:

Long optionShortMeaning
--nouserrcIgnore .sickrc files, use only first system.sickrc found
--rcfile=NAME-rNAMEUses specified file instead of searching for .sickrc and system.sickrc
--rclistLists all .sickrc and system.sickrc files found
--stdverb=FILE-sFILESend verbose output to FILE
--verbose-vSend verbose outout to standard error
--quiet-qDo not produce verbose output (default)
--timesPrint compiler timing information on standard error
--notimesDo not print timing information (default)
--traceEnable tracing - this will trace the compiler, not the object
--stdtrace=FILEEnable tracing and redirect tracing data to FILE
--notraceDisable tracing (default)

User interface options

At the time of writing, sick does not use any interface: it just gets its orders from the command line, does what it needs to do, and terminates. A future version may do more. In the meantime, a number of command-line options allow to select a user interface, although this selection is currently ignored.

Long optionShortMeaning
--graphic-XGTK2-based graphical interface
--curses-cCurses-based text interface
--lineReadLine-based text interface
--batchBatch mode, no user interface (default)
--interface=NAME-iNAMELoad the specified interface

CLC-INTERCAL 1.-94.-2 no longer includes the user interfaces in the distribution: these are available as separate packages.