5 ms·
In my opinion there are mainly three reasons why Prolog is not popular. The reason is that declarative languages in general are not as immediate as imperative
by domenico_c 9y ago
In my opinion there are mainly three reasons why Prolog is not popular.
The reason is that declarative languages in general are not as immediate as imperative languages. Nothing intrinsic about declarative languages themselves, this has to do mostly with the fact that we are taught and we are exposed to imperative languages first and then we hear about other more "exotic" paradigms.
Second issue. In a sense, the elegance of the language has been the biggest weakness. The academics loved to play with conceptual matters. A lot of effort went into papers on semantics and mapping different types of reasoning but not much into tools, IDEs, or compilers. The community didn't make enough libraries, built the right abstractions and software engineering practice. Every time you start a project in Prolog you are starting from scratch.
Also, the elegance of the language is the reason a lot of people approaching Prolog get quite demanding. "It's logic programming so why do we have to use a cut?". Yet most programmers have no problems with the quirks of C++ or Java.
The third one is Prolog hasn't found it's excellence area. C, Go, Scala, Java all have their on strengths and scenarios where they are the best candidates. Prolog would make in theory an excellent candidate for representing complex domains based on rules, covering a module of a larger piece of software. It would be perfect to represent the rules of a board game or the knowledge of a chatbot, but for a number of reason that's no happening. How does the reasoner scale with larger datasets? Will it be hard to manage? Is there an example of something similar being attempted?
In my very personal opinion, as a community we should learn from these lessons, take the best bits of Prolog and make something new.
At Grakn.ai (https://grakn.ai/ https://grakn.ai/) we are working on a graph database that uses an inference layer that is based on Prolog's resolution, maybe worth having a look. The idea there is that Prolog maybe shouldn't become a great general-purpose language but its bests parts must be used as a base for the next advances in knowledge representation and reasoning.
- zmonx 9y agoGrakn was also recently posted on HN: https://news.ycombinator.com/item?id=14471238 https://news.ycombinator.com/item?id=14471238 In that thread, I show how you can express the sample relation in Prolog. Maybe you can go into more detail, either here or in that thread, on the advantages of Grakn over Prolog for such cases?
- domenico_c 9y agoSomeone from my team replied. Thanks for taking the time to start the discussion on the comparison, we have a few people with a computational logic background here and we plan to publish a blog post on the topic soon!
- zmonx 9y agoPerfect, I am looking forward to reading the blog post! I hope it will also mention Prolog as an important influence. As to your second issue above: Please note that there are many collections and even entire books that describe antipatterns of Java, C++ and many other programming languages. In my experience, programmers from these communities quickly learn to avoid these antipatterns. In the Prolog community, this happens more slowly, but it does happen too. There are very good reasons to avoid !/0 and other impure constructs in logic programs. In my view, the key issue is to find and teach better constructs that should be used instead, and the best alternative language constructs are still waiting to be discovered. In this spirit, I fully agree with you that we should keep Prolog's best aspects, and extend them as far as we can into the directions we need.