microKanren VS py4cl

Compare microKanren vs py4cl and see what are their differences.

microKanren

The implementation of microKanren, a featherweight relational programming language (by jasonhemann)

py4cl

Call python from Common Lisp (by bendudson)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
microKanren py4cl
2 21
298 223
- -
0.0 2.3
almost 10 years ago 6 months ago
Scheme Common Lisp
- GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

microKanren

Posts with mentions or reviews of microKanren. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-14.
  • Lisp-Stick on a Python
    11 projects | news.ycombinator.com | 14 Nov 2022
    which uses a Lisp to define itself. This means roughly that if you understand enough Lisp to understand this program (and the little recursive offshoots like eval-cond), there is nothing else that you have to learn about Lisp. You officially have read the whole language reference and it is all down to libraries after that. Compare e.g. with trying to write Rust in Rust where I don't think it could be such a short program, so it takes years to feel like you fully understand Rust.

    Indirectly this also means that lisps are very close at hand for “I want to add a scripting language onto this thing but I don't want to, say, embed the whole Lua interpreter” and it allows you to store user programs in a JSON column, say. You also can adapt this to serialize environments so that you can send a read-only lexical closure from computer to computer, plenty of situations like that.

    Aside from the most famous, you have things like this:

    1. The heart of logic programming is also only about 50 lines of Scheme if you want to read that:

    https://github.com/jasonhemann/microKanren/blob/master/micro...

    2. Hygienic macros in Rust probably owe their existence to their appearance in Lisps.

    C2 asks the same question here: https://wiki.c2.com/?LispShowOffExamples with answers like

    3. The object model available in Common Lisp was more powerful than languages like Java/C++ because it had to fit into Lisp terms (“the art of the metaobject protocol” was the 1991 book that explained the more powerful substructure lurking underneath this object system), so a CL programmer could maybe use it to write a quick sort of aspect-oriented programming that would match your needs.

    4. Over there a link shows how in 16 LOC you can implement a new domain-specific language to define and run finite state machines: http://www.findinglisp.com/blog/2004/06/automaton-cleanup.ht...

  • William Byrd on Logic and Relational Programming, MiniKanren (2014)
    4 projects | news.ycombinator.com | 1 Jun 2021
    > I think that with such modern additions (i.e. apart from the cut) Prolog moves closer to the declarative ideal without sacrificing its all-around usability as a general purpose language. What do you think?

    I also used to think that Prolog was moving closer to the delcarative ideal. And I suspect that most expert Prolog programmers believe similarly.

    However, my attitude has changed in the past few years, after seeing Prolog programmers try to implement the relational interpreter from the 2017 ICFP pearl in Prolog.

    The problem is one of composing the pure features needed for expressing a program as complicated as the relational interpreter. (Of course, the relational interpreter is designed to be as short and simple as possible, bit it is still more complicated than pure relations you will find in a Prolog textbook, for example.)

    In theory, you can easily combine unification with the occurs check, SLG-resolution, disequality/disunification constraints, type constraints, etc., and avoid all impure uses of extra-logical features. In practice, I've seen people struggle to combine these features within a single Prolog implementation. In fact, after multiple attempts from multiple Prolog experts, I have yet to see a version of the relational Scheme interpreter in Prolog that can match the behavior of the miniKanren version.

    I'm not claiming that someone couldn't implement a full relational interpreter in Prolog. Obviously they could, since Prolog is Turing-complete. I'm only saying that the default choices of Prolog, plus the intricacies of combining multiple pure features (and leaving out standard and useful non-relational features), seems to make writing a relational interpreter much harder than I would have expected.

    If you are up for a challenge, I'd be happy to work on a Prolog version of the Scheme interpreter with you!

    Based on what I've seen from Prolog experts trying to reproduce the relational interpreter, and conversations with Prolog experts, my current thinking is that Prolog is actually not a good language for relational programming. Too many of the defaults must be adjusted or overridden, too many standard techniques and idioms must be abandoned, and too many potentially incompatible libraries must be composed in order to get everything "just right."

    The problem isn't that relational programming in Prolog isn't possible. The problem is that it requires enough work and non-standard techniques that in practice people don't do it.

    At least, that is what I observe as an outsider.

    If there is an easy way to combine features within a single FOSS Prolog implementation to allow for the types of relational programming we do in miniKanren, I'd be delighted to see it in action. I'd also be delighted to write a paper about it with you! :)

    > Finally, I'd like to know more about minikanrens' search. I'll look around on the internet, but is there a source you would recommend?

    I would recommend reading Jason Hemann and Dan Friedman's lovely little paper on microKanren, which gives a tutorial reconstruction of miniKanren's complete interleaving search, starting from depth-first search:

    http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf

    https://github.com/jasonhemann/microKanren

    The standard exercise for learning microKanren is to translate the resulting ~50 lines of Scheme code into the language of your choice.

    You might also like this more technical paper on the `LogicT` monad:

    Backtracking, interleaving, and terminating monad transformers: (functional pearl)

