4 ms·
In my opinion, this is true for some main points, but definitely not for all of them. A key difference between the languages is in how easily you can reason ab
by triska 8y ago
In my opinion, this is true for some main points, but definitely not for all of them.
A key difference between the languages is in how easily you can reason about programs. In Prolog, if you program in the pure monotonic subset of the language, you get certain algebraic guarantees that are not available in Lisp. For instance, for pure Prolog code and a declarative reading, removing a goal can at most increase the set of solutions, and removing a clause can at most decrease the set of solutions.
In Prolog, these guarantees can be used to test and debug your programs by logical reasoning. In fact, to a significant extent, you can even automate debugging due to these properties. Such techniques were pionereed by Ehud Shapiro in his 1982 PhD thesis, Algorithmic Program Debugging:
http://cpsc.yale.edu/sites/default/files/files/tr237.pdf http://cpsc.yale.edu/sites/default/files/files/tr237.pdf
The thesis is an excellent read, and I highly recommend it! Specifically, quoting from page 155:
“Although Lisp is considered a high level language, it is not
clear that it encourages precision and clarity of thought. As one
Lisp hacker puts it [91]: "Lisp...is like a ball of mud. You can
add any amount of mud to it...and it still looks like a ball of
mud!". This aspect of Lisp is the hacker's delight, but the
theoretician's nightmare. It is known that one may implement
without too much effort a reasonable Prolog in Lisp. However, the
issue is not implementation — the issue is the method of thought.
Based on my experience with both languages I maintain that one's
thoughts are better organized, and one's solutions are clearer
and more concise, if one thinks in Prolog rather than in Lisp.”
Another key feature of Prolog is that constraints blend in seamlessly, leading to an important declarative programming paradigm called constraint logic programming (CLP). This is the key reason why Prolog is frequently used to solve combinatorial tasks in practice, and often an important motivation for buying a commercial Prolog system.
- lispm 8y ago> Although Lisp is considered a high level language Lisp is generally not restricted to a particular 'level'. It also comes out-of the box with support for different programming paradigms - but no particular language support for logic programming. > if one thinks in Prolog rather than in Lisp Lisp supports high-level programming in logic by zillions of extensions. This has been popular throughout Lisp's history. Thus if we have a problem which is best solved by some kind of Logic, then it would be great of the Lisp system could be programmed in terms of that logic - which is not unusual. That said, a programming language built from the ground on some logic formalism like Prolog is a great tool.