News for hackers. Stuff that matters.
Re:Guitar Chord Voicings with Prolog by hpoe on Tuesday April 21, 2020 @09:41PM (#22941183)
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?

Re:Guitar Chord Voicings with Prolog by simplify on Tuesday April 21, 2020 @10:00PM (#22941273)
Prolog 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

Ruby https://github.com/preston/ruby-prolog

Rust https://github.com/mthom/scryer-prolog

Erlang 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).

Re:Guitar Chord Voicings with Prolog by MisterTea on Wednesday April 22, 2020 @06:20AM (#22944063)
> Erlang 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.

Re:Guitar Chord Voicings with Prolog by JimmyRuska on Tuesday April 21, 2020 @11:40PM (#22941874)
Prolog 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.

Re:Guitar Chord Voicings with Prolog by ragebol on Wednesday April 22, 2020 @02:20AM (#22942808)
> 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/ that's a gain.

> Is it something that will soon grow?

I have no reason to expect that.

Re:Guitar Chord Voicings with Prolog by ianandrich on Wednesday April 22, 2020 @02:37AM (#22942884)
The 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.

Re:Guitar Chord Voicings with Prolog by carapace on Wednesday April 22, 2020 @03:15AM (#22943039)
> 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.

Re:Guitar Chord Voicings with Prolog by girzel on Tuesday April 21, 2020 @11:07PM (#22941654)
My 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.
Re:Guitar Chord Voicings with Prolog by valesco on Wednesday April 22, 2020 @04:50AM (#22943518)
I 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.