Fork me on GitHub
#core-logic
<
2021-01-22
>
simongray17:01:52

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?

Jan K18:01:50

"The Reasoned Schemer" has a different style but definitely worth checking out. https://github.com/clojure/core.logic/wiki/Differences-from-The-Reasoned-Schemer

simongray19:01:21

Ah good point. Thanks!

simongray19:01:55

I had forgotten about minikanren

michele mendel06:01:28

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

🙏 3
rickmoynihan09:01:49

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.

🙏 3
michele mendel10:01:16

Is there a 3rd edition? I couldn't find it.

simongray08:01:38

@U06HHF230 Do you think I ought to read any of the other schemer books first?

michele mendel08:01:31

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.

rickmoynihan08:01:06

@U4P4NREBY 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.

rickmoynihan08:01:40

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.

🙏 3
rickmoynihan08:01:48

I’d also done some Prolog before; but the books are still worthwhile.

michele mendel08:01:58

@U06HHF230 Yesterday you mentioned the third edition of TRS, but I couldn't find it.

rickmoynihan08:01:37

Oh sorry I mean’t second edition

rickmoynihan08:01:49

I have a first edition and the second edition (latest)

rickmoynihan08:01:06

core.logic is based off the first edition; my mistake.

michele mendel08:01:27

Ok, that's interesting, since I'm working through the book. Do you know of any important differences?

rickmoynihan08:01:02

Depends what you think is important 🙂 What edition do you have?

rickmoynihan08:01:56

are you using a scheme minikanren implementation or core.logic?

rickmoynihan08:01:52

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.

michele mendel08:01:26

Ok, so the main difference is in the implementation and less so in the syntax.

rickmoynihan08:01:09

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.

rickmoynihan08:01:30

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

michele mendel08:01:16

Thanks, I will add your answer to my Github page (https://github.com/michelemendel/the_reasoned_schemer), if that's ok with you.

rickmoynihan08:01:15

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 )

michele mendel09:01:10

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?

rickmoynihan09:01:43

I actively use it

rickmoynihan09:01:26

It’s not abandoned. It’s still maintained, just very lightly.

rickmoynihan09:01:04

IIRC it had a version 1.0.0 update recently (as did many core clojure libs)

rickmoynihan09:01:11

though it was essentially just a version bump

rickmoynihan09:01:38

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.

michele mendel09:01:15

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.

rickmoynihan09:01:49

I expect it won’t get any significant attention again though, aside from minor build gardening etc. It’s essentially done.

michele mendel09:01:07

Thanks for your help