
Prolog for Programmers - ColinWright
https://sites.google.com/site/prologforprogrammers/
======
roberthahn
I found this (closed) SO question asking what Prolog is good for in the real
world. ([http://stackoverflow.com/questions/130097/real-world-
prolog-...](http://stackoverflow.com/questions/130097/real-world-prolog-
usage))

I think it's a great question, so I'm going to re-ask it here: What do YOU use
Prolog for?

One reason why I'm interested in Prolog is because I used to work at a
semantic web company[1], and it seems to me like Prolog could work well in
that domain.

Thanks for posting this resource. I'd love to learn more. So much to do, so
little time!

[1][http://primal.com/](http://primal.com/)

~~~
Vektorweg
I try to write a little database system in Haskell, inspired by Prolog,
because it seems very natural and simple to query Prolog. If you have lots of
different relations between data, Prolog is a good choice.

------
_nato_
The father of Erlang, Joe Armstrong, lauds this language every time he gets a
chance. And I think the hate on Erlang syntax comes from the fact that a first
stab at Erlang was done with Prolog. But I actually like the Erlang syntax
after I got used to it. It reads like English ~

~~~
anth1y
Is there a more accessible intro to Prolog for someone who is a sysadmin and
is trying to write more code.

~~~
nick_dm
I recently started reading
[http://www.learnprolognow.org/](http://www.learnprolognow.org/) and the first
few chapters have been excellent. There are exercises and practical sections
at the end of each chapter too (unfortunately I haven't had time to look at
them in detail yet).

~~~
anth1y
Thanks everyone much appreciated

------
Shamanmuni
I'd like to learn Prolog and Logic Programming but I don't know when it's
better than the other paradigms, its shining moment. Could anybody help me?

I mean, Imperative Programming shines when you aim for efficiency in the usage
of the computer resources. Functional Programming shines when you need
concurrency and parallelism. Object Oriented Programming shines when you are
building a GUI. All these paradigms have their sweet spot and will make your
life easier in certain situations.

What's Logic Programming sweet spot? I've read about puzzle games as good
examples for this paradigm, but I suppose there are stronger examples for it.
Maybe AI? Is it used in that field?

Edit: I have just read roberthahn comment, thanks for your insight and the
link!

~~~
nrub
Check out Datalog the query language used to interact with Datomic,
www.learndatalogtoday.org

William Byrd & Daniel Friedman wrote a book called the Reasoned Schemer, which
walks through the implementation of a Prolog like logic language called
MiniKanren, check out a recent presentation they gave where they show quite a
few interesting examples and uses,
[http://2013.flatmap.no/danwill.html](http://2013.flatmap.no/danwill.html)

I know this is not a definitive answer, but having a look at those resources
may highlight some of the areas where logic programming can be very useful.

~~~
seanmcdirmid
Its also not that hard to build a backward (prolog) or forward (datalog)
chaining predicate rule system in whatever your favorite language is; as a
bonus, you'll get to learn the joys of unification, or go crazy with some
higher order predicates.

Once you get bored with unification, then look at dealing with inequalities
and learn some constraint solving. Prolog and datalog look quite simplistic
compared to some of the more developed logics out there.

------
pjungwir
I had a taste of Prolog in college and always wanted to learn more, especially
after reading this Dr. Dobb's article about using it for a vaccine scheduling
app:

[http://www.drdobbs.com/database/building-a-custom-rule-
engin...](http://www.drdobbs.com/database/building-a-custom-rule-engine-with-
prolo/184405583)

With all the interest these days in DSLs, I feel like knowing when/how to
embed Prolog into larger applications could be a great tool in my toolbox.

