Live data from Hacker News

Ask HN: Production Prolog in 2020?

news.ycombinator.com

51–60 of 72 posts

Re: Ask HN: Production Prolog in 2020?

#51

Is this related to Datalog also? I've watched a few presentations by Rich Hickey (creator of the Clojure programming language) and I feel like he often name-drops Datalog as a great tool.

> Datalog is a declarative logic programming language that syntactically is a subset of Prolog.

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

Re: Ask HN: Production Prolog in 2020?

#55
post #47
post #42

Earlier quoted context omitted.

LINQ is just in-language SQL with type checks, unless I'm ignorant of a bunch of its functionality (which I really hope is true, now).

There's a lot more to LINQ than that. LINQ is extensible and you can connect it to arbitrary data sources by writing a query provider. awesome-linq[0] has some examples of what can be done with it. [0] https://github.com/aloisdg/awesome-linq

Oh sure yeah, but I don't think it has any logic/constraint programming functionality.

Re: Ask HN: Production Prolog in 2020?

#56
post #34
post #21

Earlier quoted context omitted.

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.

I don't believe we emulate a set of rules that were somehow arbitrarily created at some point in history. I believe logic is something we discover (not invent) and it has roots in both human cognition and the physical world, and it's not fully known or understood exactly how they emerge. Hence, logic is still a developing field, and logic programming has indeed contributed to it.

"Intelligence" is a vague term, but if you mean the ability to act rationally or even in a coherently self-interested way, then surely logic has something to do with it.

Re: Ask HN: Production Prolog in 2020?

#57

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.

Along with @btwillard's suggestion, check out The Reasoned Schemer, it goes about explaining miniKanren and gives enough information to implement it yourself. It's a fantastic exercise.

Re: Ask HN: Production Prolog in 2020?

#58
post #21

Earlier quoted context omitted.

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…

Plotkin's thesis! You had an interview with Kowalski ? Wow :)

You're on my wish list for interviewees too :)

Re: Ask HN: Production Prolog in 2020?

#59

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

Not completely lost! In some sections of industry, Rete-based rules engines are used pretty extensively. A very interesting take is Clara, implemented in Clojure: www.clara-rules.org

Re: Ask HN: Production Prolog in 2020?

#60
post #58

Earlier quoted context omitted.

Plotkin's thesis! You had an interview with Kowalski ? Wow :)

You're on my wish list for interviewees too :)

Wot me? Haha! Wait another 20 years maybe! But thanks, that's so kind :D
Post reply on HN