I just read the chapter in the Joy of Clojure on core.logic and now I am hungry for more. Where can I find more written in that style?
Ah good point. Thanks!
I had forgotten about minikanren
I'm currently reading TRS, going through every example to learn this interesting topic, and also to learn the syntax. The differences are not always clear. https://github.com/clojure/core.logic/wiki/Differences-from-The-Reasoned-Schemer helps a little, but it's not enough. I found these two links to projects on Github 1. https://github.com/martintrojer/reasoned-schemer-core.logic (9 yo) 2. https://github.com/philoskim/reasoned-schemer-for-clojure (2 yo) Mine is here, but I've just started and I'm currently on chapter 2 https://github.com/michelemendel/the_reasoned_schemer
I’d definitely recommend TRS it’s a really, really great book.
It might be worth bearing in mind that core.logic is an implementation based on the 2nd edition of the book not the 3rd edition though.
This means the 2nd edition is marginally easier to port to core.logic than the 3rd; but the differences are pretty obvious — especially if you can find some of the many ports of examples from the book into core.logic
.
The 3rd edition is a small but significant improvement on the 2nd edition book though; especially if you wish to understand the ideas behind it; they also distilled the implementation to its essentials even further.
Is there a 3rd edition? I couldn't find it.
@rickmoynihan Do you think I ought to read any of the other schemer books first?
FYI, I'm newish to relational programming myself, and haven't read the other schemer books (but I have one on my shelf). I wrote newish, since I have read books about Prolog, so the concept wasn't completely new to me.
@simongray Well the whole series is great! 🙂 However the little schemer is the most basic of the whole series. If you know clojure pretty well you don’t really need it. It’s really an introduction to lisp, recursion, functions; whilst the seasoned schemer goes into functions as values etc. The books aren’t really practical introductions to learning scheme as such; more about learning concepts of programming.
They’re great books; I have the little typer and little prover too. All the books in the series have a pretty whimsical style; you’ll often find yourself asking “why am I learning this?!“, or even “what am I learning here?!“. The books don’t ever really attempt to answer the why; they consciously provide no explanation of what you’re learning or how it can be applied in the real world. They squarely come at it from the angle of the socratic method, and making tiny steps one at a time to quite profound concepts that are presented as just being interesting for their own sake. Obviously all the concepts the books teach are fundamentally important to CS — though the books themselves are presented more like kids books; and though they’d be suitable for that market, they’re anything but — they cover some pretty mind bending stuff. When you go through the exercises you might be tempted to skip ahead, as you might feel like they’re labouring the point or going too slow… however I’d urge you not too, as it’s very easy to end up out of your depth, missing fundamental concepts if you do this.
I’d also done some Prolog before; but the books are still worthwhile.
@rickmoynihan Yesterday you mentioned the third edition of TRS, but I couldn't find it.
Oh sorry I mean’t second edition
I have a first edition and the second edition (latest)
core.logic is based off the first edition; my mistake.
Ok, that's interesting, since I'm working through the book. Do you know of any important differences?
Depends what you think is important 🙂 What edition do you have?
second
are you using a scheme minikanren implementation or core.logic?
core.logic
So TRS (both editions) include a complete implementation in the final chapters / appendix. The implementations in the 1st and 2nd edition are different. (1st edition is minikanren, 2nd edition as I understand it is microkanren). So if you want to use the book to understand core.logic’s implementation (rather than the high level language) then there are important differences. If you want to understand logic programming in the abstract; there’s mainly just superficial differences you can gloss over.
Ok, so the main difference is in the implementation and less so in the syntax.
No I believe there are also some differences at the language level; they’re just pretty easy to find the equivalence for. See pages xv and xvi in TRS2.
I actually wrote to Dan and Will on the mailing list before purchasing the 2nd edition to find out what had changed. Dan emailed me privately but Will replied on the list with a pretty comprehensive reply… I meant to link it yesterday: https://groups.google.com/g/minikanren/c/fMKSBmOm_XM/m/V0K30F8lBwAJ
Thanks, I will add your answer to my Github page (https://github.com/michelemendel/the_reasoned_schemer), if that's ok with you.
Yeah that’s fine, thanks. I’d maybe revise “important differences” in implementation to “notable differences” as overall I think TRS2 is still a very good place to understand core.logic, though it may depend on deep you go. core.logic is also already different from TRS1 of course ( https://github.com/clojure/core.logic/wiki/Differences-from-The-Reasoned-Schemer )
Noted, I'll change the text. I have been trying to figure out if core.logic is actively updated and actually used (and not abandoned). Do you have any understanding about this?
I actively use it
as do others
It’s not abandoned. It’s still maintained, just very lightly.
IIRC it had a version 1.0.0 update recently (as did many core clojure libs)
though it was essentially just a version bump
it had a minor update for clojure 1.10 warnings in feb last year, and has had changes to the build infrastructure etc 6 days ago.
Good to know. I'm pretty new to the Clojure environment. Some time back, I had a bad experience with Overtone. I went for Supercollider direct instead.
I expect it won’t get any significant attention again though, aside from minor build gardening etc. It’s essentially done.
Thanks for your help
"The Reasoned Schemer" has a different style but definitely worth checking out. https://github.com/clojure/core.logic/wiki/Differences-from-The-Reasoned-Schemer