CPL

Download CPL

This software is made available for free download under the terms of its enclosed LICENSE. Versions are identified by date. Current version is 2024-04-22.

To download and unpack CPL for Linux/Unix, execute the following line in a terminal:

curl -fsS -o /tmp/unpack-cpl.sh https://CPLcode.net/version-archive/unpack-cpl.sh && sh /tmp/unpack-cpl.sh

Alternately download and run unpack-cpl.sh, or access the version archive.

You will be asked for confirmation before proceeding. Read the following links if you would rather use:

macOS        Windows

as your host operating system.

A Troubleshooting guide, the Frequently Asked Questions, and of course the full Documentation, are available. For a quick start browse the Programming Examples, download any one of them, say Helloworld.cpl, run it with cpl run Helloworld.cpl, modify it with cpl edit Helloworld.cpl.

System requirements

The CPL compiler, interpreter and editor come in a self-extracting archive which unpacks to its own directory in user space and requires no privileges. Symbolic links to the relevant commands are placed in the user's bin directory for the purpose of appearing in the execution PATH. Alternately, if the unpack-cpl script is run by root, the unpacked directory is placed under /usr/local and the executable links under /usr/local/bin for the sake of all users; root privileges are in this case only summoned to modify the /usr/local directory. The tools can as well be installed in a single user's space and made available to other users as needed; a provided script generates the relevant links.

The CPL tools were developed on Debian GNU/Linux, and this is the operating system where most tests have been performed. Nonetheless the tools and the way they are packed are not tied to a specific flavour of Linux or Unix, nor to a specific processor architecture; any of the widespread Linux/Unix distributions on either personal or datacenter systems should unpack and use them equally well, and all those tried did. The tools have also been successfully deployed in Raspberry Pi and Beaglebone Black ARM-based microboards, as well as in non-Linux unices such as older Silicon Graphics machines and BSD systems including Apple Macintosh computers, for which step-by-step instructions are provided in this macOS howto. And the Windows Subsystem for Linux (WSL), which is an integral part of Microsoft Windows, essentially is Debian GNU/Linux; step-by-step instructions are provided in this Windows howto.

Only basic system tools are required: gzip, tar, cc, make, info, plus gnuplot if you want graphics and curl for optional automatic updates. For maximal compatibility the adopted C compiler should be gcc (as the system compiler is by default in most Linux distributions), but other compilers (e.g. icc) have also been used with success. However, CPL nested functions are implemented as C nested functions, a nonstandard gcc extension, and will become unavailable if a compiler other than gcc is used (or if the system's default gcc configuration disables them).

Storage requirements

Minimal by any standard. The lightweight programming language uncompressed archive, inclusive of documentation and libraries, takes less than 1.5 megabytes (MB).

Compilation time requirements

Generally a small fraction of the, already very reasonable, time taken by the subsequently invoked C compiler.

Code maturity

CPL is under active development; its tools sit at different levels of maturity. On a crude scale:

 stable. cpl.fri, fri, and their driver script cpl were being developed for decades. They now only undergo unfrequent changes. The cpl editor, despite being the newest addition to the family, is also fairly well debugged. It is the editor of choice for the maintenance of CPL itself, writing this website included.
 experimental. Interactive cpl has some glitches and may still undergo significant changes, but it offers a complete and useful interactive interface.
 incomplete. Only some of the optional CPL libraries currently fall in this category. See the comments header in each.

Mature or not as the code is, bugs will happen. If you believe you found a bug, or an inconsistency between the compiler's behaviour and its documentation, you will do an appreciable service to the CPL community by filing a bug report with (.....) . With your description please enclose a code snippet, as short as possible but complete enough that it compiles as is, and triggers the alleged non-conforming behaviour.

copied.