CPL

What is CPL?

Three-letter acronyms collect many meanings. CPL has dozens, for instance several cities' Public Libraries, a few Cricket Premier Leagues, a Commercial Pilot License, a Microsoft Windows Control PaneL file, and a handful of programming languages among which an early ancestor of BCPL and C. Here we adopt a fivefold expansion:

The present CPL, unrelated to the Cambridge or Combined Programming Language, is a general-purpose programming language akin to FORTRAN or C (∗∗p).col=j; p=&(∗∗p).next; p.col=j p=p.next (but in fact even more similar to the once common Pascal and Modula-2, for those who remember them), with some unique features. It was born out of the effort to provide the pointer flexibility of C without a flood of ∗'s and &'s, the function overloading of C++ without the verbosity of classes, and the function prototypes of Modula-2 (and most modern languages) without the need for dedicated header or interface files.

It also aims for the ease of use of interpreted languages like MATLAB or Python, without giving up the error-catching benefits of mandatorily declared variables and the sheer speed of compiled execution. CPL was thought out as a compiled language from the very beginning; when used for computationally intensive tasks, it has the speed of compiled C. > makecpl Helloworld > ./Helloworld Hello world! In fact, its compiler is implemented as a nimble translator to C which then invokes the system C compiler; this action, as well as the re-making of any required modules that were modified in the meanwhile, occurs behind the scenes at a single makecpl command. Later the icpl interpreter was also developed, with the ability to run a combination of interpreted and compiled CPL modules, as well as any function provided by an existing C library, interactively from its console.

Did we mention that any function provided by an existing C or FORTRAN library USE lapack-eigenvalues A=[(1.,2.),(3.,4.)] WRITE eigenvalues(A) can be seamlessly called inside a CPL program? (or from the icpl command line.) If the included libraries are not enough, this feature gives easy access to a large number of public and proprietary libraries alike. And encapsulating a (e.g. LAPACK) call in a CPL wrapper, as exemplified in this lapack Tutorial, simplifies syntax and exacts no performance penalty.

To cap this bird's-eye presentation, a hallmark aesthetic touch of CPL is the availability of all three kinds of brackets for grouping arithmetic (or other) expressions, p(i)=EXP(-{[x(i)-mu]/sigma}^2/2) just as you were taught in school. While to use more than one kind of brackets is optional and might be unessential to some, to alternate brackets so much eases the human eye's reading and proofreading nested parentheses. And it enhances automatic error catching too.