A page for beginners to add to SWI-Prolog internet site

Not claiming it is any good, but I wrote up a first draft for a new Get Started page as a static page on the website. That is more appropriate and easier to manage. The source is here

This page is a complicated balance between completeness and being simple and short. I think we do want to accommodate a couple of different user categories.

2 Likes

Out curiosity, do you or does anyone have a few nice examples at hand? Of real-world problems, not puzzles. I am currently trying to connect prolog to R (the other way round), and R people might ask which of their everyday problems can be solved with that library.

(This response appears at the bottom though it refers to a comment way up in thread)

Thank you for asking …

I have a keen interest in uptake of Prolog, but at this stage it would be hard for me to untangle from the code I wrote/write example code. But, I hope that eventually, i will be able to contribute such code.

Within the design pattern community there also existed a programming idiom community – i think harvesting such idiomatic use of Prolog to solve “micro” engineering problems could be very useful indeed …

Those idioms are the bread and butter of any professional developer … and some of them are informally mentioned in this list as well

Apart from what i named"2 lines examples" and “full examples” maybe “full examples” would also need to be split or indexed by thematics. As far as i remember you also have notebooks in SWISH. The old way it is things that universities had on FTP access and i suppose that the new way would be linking it to GitHub so that the community can also improve those longer pieces of code if new ideas appear.

Tessel Boogaard has done a lot of work on data analysis using Prolog (SWISH) and R, see e.g., https://ir.cwi.nl/pub/26774/datalab.pdf. Unfortunately the real code is not public. There is a nice combination example by Samer Abdallah on SWISH: SWISH -- SWI-Prolog for SHaring. There is the cplint work on http://cplint.ml.unife.it/ and there is the work by @nicos who can surely point at relevant work.

All this embeds the other way around though. That is maybe not fundamentally different. It does in my opinion make more sense though. Prolog is good at using rules to clean, combine and abstract raw data. This is mostly an exploratory process. There is a blob entry from me at Collaborative data analysis using SWISH DataLab - Amsterdam Data Science

3 Likes

Cool, thanks. I will look at these links, one by one.

Given some of the remarks of this thread, I am a bit unsure how easy it is to convince R users to use Prolog as the main executable at their daily work, though. In other words, the reverse direction might also make sense :blush:

1 Like

Apart from the motivation or the reason why they got to SWI Prolog, to my point of view, real beginners in a language are those discovering the language “for the first time” = “where should i start”. I could add other beginners who are those coming from an imperative language, as the way Prolog works is totally different (same as the joke about “spaghetti programming” compared to structuring code correctly). Students coming from that second category often think that because they “know” another language Prolog is going to be super simple and if nothing is done to make it easy, most of them end up with a huge deception considering that Prolog is a headache making them lose time …

You have another level of beginners who are developpers skilled in some other languages and trying to gain time learning Prolog. Those ones understand the difference in between languages but time is precious …

As for categories : beginners / intermediate / skilled / experts are quite a good split.

At the end many reasons, many backgrounds etc. so the reason why people get to it do not matter. What matters for the future of Prolog and SWI prolog in particular is that they find something that make them want to learn more and use it … What everybody knows too from the web is that the landing page matters and that visitors do not spend time if they don’t find what they want … or they really really need to be motivated :-p

As for making learning easy knowing that the web made users be perpetual impatient and unsatisfied users :

  • concrete short examples (what i name '2 lines examples)
  • concrete longer examples to see a real use, what @Boris named “daylife” or some others could name “toys”
  • real examples to understand how that works in a more complexe use
    … i-e in those 3 cases, things done to learn on a try and retry basis.

As i also mentionned, many books on internet are good references but often outdated in their examples as Prolog evolved. Many also said that Stackoverflow is often not relevant as for its classification of what is good or bad solutions. And i don’t even talk about the fights in between the community members …

Personally i think that the page that @jan added is a good start in that way of making new users have a landing page … then examples on predicates pages are important to see a real use. Today i also pointed out the example of reverse/4 versus reverse/3 . Even if the latest is the bugging example (as showed in a few lines by @Jan) of Learn Prolog Now that you find in different sources, it is interesting to keep and document it as it is a way to better understand Prolog programming.

etc. i could also add that many people being from different horizons, the diversity matters too especially on the longer examples. Anyway a point to keep in mind (anyway it is the way i fell it) … programming is fun … and Prolog should be fun too …not just for the skilled or experts in Prolog … which means the importance of the community to open the doors sharing their knowledge and contributing.

Among other things, when i was student i headed different computing association at the same time teaching inn different matters. Moreover part of my family is in “teaching”. So that is why i make that rough split in terms of levels.

On my side i love languages, know 3 spoken languages, knew 2 dead ones, and know more than 10 computing languages (from machine language to more evoluate ones). So to reply to your “driving license” example what i mean is that when you have some background you often have a different way to look at new languages.

As for the 99 problems page this is the type of page that should also be in the learning space in what i name the funny way to learn a language.

And my example with reverse/3 versus reverse/4 would fit with your paddles making the difference in between a beginner and a skilled user … also why it is important to understand such an example too.

it’s why i named it “skilled” or for those already knowing other languages and needing not to crash or to understand why it crashed … frankly not so hard to understand once you know the logic behind it (for those who really need it) … on my side for now i have more problems understanding the DCG use escpecially because i do that at coffee time … for fun when i have time …

I may have been misunderstood = what i meant is having the brain and background structured … don’t ask students discovering computing even if they are skilled in Javascript to understand it … as for the ladder, people climb it at their speed. What matters to open doors is to know where to find keys.

Let’s say that i like trees or that my brain works in a strange way :slight_smile: as i found the reverse trick easy once explained. But i will have a look at the Gertjan van Noord trick meaning as i didn’t know that it was named that way and i suppose that it applies at more than just a reverse trick.

If i had a way to explain how my brain works with Prolog it is like water along a tree. My mathematics teacher hated me when I was student as i was visualizing things in spite of making calculation … Among other things i never knew my tables too as i was “seeing” the figures and doing additions and tricks in spite of learning numbers. As i said each one is different … so better not look at how people get where they are but make them feel comfortable and want to learn more …

Now i understand what you meant … sorry to have been long. My title “page for beginners” was because for now the SWI Prolog for beginners is “Tutorial/Gettign/Started” but is not really helping you to know where to start from 0 with Prolog. It is also why @Jan is going to add some kind of landing page focused on it

@Jan In the alternative points of reading (not for beginners and to enlarge the SWI Prolog website covered domains), what seems to be an interesting content to link to = Natural Language Processing Techniques in Prolog (union.edu). It looks like a useful link with DCG.

As a beginner myself, I totally agree: Real world examples could inspire people to start out with one of the oldest languages still in use…