# Advice for people learning Modern, Declarative Prolog from older texts

**URL:** <https://swi-prolog.discourse.group/t/advice-for-people-learning-modern-declarative-prolog-from-older-texts/3909>\
**Category:** Nice to know\
**Tags:** how-to\
**Created:** [May 4, 2021, 7:36pm UTC](https://swi-prolog.discourse.group/t/advice-for-people-learning-modern-declarative-prolog-from-older-texts/3909 "2021-05-04T19:36:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [May 4, 2021, 7:56pm UTC](https://swi-prolog.discourse.group/t/advice-for-people-learning-modern-declarative-prolog-from-older-texts/3909/2 "2021-05-04T19:56:54Z")

</div>

> [@rryley](#):
>
> What about pure output?

See: [Wiki Discussion: Generating Cytoscape.js graphs with SWI-Prolog](https://swi-prolog.discourse.group/t/wiki-discussion-generating-cytoscape-js-graphs-with-swi-prolog/2816)  
Note that the code is just proof of concept code, it still has many ways to be improved.

Also check out [code](https://github.com/search?l=Prolog&p=3&q=org%3ASWI-Prolog+phrase&type=Code) using pharse/2 in the SWI-Prolog repositories on GitHub. I know most of it is for parsing but some of it is for generating.

* * *

> [@rryley](#):
>
> Are there any other patterns or program cliches I should know about?

There are many noted in  
_The Craft of Prolog_ by Richard A O`Keefe ([WorldCat](http://www.worldcat.org/oclc/249366722))

One should read all of the forum post here and in the previous places this forum was hosted. I can’t remember them all but for a while it was on Google Groups.

Check out the SWI-Prolog [packages](https://www.swi-prolog.org/pack/list).

Personally I don’t think of Prolog as a programming language but a modelling language for problem solving. I also consider about 2/3 of what is built-in to SWI-Prolog to be models for solving problems, e.g. constraints, DCGs, tabling, → (single sided unification), is/2, EDCGs, term rewriting, etc.

* * *

> [@rryley](#):
>
> Is there anyone working on something like a “Prolog Cookbook” – ie. simple code samples on common tasks?

[Yes](https://swi-prolog.discourse.group/t/crowd-contributing-a-prolog-cookbook-an-embryonic-kernel/2307). It never went very far.

There is a post on this site from some months back noting how to contribute pull request to the SWI-Prolog documentation that would be the best way to add such items. I can’t find the topic but I know that @Boris did some and should be able to point the way.

---

_[View the full topic](https://swi-prolog.discourse.group/t/advice-for-people-learning-modern-declarative-prolog-from-older-texts/3909)._
