POP-11


POP-11 is a reflective, incrementally compiled programming language with many of the features of an interpreted language. It is the core language of the Poplog programming environment developed originally by the University of Sussex, and recently in the School of Computer Science at the University of Birmingham, which hosts the main Poplog website. There is now also a Github Poplog] site with the core source files.
POP-11 is an evolution of the language POP-2, developed in Edinburgh University, and features an open stack model. It is mainly procedural, but supports declarative language constructs, including a pattern matcher, and is mostly used for research and teaching in artificial intelligence, although it has features sufficient for many other classes of problems. It is often used to introduce symbolic programming techniques to programmers of more conventional languages like Pascal, who find POP syntax more familiar than that of Lisp. One of POP-11's features is that it supports first-class functions.
POP-11 is the core language of the Poplog system. The availability of the compiler and compiler subroutines at run-time gives it the ability to support a far wider range of extensions than would be possible using only a macro facility. This made it possible for incremental compilers to be added for Prolog, Common Lisp and Standard ML, which could be added as required to support either mixed language development or development in the second language without using any POP-11 constructs. This made it possible for Poplog to be used by teachers, researchers, and developers who were interested in only one of the languages. The most successful product developed in POP-11 was the Clementine Data-mining system, developed by ISL. After SPSS bought ISL they decided to port Clementine to C++ and Java, and eventually succeeded with great effort.
POP-11 was for a time available only as part of an expensive commercial package, but since about 1999 it has been freely available as part of the Open Source version of Poplog, including various additional packages and teaching libraries. An online version of ELIZA using POP-11 is available at Birmingham.
At the University of Sussex, David Young used POP-11 in combination with C and Fortran to develop a suite of teaching and interactive development tools for image processing and vision, and has made them available in the Popvision extension to Poplog.

Simple code examples

Here is an example of a simple POP-11 program:
define Double -> Result;
Source*2 -> Result;
enddefine;
Double =>
That prints out:
** 246
This one includes some list processing:


define RemoveElementsMatching -> Result;
lvars Index;
%
for Index in Source do
unless Index = Element or Index matches Element then
Index;
endunless;
endfor;
% -> Result;
enddefine;
RemoveElementsMatching => ;;; outputs cat sat on mat
RemoveElementsMatching => ;;; outputs the cat] mat]
RemoveElementsMatching => ;;; outputs is a


Examples using the POP-11 pattern matcher, which makes it relatively easy for students to learn to develop sophisticated list-processing programs without having to treat patterns as tree structures accessed by 'head' and 'tail' functions, can be found in the . The matcher is at the heart of
. Some of the powerful features of the toolkit, such as linking pattern variables to inline code variables, would have been very difficult to implement without the incremental compiler facilities.