After you learn to write miniKanren programs, you'll want to know how it works. The original miniKanren implementation combines the core of the logic processing with some crazy Scheme macrology for building a nice syntax. I spent several days puzzling through the back page of "The Reasoned Schemer" without really getting it.
Luckily, you can now read the microKanren paper (http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf) which breaks apart the "core" portion of the logic processing into a purely-functional bit, separate from the macros for the nice syntax.
That little core can be implemented very easily in almost any language with closures. For some fun, I implemented it in JavaScript using some sweet.js macros on top. It took about an hour to get something working, and a day or two to fix more bugs, and now I understand how kanren works. Plus I added some tracing in so I can see how different steps in the program cause the logic variables to get bound: http://adamsolove.com/microScopeKanren/
Definitely worth the time if you're interested in relational programming.
This kind of languages is extremely useful, since many problems maps nicely to a logical or relational model.
I'm using a PAIP-style embedded Prolog and an optimised Datalog for fast prototyping compiler passes - things like alias analysis, implementing type systems (e.g., Hindley-Milner maps to Prolog naturally), constant folding, DCE, Array-SSA, and many more.
Harlan is using cKanren for region inference and some other passes.
Minikanren is featured in a follow up to 'Seven Programming Languages in 7 Weeks' by Manning Pubs. 'Seven More Programming Languages in Seven Weeks'. I think Elixir and Julia are also going to be included in the book. Anyway, if anyone here is into Manning books there's a MiniKanren chapter to look forward to. Disclaimer?!: I do not work for Manning. Just a reader.
There was a nice interview with Will Byrd a couple episodes ago on the Cognicast (Cognitect's Podcast). He discussed MiniKanren along with a ton of other work and thoughts. Recommended listening.
[+] [-] asolove|11 years ago|reply
Luckily, you can now read the microKanren paper (http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf) which breaks apart the "core" portion of the logic processing into a purely-functional bit, separate from the macros for the nice syntax.
That little core can be implemented very easily in almost any language with closures. For some fun, I implemented it in JavaScript using some sweet.js macros on top. It took about an hour to get something working, and a day or two to fix more bugs, and now I understand how kanren works. Plus I added some tracing in so I can see how different steps in the program cause the logic variables to get bound: http://adamsolove.com/microScopeKanren/
Definitely worth the time if you're interested in relational programming.
[+] [-] michaelsbradley|11 years ago|reply
http://www.infoq.com/presentations/miniKanren
Byrd's dissertation on miniKanren is an accessible introduction to the concepts involved in relational programming:
http://gradworks.umi.com/33/80/3380156.html
[+] [-] agumonkey|11 years ago|reply
[+] [-] jgalt212|11 years ago|reply
[+] [-] kyllo|11 years ago|reply
[+] [-] sklogic|11 years ago|reply
I'm using a PAIP-style embedded Prolog and an optimised Datalog for fast prototyping compiler passes - things like alias analysis, implementing type systems (e.g., Hindley-Milner maps to Prolog naturally), constant folding, DCE, Array-SSA, and many more.
Harlan is using cKanren for region inference and some other passes.
A nice motivational paper (on Datalog): http://www.cs.cmu.edu/~aldrich/courses/654/tools/bierhoff-bd...
[+] [-] Foxboron|11 years ago|reply
[+] [-] sklogic|11 years ago|reply
[+] [-] MisterMashable|11 years ago|reply
[+] [-] pselbert|11 years ago|reply
http://blog.cognitect.com/cognicast/063-will-byrd
[+] [-] daveloyall|11 years ago|reply
And now, I'm glad I have.
[+] [-] e12e|11 years ago|reply
[+] [-] Quequau|11 years ago|reply
[+] [-] keithflower|11 years ago|reply
http://kanren.sourceforge.net/
I give a simple example of a toy use of Kanren and made a few observations about logic programming systems, here:
http://apps.keithflower.org/?p=238
Those interested will probably want to read "The Reasoned Schemer":
http://mitpress.mit.edu/books/reasoned-schemer
[+] [-] derefr|11 years ago|reply
[+] [-] whitten|11 years ago|reply
[+] [-] yepguy|11 years ago|reply
[+] [-] sigjuice|11 years ago|reply