Live data from Hacker News

The Simplicity of Prolog

bitsandtheorems.com

131–134 of 134 posts

Re: The Simplicity of Prolog

#131
post #128

Earlier quoted context omitted.

I really don't care what you "admit". Now you're saying that it doesn't matter whether Prolog has predicates as first-class values, and yet you keep arguing that it does have them. I don't think you're here anymore to establish what statements about Prolog are true or false. You're here for a fight; I'm not here for a fight. Go fight yourself. Not for you, but purely for the benefit of unfortunate souls who wander by…

> The user has no realistic way of implementing the `call/N` builtin themselves. Not sure what you mean by realistic, but `call/1` can be implemented by having one simple rule for each existing predicate (now for the sake of the argument ignoring control constructs, which require somewhat more complex processing first) plus a rule for uninstantiated variables and one for an inexistant predicate. And `call/N, N > 1` c…

Yes, enumerating all predicates in the system and meta-interpreting all control structures seems unrealistic to me. In the sense that no Prolog application developer (as opposed to a Prolog system implementor) would want to do it. Except maybe as an intellectual exercise.

Of course you wouldn't really need to enumerate all predicates in the definition of call/1. You could first run a whole-program abstract interpretation to identify just the ones that can actually be meta-called. Much more appealing :-)

Re: The Simplicity of Prolog

#132
post #131

Earlier quoted context omitted.

> The user has no realistic way of implementing the `call/N` builtin themselves. Not sure what you mean by realistic, but `call/1` can be implemented by having one simple rule for each existing predicate (now for the sake of the argument ignoring control constructs, which require somewhat more complex processing first) plus a rule for uninstantiated variables and one for an inexistant predicate. And `call/N, N > 1` c…

Yes, enumerating all predicates in the system and meta-interpreting all control structures seems unrealistic to me. In the sense that no Prolog application developer (as opposed to a Prolog system implementor) would want to do it. Except maybe as an intellectual exercise. Of course you wouldn't really need to enumerate all predicates in the definition of call/1. You could first run a whole-program abstract interpreta…

Yes, this technique has been used by several implementations. And any application developer can use `asserta/1` for the very same purpose. Just one rule, that is certainly much more appealing.

Re: The Simplicity of Prolog

#133
post #80

Earlier quoted context omitted.

By allowing you to use the features of the host language to complement the features of miniKanren. Having good support for multiple programming paradigms is better than trying to make one paradigm fit all needs. Poplog[1] was an earlier attempt to provide such synergies but it failed to gain market share. It's now free software so take a look! The Racket ecosystem is another approach where each module can choose a la…

Ok, but MiniKanren isn't intrinsic to Scheme. I agree Racket makes it especially easy to embed sub languages, but you could embed core relational Prolog just as well as MiniKanren. My understanding of your statement is that Scheme and MiniKanren share sexp syntax, but the same applies: you could embed an sexp-based Prolog just as well. The only remaining MiniKanren advantage is then to have a complete search strategy…

I didn't connect miniKanren to Scheme. I said "Host Language." I did suggest the value of a multi-paradigm host language.

Re: The Simplicity of Prolog

#134
I am wondering what this statement actually means:

> The reverse predicate from this section should not be used in practice - most Prolog implementations actually provide a built-in version which is a lot more performant than our implementation.

I think it can be read as: If you care about speed do not use Prolog, instead write a "built-in" solution.

Post reply on HN