Exploring the world of declarative programming

Most of us use imperative programming languages like C Python or Java at home. But the universe of programming languages is endless and there are languages where no imperative command has gone before. That which may sound impossible at the first glance is feasible with Prolog and other so called declarative languages. This article will demonstrate how to split a programming task between Python and Prolog.

In this article I do not want to teach Prolog. There are resources available for that. We will demonstrate how simple it is to solve a puzzle solely by describing the solution. After that it is up to the reader how far this idea will take them. .

To proceed you should have a basic understanding of Python. Installation of Prolog and the Python-Prolog bridge is accomplished using this command.

dnf install pl python3-pyswip.

Our exploration uses SWI-Prolog an actively developed Prolog which has the Fedora package name 8220pl8221. The PythonSWI-Prolog bridge is pyswip.

...

Read Full Post

News Link: https://fedoramagazine.org/exploring-the-world-of-declarative-programming/.
RSS Link: https://fedoramagazine.org/feed/.

Linux Chatter is a news aggregator service that curates some of the best Linux, Cloud, Technical Guides, Hardware and Security news. We display just enough content from the original post to spark your interest. If you like the topic, then click on the 'read full post' button to visit the author's website. Use Linux Chatter to find content from amazing authors!

Note: The content provided has been modified and is not displayed as intended by the author. Any trademarks, copyrights and rights remain with the source.

Disclaimer: Linux Chatter sources content from RSS feeds and personal content submissions. The views and opinions expressed in these articles are those of the authors and do not necessarily reflect those of Linux Chatter.