News for hackers. Stuff that matters.
Re:The Power of Prolog by girzel on Wednesday April 08, 2020 @05:11PM (#22817194)
I'm guessing because it's so fundamentally different from most of the other programming languages out there, which I sometimes think are just variations on the variable/function/control flow theme (and yes, I've gone fairly far in Lisp).

I've been teaching myself Prolog, and it's sufficiently different that I feel like I'm learning to program all over again. You can sort of pretend that predicates are just funny functions, where you have to put the return value's container into the argument list, but that's not really what's going on. I loved reading the docs for SWI-Prolog, where most of the predicate docstrings start: "True if...". You can say that the length predicate returns the length of a list, but really it returns true if the given list has a length equal to the given integer. It will tell you the length of a list, sure, but it will also do the reverse:

?- length(List, 5) -> List = [_,_,_,_,_]

Nuts!

Re:The Power of Prolog by agumonkey on Wednesday April 08, 2020 @06:09PM (#22817740)
ever seen Friedman and Byrd talk about kanren ?

    ? evalo(e, 6) 
    
    (+ 3 3)
Re:The Power of Prolog by Tomte on Thursday April 09, 2020 @05:53AM (#22821090)
I have seen a few *kanren posts now on HN, and they always have their operators ending in "o".

Is that just to distinguish them from normal "eval" (in this case), or is there a deeper meaning?

Re:The Power of Prolog by agumonkey on Thursday April 09, 2020 @11:43PM (#22829803)
I think it's yet another typographic ~wonder. From what I recall it's a ° to denote relation (relat°) but made into an ascii 'o'.

So yeah, it's just to distinguish from the usual semantics.

Re:The Power of Prolog by girzel on Wednesday April 08, 2020 @06:48PM (#22818046)
Double nuts!