4 ms·
Genuinely curious - does the need for logic programming often arise in general software development? Or do I have a narrow view of what Prolog is good for? (I'v
by mr_overalls 9y ago
Genuinely curious - does the need for logic programming often arise in general software development? Or do I have a narrow view of what Prolog is good for? (I've worked a few toy problems with Prolog back in uni, but don't actually know the language very well.)
- segmondy 9y agoLogic programming is programming. It's like saying does the need for procedural or OOP or functional programming arise in software development. It's a different style of programming, the mental state of the program when using prolog is to declare the rules that must hold true for the program to execute. You think less about state and more about logic. In my opinion, here's what's amazing about this. There are programs that you might have a hard time solving via other means that you can easily solve with Prolog if you know the rule. If you know the rules all you need to do is state the rules, and Prolog will find the solution for you. Besides being great for quick prototyping and application of rules. You can build complete systems with it. SwiProlog has HTTP, SSL, ODBC and even GUI support.
- sprior 9y agoI'm pretty sure I'm the only person in the world who can say this, but I've been working with SWI-Prolog as my home automation controller for around 15 years. Last year I rewrote the system to make use of a library to allow SWI to publish/subscribe MQTT messages for communication between the components. Logic programming just sounded like it would make sense for describing the behavior of a home automation system, and I think it works well.
- Jtsummers 9y agoAny chance you have anything publicly available on this? That sounds like an awesome application of Prolog.