LogicProgramming

ThoughtStorms Wiki

(ReadWith) PrologLanguage

Detail :

Quora Answer : Why is the logical programming paradigm (like in Prolog) not popular in modern programming languages, and what would be the result of mixing it with OOP?

Dec 6, 2018

1) Why is logic programming not popular?

Partly because, it's true, we aren't taught it as rigorously and we don't practice enough with it.

That, in turn, is because most programmers are self-taught and self-motivated. We learn in order to be able to build stuff. As teenagers we want to build games or cool apps.

Logic programming doesn't have these kinds of obviously attractive applications, so few of us as kids or self-motivated learners drill down into it to achieve our first attempts at making software. We have to build up more experience and more "exotic" / "geeky" tastes before we're likely to try teaching logic programming to ourselves. (Something I'm starting to do at the moment.)

So most of us are just less experienced. And therefore find it harder.

2) Mixing two very different paradigms like OO and logic usually means that one paradigm has the upper hand and the other is a small embedded part.

The most common way to do that is to use something like miniKanren, which can be embedded into other languages, including OO ones.

Even as a hardcore OO programmer, it's worth adding miniKanren to your arsenal. A bit of logic programming embedded in your OO program can be as useful as regexes or having an SQLite database.