Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Cover of Clause and Effect

    Clause and Effect

    William F. Clocksin · 2003

    A workbook for programmers who are new to Prolog and who wish to write useful Prolog programs. An outline of basic concepts is interleaved with worksheets, which are graduated in scope and give guidance for practising new ideas. Extended examples in the form of case studies then apply the ideas.

    ProgrammingAI & Machine Learning
    Open LibraryAmazon
    Stats for nerds
    7recommend
    20mentions
    8people
    2008–2026years
    85% recommend15% neutral

    Mentions per year

    2008201020122014201620182020202220242026

    What Hacker News says

    1. dmpk2kJan 2026
      The only decent Prolog book out there, IMNSHO, is "Clause and Effect" by Clocksin. Maybe some of the later chapters might help?

      All the other books that I looked at were pretty awful, including the usual recommendations.

      thread
    2. z5hOct 2024
      So first, let's keep in mind that with no execution model, Prolog is still a "syntax" for Horn clauses. It's still a way to document knowledge. Add SLD resolution and we can compute. The paper (intentionally I presume) orders clauses of a simple predicate to illustrate (cause) a problem in Prolog.

      But what I actually find is the more time spent in Prolog, the more natural it is to express things in a way that is clear, logical and performant. As with any language/paradigm, there are a few gotchas to be experienced. But generally speaking, SLD resolution has never once been an obstacle (in the past 2 years) of coding.

      The general execution model of Prolog is pretty simple. The lack of functions actually makes meta-programming much clearer and simpler. A term is just data, unless it's stated as a goal. It's only a valid goal if you've already defined its meaning.

      So I'd be concerned that Curry gives up the simplicity of Prolog's execution model, and ease of meta-programming. I struggle with the lack of types in Prolog, but also know I can (at least in theory) use Prolog to solve correctness problems in Prolog code.

      I'm currently using SWI-Prolog. Performance is excellent, it has excellent high-level concurrency primitives[0] (when was the last time you pegged all your cores solving a problem?), and many libraries. I might be one of the few people who has committed to using the integrated editor (PceEmacs) despite being a Vim person. PceEmacs is just too good at syntax highlighting and error detection.

      At the same time, I'm a huge fan of Markus Triska. His Youtube[1] stuff is mind-expanding (watch all of it, even if you never write Prolog). He has an excellent book online[2]. I admire the way he explains and advances pure monotonic Prolog, and I appreciate the push for ISO conformance and his support for Prologs that that do the same (SWI is not on that list).

      If you want to learn Prolog, watch all of Markus Triska's videos, read his book, and learn what Prolog could be in a perfect world. Then download SWI-Prolog, and maybe break some rules while getting things done at a blazing speed. Eventually you'll gravitate to what makes sense for you.

      The Art of Prolog is a classic "must have". Clause and Effect is a good "hit the ground running" (on page 70 you're into symbolic differentiation via term rewriting).

      0 https://www.swi-prolog.org/pldoc/man?section=thread

      1 https://www.youtube.com/@ThePowerOfProlog

      2 https://www.metalevel.at/prolog

      thread
    3. stassJan 2021
      For starting out I'd recommend Clause and Effect by Clocksin. It's a very short but practical introduction with really good examples along the way (including symbolic differentiation and FFT).
      thread
    4. segmondyAug 2019
      Not even comparable. The OP posted a book, but you posted is a guide of no more than 30 pages.

      Novice: Adventure in Prolog Learn Prolog Now Logic Programming with Prolog

      Med - Advanced: Clause and Effect The Art of Prolog The Craft of Prolog Wam Book The Practice of Prolog Prolog Programming for AI - Brakto

      Deep Dive: Expert Systems in Prolog Natural Language Processing for Prolog Programmers Intelligent Image Processing in Prolog Representing Knowledge In Prolog

      There are hundreds of books! The real gems are to be found in papers, look into published papers, you will find amazing topics on Meta Programming, Machine Learning, Compiler Construction, DCG, etc. Don't discount books by age, even if they were published in the 80s! The best books are from the 80's-90's.

      A few sites https://www.metalevel.at/ https://www.cpp.edu/~jrfisher/www/prolog_tutorial/contents.h...

      Use SWI-Prolog - https://www.swi-prolog.org/

      thread
    5. segmondyNov 2014
      This is not only possible in Lisp, this is also possible in Prolog. In Prolog, Data is code. LISP can be viewed as a specialization of Prolog, where the data structure just lists. Prolog has more complex data structure compounds, where a list is nothing more but one type of said compound structure. One can write Prolog code to emit 6502 code or any code as well, and I suspect with as much ease as he did.

      Here is a sample of code generation in Prolog for register machines, https://github.com/segmond/PrologThingz/blob/master/clause_a...

      An example for accumulator based machines which the 6502 https://github.com/segmond/PrologThingz/blob/master/clause_a...

      The examples I posted is from an awesome Prolog book I read called "Clause and Effect"

      thread
    6. silentbicycleAug 2011
      Cleaner, yes. I picked OCaml because it seemed easier to find information about, and more widely ported.

      Also, I think most people fail to appreciate how useful compiler techniques are outside of "compilers". Even just knowing a little about lexing and parsing goes a long way.

      For Prolog, I'd also recommend _The Art of Prolog_ by Sterling & Shapiro and/or Clocksin's _Clause & Effect_.

      thread

    Related

    Cover of Computer
    2012–2022

    Computer

    Martin Campbell-Kelly
    3 recommend · 4
    Cover of Programming in Prolog
    2009–2026

    Programming in Prolog

    William F. Clocksin
    8 recommend · 22
    Cover of The art of Prolog
    2009–2026

    The art of Prolog

    Leon Sterling
    36 recommend · 114
    Prolog Programming in DepthMichael A. Covington
    2009–2025

    Prolog Programming in Depth

    Michael A. Covington
    4 recommend · 5
    Cover of Logic in Computer Science
    2008–2025

    Logic in Computer Science

    Michael Huth
    5 recommend · 9
    Cover of Prolog and natural-language analysis
    2010–2025

    Prolog and natural-language analysis

    Fernando C. N. Pereira
    6 recommend · 11
    Cover of Prolog programming for artificial intelligence
    2009–2026

    Prolog programming for artificial intelligence

    Ivan Bratko
    10 recommend · 17
    Cover of Paradigms of Artificial Intelligence
    2007–2026

    Paradigms of Artificial Intelligence

    Peter Norvig
    63 recommend · 169