μKanren #160
gilch
started this conversation in
Show and tell
μKanren
#160
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
One of my original goals for Hissp was that it be powerful enough to easily implement a microKanren, which becomes a lot more useful with helper macros, something Python struggles with, but easy in a Lisp.
You can see the original Scheme version here.
Understanding what that code is doing is a lot easier than understanding why it is doing it, but enough on that topic has been written elsewhere.
Here's a rough first attempt in Python. I think it more or less works, but maybe I missed some edge cases.
Hissp can, of course, import this and layer macros on top of it, but I'd also like to try rewriting it in Lissp to begin with.
This version is about the same length as the Scheme one. Some things were easier with Python's data structures and comprehensions, but other things felt less natural.
Beta Was this translation helpful? Give feedback.
All reactions