|Picat 1.0 - Is Logic Programming Making A Comeback?|
|Written by Lucy Black|
|Tuesday, 07 April 2015|
Picat is a newish language that has just reached a version 1.0 release. It has some interesting features, but the fact that it supports logic programming is the most important.
Logic programming is best known as the basis of the Prolog programming language. Prolog was invented in the early 1970s but didn't really make much impression until the 1980s. At the time programming was making slow progress from random spaghetti code, through the early days of structured modular programing and into the waiting arms of object-oriented programming. These were primitive times and logic programming seemed like a technology from outer space. It was arguably the last of the big programming paradigms to be invented although you can also argue that Prolog just clarified the ideas that were already around.
Logic programming never created the revolution that people predicted for it and slowly the wider interest died away, leaving enthusiasts and niche applications to carry the torch. Even today an encounter with Prolog can be a huge shock to programmers who think that functional or object-oriented are the only two approaches possible.
Picat is an open source language that bundles logic programming with approaches that fit in with it or that extend it - functional programming, dynamic programming and constraint programming. What is special about the approach is that, unlike other approaches to programming, you can write down a set of conditions and the language will automatically find values that satisfy them. You can use this approach to write programs to solve scheduling problems, logical problems, route planning problems and so on. Basically you write down the static description of the problem and the language system finds solutions.
What really suprises people when they first encounter logic programming is that it seems clever and powerful, but not very general purpose. However, it is - both Prolog and Picat are Turing complete, which means you can write any program that can be written using them. Of course, you don't get the advantages of the problem solving unless the program actually makes use of them, but Picat is a general purpose language.
If you would like to see the sort of thing that Picat is being used for then checkout the Picat page.
Another interesting illustration of how useful the language is can be found in a recent paper describing how to solve Google Code Jam problems using Picat. It makes you think that choosing to use Picat in this year's Code Jam might be such a big advantages that it would have to be banned. What more recommendation does a new language need!
Oh, and did I point out that its name is Pi and Cat? Both revered mathematical objects.
To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin, or sign up for our weekly newsletter.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Tuesday, 07 April 2015 )|