PEARL 90 is a real-time programming language (the acronym PEARL reads ‘Process and Experiment Automation Real-Time Language’). It can be charactererized as being a subset of PL/1 (regarding its syntax), augmented with language constructs for activating and controlling concurrent tasks.
Freely available documentation on PEARL 90 include these documents
Echtzeitpraxis mit PEARL (in German)
Other German language articles can be found at http://www.pearl90.de/pearl_li.htm.
The 32 bit PEARL90 compiler provided by Werum (get it here: pearl90.tar.gz [1], for the copyright: [2]), has ceased to work for newer Linux distributions. Whereas it has been proposed to run it on a virtual machine with a dated Linux kernel, this is a quite awkward solution, and it can be relatively easily achieved to get it up and running on a recent Linux distribution.
Then, download the the legacy Linux libraries p90legacy.tar.gz.
Assuming pearl90.tar.gz is extracted as $HOME/pearl90 and p90legacy.tar.gz is extracted as $HOME/p90legacy, Add these lines to .bashrc:
export PEARL90PATH=$HOME/pearl90
export PATH=$PATH:$PEARL90PATH
export P90LEGACY=$HOME/p90legacy
A PEARL executable forks one ore more I/O device driver processes.
Set the link loader and library path for the driver executables (V4*.out) accordingly:
cd $PEARL90PATH
for i in V4*
do
patchelf --set-interpreter $P90LEGACY/ld-linux.so.2 --set-rpath $P90LEGACY $i
done
‘patchelf’ is a utility provided by the Linux distribution package manager, or fetch it from here: https://github.com/NixOS/patchelf)
Download these bash scripts and make sure they are executable (chmod u+x p90.sh;chmod u+x p90link.sh) and contained in $PATH.
p90.sh PEARL90 compiler wrapper (*.prl ⟶ *.o)
p90link.sh PEARL90 linker wrapper
Note: in some environments it is necessary to install the package lsb-core in order to run the compiler executable $PEARL90PATH/pearl90.
With this prerequisites one may compile and link PEARL programs like
p90.sh test0.prl
p90.sh test1.prl
p90link.sh test0.o test1.o -o prog
to generate an executable ‘prog’ from the PEARL source files test0.prl and test1.prl.
N.B. The linker flags for building the PEARL executable match the path of the I/O drivers.
For good measure make sure that the generated PEARL programs and V4* executables point to the correct dynamic link libraries and link loaders, e.g.
ldd ./prog
ldd $PEARL90PATH/V4stdio.out
Find code samples here: sample_code.tar.gz. Unpacking this archive creates a folder 'sample_code'. In order to build the sample programs with 'make', the directory containing the scripts 'p90.sh' and 'p90link.sh' have to be in the PATH environment variable.
When everything is set up correctly, running 'make' in the sample_code directory will generate several executables. One program is named 'philos', this program simulates five philosophers (sitting around a table) that are either in the state 'eating', 'thinking' or 'hungry'. When a philosopher wants to eat (because his state changes from 'thinking' to 'hungry') he grabs the forks (placed to his left and his right) simultaneously — provided both forks are available and not in use by other dining philosophers. It is a well-known problem about resource allocation for concurrent processes demonstrating the use of semaphore variables - the processes are the philosophers and the resources are the forks. 'philos' employs simple text graphics, the philosopher states are marked with text highlighting, the forks are represented by the capital letter 'Y'.
The Werum 32-Bit Linux installation provides an application pview (process viewer, for observing PEARL process resources like tasks, semaphores etc.) that requires the dynamic library libncurses.so.5 to be installed. If your Linux package manager does not provide that backwards compatibility 32-Bit version then a symlink to the present version (libncurses.so.6) also does the job.
Here's a pview snapshot for the philos application:
References
[1] Original URL is ftp://ftp.werum.de/pearl90/p90v10414.tar.gz but now defunct and cannot even reclaimed via WaybackMachine.
[2] copyright: (in German) copyright.txt. The disclaimer grants use and distribution of the PEARL system for non-commercial uses.