Personal Computer News


QL BCPL Development Kit

 
Published in Personal Computer News #091

Leon Heller, chairman of the independent QL Users Group looks at a BCPL package from Metacomco.

QL Kit

Leon Heller, chairman of the Independent QL Users Group looks at a BCPL package from Metacomco

While several implementations of BCPL for 8-bit and 16-bit micros are available, the language is ideally suited to a 32-bit architecture such as that provided by the MC68008 processor in the QL. Metacomco has now released its BCPL developed kit for just under £60.

Readers interested in BCPL should get hold of a copy of BCPL - The Language And Its Compiler by Martin Richards and Colin Whitby-Strevens. This is the BCPL user's bible.

Here is an example of a trivial BCPL program for the QL that clears the screen and then prints "Hello sailor!":

   GET "LIBHDR"
   LET START() BE $(
   SCREEN(SCREEN.CLEAR)
   WRITES("Hello sailor!")$)

Presentation

Metacomco's BCPL Development Kit (this review is based on a beta test copy) comes on a single Microdrive cartridge, and comprises nine files: text editor, linker, library header and the BCPL compiler itself. Because the compiler is too big to fit in RAM, an overlay technique is used. The complier consists of six files which are loaded as required, and this is transparent to the programmer.

The screen-based text editor (also written in BCPL) is identical to that provided with the Metacomco assembler and is easy to use. The editor can handle only relatively small text files but this does not matter as BCPL programmers tend to write their programs in small, linked modules to produce a single runtime module. The documentation mentions a program called "INSTALL", which allows the user to change the default window used by the editor and compiler. This was not included with the beta test copy, but will be available when the package is released.

Features

When using the BCPL Development Kit, you first use the editor to write your program, and save it as a text file. This is translated by the compiler into a binary file, which is then input to the linker with any other binary files that contain modules referenced by your program. This allows the user to make use of a library of modules. These can be built up gradually and incorporated in the user's own programs or those of other programmers.

The speed of compilation is excellent considering the limitations of the Microdrives, and the linker is very fast. Compiler error messages are quite informative and it is usually easy to see where you have gone wrong. The code produced is not particularly compact, as the linked cannot just select the modules required, and the entire runtime system (about 9K) is always included in the resulting object code file, which can be run using EXEC and EXEC-W in the usual manner.

Programs produced with this package can make use of the QL's multi-tasking capability. The library supplied with the package provides access to most of the QDOS routines, including graphics, file handling (sequential and random), the character font and screen handling. One omission from the library is a function corresponding to INKEY$ in Basic, which is essential for games programs and terminal emulators. Anyone requiring this function will have to code it in assembler.

Since the compiler uses the QL ROM routines for all arithmetic operatins, the precision of the floating point (seven digits) is inadequate for serious applications programming, such as accounting packages, but double precision arithmetic functions could be written - in BCPL, of course - and incorporated in any programs that needed them. BCPL is not really suitable for business programming.

Facilities for linking in assembly language modules are provided and an example of this is provided in the documentation.

The beta test copy reviewed had a few minor bugs in the compiler and linker, to do mainly with error detection which will hopefully be corrected.

Documentation

About a hundred pages of documentation are provided, and these contain sufficient information to use the package, provided a copy of the Richard and Whitby-Strevens book is to hand. The book is all the more necessary because the draft documentation had neither BCPL examples nor index.

Verdict

This is a very attractive package, and well worth the £59.95 Metacomco will be asking for it. BCPL is a difficult language to use, however, so this package is not for beginners.

Report Card

Features 4/5
Documentation 3/5
Performance 4/5
Overall Value 4/5

Postscript: What Is BCPL?

Basic Combined Programming Language was designed in 1967 by Martin Richards of the computing laboratory, Cambridge University. Although it is not a popular language (unlike C, which is based largely upon BCPL) it has many devotees, especially among those who learned their programming at Cambridge.

Like C, BCPL is a compiled language which makes it considerably harder to learn than an interpretative language like Basic.

BCPL is a relatively small, highly expressive and efficient block-structured language, ideal for systems programming: writing operating systems, editors, compiliers, etc. BCPL compilers are usually written in BCPL which helps to make the language portable, i.e. easily moved from one machine to anohter, even if the processor is different.

Leon Heller