py4cl

Posts with mentions or reviews of py4cl. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-06.
  • Need recommendation for IPC with Go
    4 projects | /r/Common_Lisp | 6 Jun 2023
    py4cl and cl4py rely on uiop:launch-program and python's subprocess respectively. These are portable to the extent uiop and subprocess are portable and do not require any additional installation.
  • Lisp-Stick on a Python
    11 projects | news.ycombinator.com | 14 Nov 2022
    If you want to use Python libs from CL, see py4cl: https://github.com/bendudson/py4cl the other way around, calling your efficient CL library from Python: https://github.com/marcoheisig/cl4py/ There might be more CL libraries than you think! https://github.com/CodyReichert/awesome-cl (or at least a project sufficiently advanced on your field to join forces ;) )
  • The German School of Lisp (2011)
    5 projects | news.ycombinator.com | 12 Nov 2022
    FYI you can call Python from CL: https://github.com/bendudson/py4cl and CL from Python: https://github.com/marcoheisig/cl4py/

    If you don't know Emacs, see other editors: https://lispcookbook.github.io/cl-cookbook/editor-support.ht... If you want the more Smalltalk-like experience I'd go with the free LispWorks version: it has many GUI panes that allow to watch and discover the state of the program.

    I personally couldn't stay long with Hylang. You won't get CL niceties: more language features, performance, standalone binaries, interactive debugger (all the niceties of an image-based development)…

  • Plotting
    5 projects | /r/lisp | 7 Nov 2022
    I ended up using a fair bit of matplotlib through college and with colleagues. I too don't want to use python, but I also don't like throwing away its libraries, and I'm too lazy to invest in other* plotting ecosystems. In effect, I use up using matplotlib through py4cl/2.
  • numericals - Performance of NumPy with the goodness of Common Lisp
    8 projects | /r/lisp | 2 Aug 2022
    Note that it is not my aim to replace the python ecosystem; I think that is far too lofy a goal to be of any good. My original intention was to interoperate with python through py4cl/2 or the likes, but felt that one needs a Common Lisp library for "small" operations, while "large" operations can be offloaded to python libraries through py4cl/2.
  • Good Lisp libraries for math
    7 projects | /r/lisp | 21 May 2022
    If performance is absolutely not a concern, then third option is using python libraries through py4cl/2. To put it differently, if calling python from lisp is not the bottleneck, then this is a feasible option.
  • Why Hy?
    18 projects | news.ycombinator.com | 3 May 2022
    I encourage people to try out Common Lisp because, unlike with Hy, you will get: speed, ability to build binaries, truly interactive image-based development (yes, more interactive than ipython), more static type checks, more language features (no closures in Hy last time I checked), language stability… To reach to Python libs, you have https://github.com/bendudson/py4cl My comparison of Python and CL: https://lisp-journey.gitlab.io/pythonvslisp/
  • Tutorial Series to learn Common Lisp quickly
    17 projects | news.ycombinator.com | 27 Apr 2022
    > Not sure if such a thing already exists for CL

    couple of solutions exist for this

    https://github.com/bendudson/py4cl

    https://github.com/pinterface/burgled-batteries

  • Calling Python from Common Lisp
    1 project | news.ycombinator.com | 25 Mar 2022
  • (define (uwu) (display "nya~\n"))
    5 projects | /r/transprogrammer | 17 Mar 2022
    Ahh, makes sense. Well, if you ever wanna steal some of python's thunder, libpython-clj worked great for me lol. Supposedly py4cl fills a similar role in Common Lisp.

What are some alternatives?

When comparing microKanren and py4cl you can also consider the following projects:

mediKanren - Proof-of-concept for reasoning over the SemMedDB knowledge base, using miniKanren + heuristics + indexing.

py4cl2 - Call python from Common Lisp

dissertation-single-spaced - Single-spaced version of my dissertation, 'Relational Programming in miniKanren: Techniques, Applications, and Implementations'

magicl - Matrix Algebra proGrams In Common Lisp.

calysto_scheme - A Scheme kernel for Jupyter that can use Python libraries

cl-cuda - Cl-cuda is a library to use NVIDIA CUDA in Common Lisp programs.

trial - A fully-fledged Common Lisp game engine

hy - A dialect of Lisp that's embedded in Python

clinch - Common Lisp 3D/2D Graphics Engine for OpenGL

libpython-clj - Python bindings for Clojure

legit - CL interface to the GIT binary.

coalton - Coalton is an efficient, statically typed functional programming language that supercharges Common Lisp.