Prolog Glue Language?

Tim Peters tim_one at email.msn.com
Thu Oct 14 00:57:20 EDT 1999


[Jon Fernquest]
> ...
> What is the best glue strategy for a scripting language like Python
> to use with Prolog, a language for which there is a lot of outstanding
> code but which is difficult to integrate into systems written with
> imperative languages?

If a system lacks both a sensible command-line interface (stdin -> stdout)
and a C (or Fortran, or Forth, or ...) API, Python (along with Tcl, Perl,
Lua, Guile, and anything else of this ilk) is out of luck.  You can't script
something that refuses to be scripted -- although it's easier in Python than
in anything else <wink>.

> ...
> Isn't a better approach to have a Warren machine built right into the
> scripting language as an extension so that Prolog code could be embedded
> right into scripts? (Note: There are Warren machines written in C++ out
> there in the public domain.)

Indeed -- then you have a scriptable engine.  Go to it!

> I've tried rewriting Prolog code in imperative languages, but that's a
> losing battle..... with it's unification and backtracking capabilities
> Prolog is still the best tool out there for a wide range of problems.
>
> The problem is, *it needs a glue language more than the languages that
> already have a glue language* like C, C++, Java...
>
> What to do?

Wrap your Warren machine C++ engine in a Python extension module, or try to
get the world interested in a brand new PrologScript language <0.9 wink>.

"self-contained-universe"-languages-are-as-productive-as-
    black-holes-ly y'rs  - tim






More information about the Python-list mailing list