5 ms·
How is it with Prolog practitioners, did it make 'click' at some point where you then suddenly approached problems differently or was it more of a slow change w
by tonyjstark 6y ago
How is it with Prolog practitioners, did it make 'click' at some point where you then suddenly approached problems differently or was it more of a slow change where you incorporated more and more ideas from Prolog in your daily work until you realized that you got it?
- pjbk 6y agoFor me it was a slow progress. Takes a while to grab the paradigm shift and unwind some mental schemes if you are used to imperative languages and you want to start thinking in declarative terms in a way that you can be productive as a Prolog programmer. That being said, learning about the inner workings of Prolog and how the WAM (Warren abstract machine) is composed helped me a lot to adjust my programming skills and align them to how things are best coded in the language.
- cpdean 6y agoSomething that is still a difficult hurdle for me to overcome is how Prolog starts out feeling declarative but then very quickly you need to be aware of all the backtracking rules to correctly guide Prolog to the solution you want. I have tried to get through Clocksin's Programming in Prolog a couple times now and it still hits me how quickly you need to get into the invisible details nobody blogs about in order to be even base-level productive in it.
- rscho 6y agoHave a look at the "power of prolog" YouTube channel (and website) by Markus Triska.
- YeGoblynQueenne 6y agoYou do need to keep both the procedural and declarative reading of Prolog programs in your head at the same time, yes. But there is such a thing as a "pure subset" of Prolog that doesn't use a) cuts, b) the dynamic database or c) destructive assignment (with arg/3 etc) and if you stay in that pure subset you can go a long way before you need to think procedurally. But to be honest, myself I prefer to switch between the two paradigms at will when thinking about my programs. The trick is to do it in a way that leaves you with the best of both worlds, rather than the worst. In terms of sources that go into more advanced material and avoid excessive procedural thinking, one is Markus Triska's website recommended in the sibling comment and I would also recommend Richard O' Keefe's "The Craft of Prolog" and Sterling and Shapiro's "The Art of Prolog". To be fair, you won't find a lot of Prolog material in blogs so you can expect a lot to be left unsaid in the few that exist.
- pjmlp 6y agoWhen I learned Prolog I already had a semester of logic math so it felt natural. It is already a bit old, but you might have a look at it. https://www.gradegrinder.net/Products/tw-index.html https://www.gradegrinder.net/Products/tw-index.html
- longcommonname 6y agoIt took a few months, working In a massive multiple million lines of code "rules engine". The first bit was really understanding how recursion works and how to trace the code. After that close understanding of logical operations like cut, or negation, and the most important was how certain operations could really impact performance to the point the were mostly "outlawed". It's been years since I've used prolog, but I could probably pick it back up in a few weeks.