POP-11 facts for kids
POP-11 is a special kind of computer language that helps people create computer programs. It's like a set of instructions you give to a computer. POP-11 is known for being able to change and grow while a program is running, which is pretty cool! It's also part of a bigger system called Poplog.
This language was first developed at the University of Sussex in the United Kingdom. Now, the main home for Poplog and POP-11 is at the University of Birmingham.
POP-11 grew out of an older language called POP-2. It has a unique way of handling information, a bit like stacking blocks, similar to another language called Forth. While it mostly uses step-by-step instructions (called procedural programming), it can also use a more descriptive style, especially with its "pattern matcher." This pattern matcher helps it find specific arrangements of data.
POP-11 is often used in artificial intelligence (AI) research and teaching. AI is about making computers think and learn like humans. It's also good for teaching a type of programming called "symbolic programming," which deals with symbols and ideas rather than just numbers. People who are used to languages like Pascal often find POP-11 easier to learn than Lisp, another AI language. One neat feature of POP-11 is that it can treat functions (blocks of code that do a specific task) like regular pieces of data.
POP-11 and the Poplog System
POP-11 is the main language inside the Poplog system. Because its compiler (the part that turns your code into something the computer understands) is always available, POP-11 can be extended in many ways. You can even add new types of data while the program is running!
This flexibility allowed Poplog to include compilers for other languages like Prolog, Common Lisp, and Standard ML. This meant that people could work with different languages all within the same Poplog system. This was very helpful for teachers, researchers, and developers who might only be interested in one of these languages.
Real-World Uses
One of the most successful products made with POP-11 was a data-mining system called Clementine. Data mining is like digging for hidden patterns and information in large amounts of data. Clementine was very good at this! Later, the company that bought Clementine decided to rewrite it using other languages like C++ and Java. This was a very difficult task, and some people felt that the new versions lost some of the flexibility that POP-11 provided.
For a while, POP-11 was only available as part of an expensive commercial package. But since around 1999, it has been available for free as part of the Open Source version of Poplog. This means anyone can use it and even help improve it. You can even find an online version of a famous computer program called ELIZA that uses POP-11, available from the University of Birmingham.
At the University of Sussex, a researcher named David Young used POP-11 along with other languages like C and Fortran. He created tools for working with images and computer vision. These tools are available in an extension to Poplog called Popvision.
Try Some POP-11 Code!
Let's look at some simple examples of POP-11 code. These examples show how easy it can be to write programs in this language.
Here's a program that doubles a number:
define Double(Source) -> Result; Source*2 -> Result; enddefine; Double(123) =>
When you run `Double(123) =>`, it will print out: ** 246
This next example shows how POP-11 can work with lists of words or items. It removes certain elements from a list.
define RemoveElementsMatching(Element, Source) -> Result; lvars Index; [[% for Index in Source do unless Index = Element or Index matches Element then Index; endunless; endfor; %]] -> Result; enddefine; RemoveElementsMatching("the", [[the cat sat on the mat]]) => ;;; outputs [[cat sat on mat]] RemoveElementsMatching("the", [[the cat] [sat on] the mat]) => ;;; outputs [[the cat] [sat on] mat] RemoveElementsMatching([[= cat]], [[the cat]] is a [[big cat]]) => ;;; outputs [[is a]]
POP-11 also has a powerful "pattern matcher." This feature makes it simpler for students to learn how to create programs that process lists without needing to understand complex data structures. You can find more examples of how the pattern matcher works in the online introductory tutorial. The pattern matcher is also a key part of a toolkit called SimAgent, which helps create computer simulations.
See Also
- COWSEL (also known as POP-1) programming language