Prolog isn't dead, it just doesn't seem to get a whole lot of attention these days. I use SWI-Prolog for prototyping and exploratory programming, and I didn't need a shovel and a lantern to install it. I don't think Prolog is practical as a fully standalone language, though. Like SQL, it has a model that strongly skews it towards certain kinds of problems, and which makes I/O and side effects awkward. I think it woul…
Re: Prolog implementation, in case you haven't already found it, the book Warren's Abstract Machine: A Tutorial Reconstruction , by Hassan Aït-Kaci, is pure gold for understanding the WAM. http://web.archive.org/web/20030213072337/http://www.vanx.or...
Who killed Prolog?
21–30 of 57 posts
Re: Who killed Prolog?
#22Re: Who killed Prolog?
#23What people wanted Prolog to do, it couldn't do. People wanted to step away from the control flow specification of imperative language, the message-passing of OOP, and let the compiler solve your problem for you by feeding it a specification of the constraints the completed system would follow. Prolog did not, and cannot do this, because it is not strong AGI. When people realized this, they gave up on it, because it…
Very much true. During my education I was massively disappointed in Prolog, because the programming process was something like this: 1) write it declaratively 2) figure out that your program will take days to complete 3) add ugly procedural hacks (cuts) to make it more efficient To an extent, you have this process in any language (write->measure->optimize) but typically not in a way that it forces you at gunpoint to…
However, any "real" Prolog program that I ever saw was really using it as a slightly odd procedural language.
Re: Who killed Prolog?
#24I'm amused at the general supposition that the FGCP was a failure. Yes, it failed to produce specific hardware that was commercially competitive, but the basic program of "applying parallelism to search and database tasks" behind it was the basis for Deep Blue, Google's web search and the infrastructure behind many a large scale system.
Re: Who killed Prolog?
#25Re: Who killed Prolog?
#26What people wanted Prolog to do, it couldn't do. People wanted to step away from the control flow specification of imperative language, the message-passing of OOP, and let the compiler solve your problem for you by feeding it a specification of the constraints the completed system would follow. Prolog did not, and cannot do this, because it is not strong AGI. When people realized this, they gave up on it, because it…
I am not sure that I fully agree. Even without that, Prolog is very useful for many problems.
Re: Who killed Prolog?
#27As mentioned in the article, Feigenbaum's and McCorduck's book on the Japanese 5th generation project had caused quite a stir in the USA, and I think that it made it easier for me personally to get IR&D funding for anything AI-ish.
Perhaps off topic: I view Prolog as almost a scripting language because most programs I wrote in Prolog were short and solved one little problem. The only long Prolog program I every wrote was a quick one week rewrite of a 5 week IR&D project that was a prototype battlefield simulator that I wrote in Lisp. I can't imagine writing a million line system in Prolog.
Re: Who killed Prolog?
#28Not to nitpick overmuch, but if functional, object-oriented and logic are the other styles of programming language, then surely the correct adjective to describe Fortran is procedural ? Object-oriented languages are also generally imperative—the contrasting term is declarative, which purely functional and logic programming languages are (to some extent). Interestingly, given the conclusions reached in the article, bo…
No, the original FORTRAN that the author is referring to wasn't procedural. FORTRAN II, a few years later, added subroutines to the language.
Re: Who killed Prolog?
#29Earlier quoted context omitted.
> I think it would be best to have a Prolog-like language > as a library (like Lua or SQLite), to embed it for rules > & scripting. You may be interested to know that there are various prolog Perl modules on CPAN, particularly AI::Prolog and Language::Prolog::Yaswi .
Perl isn't really my thing* , but I'll take a look at how they're implemented. I was thinking a C library with a C API that will make it easy to use from Lua, Python, Ruby, etc. Yaswi is probably just a wrapper to SWI-Prolog. There are a few of those, and I'm tempted to write one for Lua. I think designing a Prolog-like language primarily for embedding, rather than wrapping a standalone Prolog, will have an interesti…
It's a quick-and-dirty implementation of a Prolog interpreter, but it's a great resource for prototyping. JavaScript ports very well to Lua, so you should be able to port the code in a busy afternoon.
I made a couple of suggestions to increase the speed of the interpretation, but I'm not sure Jan ever integrated them into the code. The big one was using a trace to destructively modify environments rather than recreating them on choice points; WAM and tabling would be great, but it's a non-trivial piece of work following Warren's tech report, even with the help of the (very good) tutorial.
Re: Who killed Prolog?
#30Earlier quoted context omitted.
Perl isn't really my thing* , but I'll take a look at how they're implemented. I was thinking a C library with a C API that will make it easy to use from Lua, Python, Ruby, etc. Yaswi is probably just a wrapper to SWI-Prolog. There are a few of those, and I'm tempted to write one for Lua. I think designing a Prolog-like language primarily for embedding, rather than wrapping a standalone Prolog, will have an interesti…
Check out js-prolog: http://ioctl.org/logic/jsprolog-history It's a quick-and-dirty implementation of a Prolog interpreter, but it's a great resource for prototyping. JavaScript ports very well to Lua, so you should be able to port the code in a busy afternoon. I made a couple of suggestions to increase the speed of the interpretation, but I'm not sure Jan ever integrated them into the code. The big one was using a t…
I'm planning on doing a C VM-based implementation with tabling* . I'm not sure about coroutines, and the VM will not necessarily follow the WAM design verbatim - Peter Van Roy has several suggestions for improvements in his thesis.
* Prolog-ese for memoization