A bundled Python interface

No. Simply the Python/C API. Note that we need little:

  • Convert Python data to Prolog
  • Convert Prolog data to Python
  • Implement py_call/2 that calls a Python function/method from Prolog
  • Implement opening, iterating and closing a Prolog query from Python.

The total is less than 1,000 lines of C. Its not complete, but I think it is probably 90% of the code we’ll ever need. It mostly needs more testing (notably memory management), support for threads and more flexible building and packaging. As is, it only supports building from source in an environment that has CPython with the C development stuff installed. On a Linux system it is really easy to build. Works also for MacOS with Python installed from Homebrew.

What matters is (1) portability and (2) best performance.

Where does that leave pybind compared to the C API? Surely Boost adds a lot to the build dependencies. Does it make a difference for the various Python versions @peter.ludemann mentioned?