Final Thoughts on Three Days of Prolog

My experience with three days of exploring Prolog through Seven Languages in Seven Weeks.

Seven Languages in Seven Weeks provided some examples of how powerful Prolog can be at solving problems and I can see how it would be applicable to a wide variety of problems. Coming from an OO background it is a totally different approach to programming but it would definitely be worth learning if you regularly need to solve that type of problem. I enjoyed using it. I think it appealed to my mathematical side.

The kind of work Prolog excels at is:

Natural Language (human written or spoken language) Processing: Taking natural language, apply a knowledge base of facts and inferences to it and expressing it in concrete rules appropriate for a computer.

Games: Expressing behaviour of different characters.

Semantic Web (attaching meaning to services & information on the web): RDF language provides a basic description of resources. A server can compile these into a knowledge base and that combined with Prolog’s natural language processing can provide a rich end user experience. You can see examples of SWI Prolog packages round this area

Artifical Intelligence: Specify behaviour

Scheduling: Working with constrained resources to come up with a schedule.

Prolog does have some weaknesses. It is a niche, logical programming language. Understanding how the language works is key to writing code that scales. It is very computationally expensive to work with large data sets in Prolog so the person using it needs to have a good understanding so they can get the correct result with manageable sized data sets. The same applies to writing rules which scale well.

All in all a fun week though I’m not sure how much I’ll get to use it day to day I enjoyed learning a bit about Prolog and using it to solve some simple problems.