Live data from Hacker News

Ask HN: Production Prolog in 2020?

news.ycombinator.com

31–40 of 72 posts

Re: Ask HN: Production Prolog in 2020?

#31

I think Prolog and logic programming will have a second renaissance. I think at the very least a general artificial intelligence would require a logical inference engine similar to Prolog.

I doubt it. Prolog is inherently based on DFS that usually leads to inefficient algorithms. Cut operator then turns any source into an unreadable mess.

Re: Ask HN: Production Prolog in 2020?

#32

Our pay software at work needs a Prolog engine (SWI). I think it's exactly where it shines : a complex logic with a lot of small rules that would be a nightmare to implement and maintain with a if / else logic.

I implemented something similar to that at a payments company a while back, but not with prolog because I couldn't get buy-in. I wrote a rules engine expressed as SQL tables, and it was absolutely better than if-else or switch. It let us delete thousands of lines of code and also slap on a UI so that the people managing the payments rules could make changes themselves. Highly recommend.

In my experience, "logic wants to be code, and not data". Ie it's a dangerous (although sometimes necessary) step to move this into the data domain. Did you encounter any difficulties with missing source control, being able to use debugging tools, etc?

Re: Ask HN: Production Prolog in 2020?

#33

Our pay software at work needs a Prolog engine (SWI). I think it's exactly where it shines : a complex logic with a lot of small rules that would be a nightmare to implement and maintain with a if / else logic.

At this point, I feel like it is verging into lost knowledge territory, but that use case is almost the exact use case for the Rete Algorithm. As long as your rules fit in memory and are not recursively applied, rule application is an O(1) operation.

https://en.wikipedia.org/wiki/Rete_algorithm

Re: Ask HN: Production Prolog in 2020?

#34
post #21
post #3

Earlier quoted context omitted.

Do any of the non-artificial intelligences walking around out there contain a logical inference engine similar to Prolog?

Yes. Logic wasn't conjured up from abstract ideas, but from a concerted effort to distill the essence of what humans (regular, average people) find reasonable and convincing. (To mention just one example, there is a reason one of George Boole's major works is called "The Laws of Thought".) Our strategies for understanding language also involve inference and unification that is similar to logic programming. This is no…

I have no doubt that human or other intelligences can emulate and even to some extent intuit these rules. If you believe that's a _requirement_ for their intelligence, I think that's a stronger claim. Not one I'd vehemently argue against, but not one I'd personally be comfortable making.

Re: Ask HN: Production Prolog in 2020?

#35
A tangeant question is: Which non-niche language are having push for integrating a subset of logic programming extensions ?

There was a (unlikely to be merged at least in its current form) proposal for Kotlin -> https://github.com/Kotlin/KEEP/pull/199/files

Maybe LINQ from .NET could be included

There is also chalk from Rust https://github.com/rust-lang/chalk

Re: Ask HN: Production Prolog in 2020?

#37
post #3

Earlier quoted context omitted.

Do any of the non-artificial intelligences walking around out there contain a logical inference engine similar to Prolog?

Do any birds flying around have engines?

I want to agree with you, but I also want to agree with the hypothetical rebuttal GP is making in my mind:

> Yes, they do have engines similar to those found in planes, cars, etc. and so do humans - fuel goes in, chemistry happens, and energy is provided for physical movement in the form of rotation, flapping, or one foot in front of the other.

Idk who I agree with, I suppose it's a fairly pointless exercise in 'how similar constitutes 'similar'' all the way down.

Re: Ask HN: Production Prolog in 2020?

#38
Kind of offtopic, but does anyone know a good resource around implementing a simple prolog/similar language? My previous attempts at learning logic programming have failed, and it just _feels_ like a thing that becomes clear after you've seen how it works under the hood.
Post reply on HN