5 ms·
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
by girzel 7y ago
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!
- agumonkey 7y agoever seen Friedman and Byrd talk about kanren ? ? evalo(e, 6) (+ 3 3)
- girzel 7y agoDouble nuts!
- Tomte 6y agoI 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?
- agumonkey 6y agoI 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.