4 ms·
So I've been interested in learning prolog ever since I found out it was a language used for AI. I am wondering if it is worth picking up now? Does it change t
by hpoe 7y ago
So I've been interested in learning prolog ever since I found out it was a language used for AI. I am wondering if it is worth picking up now?
Does it change the way one things about interacting with a computer or a problem?
Is it something that will soon grow?
- simplify 7y agoProlog is fundamentally well established (~40 years old), and you can start using it today in several programming languages. For example: JavaScript http://tau-prolog.org http://tau-prolog.org Ruby https://github.com/preston/ruby-prolog https://github.com/preston/ruby-prolog Rust https://github.com/mthom/scryer-prolog https://github.com/mthom/scryer-prolog Erlang https://github.com/rvirding/erlog https://github.com/rvirding/erlog If your language is missing one, implementing a basic Prolog is fairly simple. Take a look at the Ruby one: it's core is not even 500 lines of code! There are also great options like SWI Prolog if you want to build your entire app in Prolog. But I imagine it would be much easier to convince a work boss to pull in a library instead :) Re AI: It's true that Prolog's origins involved AI, but nowadays Prolog is better suited for more general logic programming tasks (there are better tools out there for AI specifically).
- MisterTea 7y ago> Erlang https://github.com/rvirding/erlog https://github.com/rvirding/erlog Fun fact: Erlang started out as a modified version of Prolog. The original Erlang VM was written in Prolog as well.
- girzel 7y agoMy guess is that Prolog was more of an AI thing back when people were doing symbolic AI (including Lisp), instead of the statistical shotgun it's latterly become. Prolog is very good at NLP programming, and BNF grammars, and those things were important to an earlier approach to AI.
- valesco 7y agoI am sure they will come back, probably in combination with other recent techniques. We still need an AI that understands what it's doing. Disclaimer: I'm an ignoramus.
- JimmyRuska 7y agoProlog is a general purpose programming language. You can use it to implement provers, optimization problem solvers, or generally use it as a unification algorithm engine and database. You could say prolog has branched many ways. There are many similar languages now which take some aspect prolog did well and made it better. Problog, Mercury, Picat, logtalk, Allego Graph prolog There's also datalog, which is like the logic database subset of prolog. There's datomic, datahike, datascript, dlv, abcdatalog, racket datalog. Then there's the RDF / Semantic web side, which feels a lot like datalog. There's many reasoners for triple stores which work like logic databases. RDFox is also a bleeding edge datalog implementation for incremental materialization, you can use it as a business rules engine as well as a database, it keeps recursively derived facts always up to date even as you add new facts. The biggest triple store implementation is probably wikidata. AI / ML these days try to find patterns in data and reproduce those patterns reliably. Many of the use cases with prolog and prolog-like languages are more about feeding in known facts, and deriving more facts, implications, putting models that represent known and relationships and rules between facts and hierarchical state. Who ever finally makes an ML capable of general intelligence, I'm willing to bet they will interface neural network technologies with a modifiable fact database capable of generating models for the rules and relationships between facts and the hierarchy of those facts. Probably a lot of this declarative yaml state used in devops these days could benefit from prolog-like logic for drift detection, alerts and recovering broken configurations automatically. Any type of big data DAG that has constraints of complex implications of specific paths can benefit from logic programming. If you have a complex knowledge base like a legal corpus, it can help massively narrow down research needed by asking simple questions that half the search space each time. People have used it for NLP for it's pattern matching abilities. You can reuse the same function against multiple patterns.
- deleted 7y ago[deleted]
- ragebol 7y ago> Does it change the way one things about interacting with a computer or a problem? Yes, I think so. Even is you just spend an evening going through http://www.learnprolognow.org/ http://www.learnprolognow.org/ that's a gain. > Is it something that will soon grow? I have no reason to expect that.
- ianandrich 7y agoThe last two Prolog 8 week intensive classes put on by the SWI-Prolog community have taught more than 400 people modern Prolog, so yes its growing and depending on what kinds of problems you're dealing with it may be worth picking up now. Like most tools that give companies a serious competitive advantage they aren't really talking about it. Does it change the way you think about programming? Definitely. Prolog gives me the tools to solve the right problem the right way in ways I'd be scared to attempt in other languages. Consider the following scenario. You run a forum. It's super succesful. You now need to implement access control. In most languages I think white lists. Then you need to add a blacklist, then some sort of inheritance, then its a mess. In Prolog going straight for role based access is 50 lines of code. Tops.
- carapace 7y ago> Is it something that will soon grow? Yes, like a tree. It took me twenty years to notice Prolog. I wish I had picked it up twenty years ago.