The Power of Prolog
I&#x27;m currently trying to learn Prolog. Reason is because I attempt to reignite my enthusiasm for IT by going back to the roots. And the joy of learning new programming languages &#x2F; paradigms was what brought me into the field more than 20 years ago.<p>I find Prolog very challenging for several reasons. I identified 3 levels of difficulty with it:<p>1) Syntax<p>2) Reasoning and Paradigm<p>3) Implementation<p>1) is things like &quot;\=&quot; for not equal. Those are mostly just inconveniences and Prolog&#x27;s age is showing there. But I still don&#x27;t have a firm grip on the pattern matching of lists.<p>2) is the whole stuff around switching mentally from functions to predicates. I often find myself trapped in trying to reason functionally and if I was very proficient in functional programming that might even work. But so far I&#x27;m still at the level of trying to wrap my head around the fact that there no return values and that sequencing via comma (which is actually a conjunction - AND) will be evaluated &quot;kind of&quot; procedural by serial evaluation. This makes it seem familiar but conflicts with the actual paradigm.<p>3) is the most critiqued aspect of it. There are many Prolog implementations it but they all seem to suffer from the same problems. Like Prolog getting lost in some tree which forces the developer to understand what the interpreter is doing to help it find the right branch. Also the aforementioned confusion that logically (A AND B) is identical to (B AND A) but in Prolog isn&#x27;t and can make the subtle difference between the program finishing successfully or running until memory is consumed.<p>In my opinion there is reason why Prolog is one of those subjects that are brought up here again and again and again but without any justification with regard to something about it being &quot;news&quot;. It&#x27;s a very fascinating paradigm and I find it very sad that it doesn&#x27;t really get any attention today. Just check the list of literature about it - there&#x27;s almost nothing and what there is either old or distinctively academic.<p>One reason clearly is the lack of convenient interfacing to other languages. Because even a Prolog genius would probably admit that there is no point in trying to implement anything IO with it.<p>I&#x27;m working through Learn Prolog Now. Which is a good book. Already ordered Prolog in Adventures. I could see several projects for it that would be a natural fit but I already anticipate that eventually my enthusiasm will fade at the point where I&#x27;m forced to dig into SWI as soon as I leave the toy level. SWI is also kind of weird. It seems to be the best choice but there are surprisingly trivial aspects about it that I find very unsatisfying (I can load a DB with &quot;[filename].&quot; but I cannot purge it before loading another DB without restarting the session ... or does somebody know how that&#x27;s done?). That&#x27;s basically what I observe as far as my as well as other people&#x27;s experience goes with it: very promising and exciting but eventually disappointing. It shouldn&#x27;t be like that.<p>I also believe that symbolic AI &#x2F; Prolog and deep learning could very well benefit from each other.