When I graduated from using a CP/M system and bought my first PC in the early 1980s I couldn’t believe the power I had under my control. It was an XT, an 8088 processor with a 20 meg hard disc, two 360k floppy drives and a CGA monitor. That meant four (count them, 4!) colours. I thought I had died and gone to heaven. And when I attached a 1200 baud modem I was in a state of perpetual bliss.
I had learnt BASIC on my previous computers, and that was an exercise in itself. With only 4k of RAM you had to write very concise code. But now I wanted to expand my horizons, and on the advice of a friend I bought a copy of TurboProlog. At that time Borland had a number of programming languages, TurboBasic, TurboC, TurboPascal and TurboProlog. And they all cost $99.
TurboProlog was originally developed by Prolog Development Center and acquired by Borland, and then later sold back to PDC.
PDC released a version called Visual Prolog which is a Windows version of Prolog. Unfortunately it suffers from some of the same problems that afflicted TurboProlog, it isn’t a standard version, and some things are missing. It also seems, at least to me, to be very un-Prolog like in the way you have to code it to create Windows forms. But you can create a complete Windows application in a variation of Prolog.
But there is another way to produce Prolog applications in Windows. Amzi! have a version of Prolog that is Edinburgh standard and comes with a dll that allows prolog to be run from VB. You call the functions in the same way you would any dll functions in Visual Basic. I haven’t tried it in VB .Net but it works fine in VB6. Amzi have produced a .Net wrapper so I assume that this means that you will be able to produce managed code. I will provide more information when I have played with it.
The big difference with Prolog over other programming languages is that it is a declarative language. Most traditional languages, BASIC, C, etc are procedural. You tell the program what do and the order to do it in. Prolog, and other declarative languages are different. You tell the program what answer you want. In Prolog you start the program running by giving it a goal.
This completely different way of looking at programming is what I found to be fun. It is a whole new way of looking at programming. But is it of any use? The main uses of Prolog so far has been in rule based systems, such as expert systems, and in academic circles in the area of artificial intelligence. Although here it seems that other languages are more popular. Lisp has always been the main language of choice here, although I think that is more for traditional than other reasons.
But for rule based systems you cannot go past Prolog. I would recommend you grab a copy and have a play with it. In a later article we will look at some of the details of Prolog programming.