IN-DEPTH A logical resurrection
That is PROLOGICAL!
Thanks to the artificial intelligence revolution, a 50-year-old language is enjoying a resurgence in popularity.
Mike Bedford investigates…
CREDIT: CBS Photo Archive/Contributor/getty images
R eaders interested in programming languages will surely recognise the idea of a language being flavour of the month. However, in the interests of accuracy, we’d have to admit that the phrase “flavour of the year” or, more probably, “flavour of the decade” would be more appropriate. (looks
at C++ – Ed)
What’s more, you’ll probably recognise the names of once-popular languages that are now little more than the stuff of history books. Indeed, once a language passes its peak of popularity, we might think that a steady decline to obscurity is surely inevitable, and it usually is. But statistics reveal one language that’s bucking the trend by coming back from the dead. That language is Prolog, and the revival in its fortunes is due, in no small part, to the artificial intelligence (AI) revolution.
Prolog is our subject here, but this isn’t an expose of yet another language because Prolog certainly isn’t a “also ran” programming language. By way of contrast, in featuring Prolog we’ll be introducing you to a language which, in all probability, looks totally unlike any other language you’ve ever seen before. Indeed, as we’ll see, it supports a totally different programming paradigm from the likes of Python, C++, Java, C# or even most of the golden oldies like FORTRAN, COBOL, PL/1 or Algol.
Prolog’s Resurrection
Prolog is no spring chicken – it clocks up its first half-century in 2022. Developed in a collaboration between the Universities of Aix-Marseille and Edinburgh, and introduced in 1972, it was designed specifically for programming AI applications. In particular, natural language processing was considered a particular strength. It wasn’t the first such language – Lisp claims that distinction (see the box on page 80) – but, even today, the world still isn’t exactly awash with dedicated languages for AI applications. Oh, and just in case you were wondering about the name, it’s short for PROgramming in LOGic. This is something that will make more sense when we start to look at the language in A bit more detail.
We’d love to say that Prolog was first implemented in Unix, the closest thing to Linux back in 1972, but in reality it first appeared on IBM mainframes under a now little-known operating system called CP/CMS. What we can say, though, is that unusually for ‘70s commercial software, CP/CMS was open source and many users were involved in customising it. Unix versions soon followed – in their dozens, hardly surprising in an era of so many incompatible hardware architectures – and today Linux Prologs aren’t in short supply, as you can see in the Try it Out box (see page 81).