Hacker News new | ask | show | jobs
by tbensky 1478 days ago
I've been using Prolog on and off for 20+ years (I actually bought and used Turbo Prolog by Borland under MS-DOS). I have to confess though, I've never quite understood Prolog or what it's for. I've followed Markus Triska and his Power of Prolog videos (watched all of them). I'd like to thank him for his work. This fellow is super smart about programming, and he appears to be singlehandedly re-inventing Prolog. His videos are of the highest quality content. I've learned so much from his work, particularly in the area of CLP. I've now come to understand Prolog as a search language, and he's convinced me that CLP+Prolog are the next generation of Prolog as compelling tool. (I do a bunch of work in personnel scheduling/optimization and have mostly used genetic algorithms to this point. I'm seeing more and more uses of Prolog in this area thanks to Mr. Triska.)
1 comments

I have studied Prolog from time to time over the years and occasionally I run across problems where it strikes me Prolog would be useful but I've never been able to justify adding it.

Lately I've encountered more offline/batch processing problems and I am planning to work on some reimplementations of my solutions in our usual languages using Prolog (as soon as I have some free time, so none too soon).

Doctor Dobb's Journal had a cool article once about using Prolog to prescribe medications, in particular avoiding conflicts with other prescriptions. It would have been in the early 2000s. According to the author, they used Prolog to rewrite the app from a tangled mess of nested if statements. After the rewrite, the rules could be managed by pharmacists instead of programmers. It seemed like a good application to me. I studied Prolog in college but have never used it professionally. I keep hearing good things about Datalog, which I know even less about. . . .
That's a cool case study!

It hits right at the core of the appeal (these kind of solvers need to be designed, if you grow them organically you get the if statement from hell) and also the challenges (not many managers would run with the idea of "the users will be doing something that looks a lot like writing code").