Amzi Python Interface 0.2 (Alpha)
Updated 14 Oct 2002
Upper levels:
None

 Amzi Python Interface 0.2 (Alpha)

 [ Prev - Up - Next ] 

The initial motivation for this project was to experiment with hooking up some Amzi! Prolog programs I had written a long time ago to more contemporary GUI's written in Tkinter, and perhaps later some other kinds of Python-based GUI's as well. Further motivation comes from the fact that Python has lots of extension modules for various purposes, and a clean Amzi-Python link would hopefully make them easily accessible from Amzi. And then I noticed that Python 2.2.1 in particular seems to have a variety of new features such as iterators, generators and python-extensibility of classes written in C, which make an interface to Prolog a lot more interesting to do than it would have been with early versions of Python.

Another thing worth noting is that the psyco (Python Specializing Compiler) package makes it possible for certain kinds of Python programs to run much faster (so far only for 386-compatible machines, tested on Windows and Linux), sometimes with performance approaching C, so that easy access to Python from Prolog can in effect be like easy access to an on-the-fly native code compiler. Or, slightly harder to use but probably even faster in execution, the Pyrex compiler compiles a modified and restricted version of Python straight into C, and packages it as an extension module.

The present status of this project is highly incomplete, but it does what I now need to have done, which means that further development might be a tad sluggish. Some of the more significant shortcomings are:

  • Many types not treated, especially unicode strings.
  • Much untested handling of errors.
  • Lots of unhandled lsapi functions.

The source code is distributed under the same license as Python 2.2.1 source, so of course contributions and advice would be very welcome.

One thing I haven't figured out is what it should be called, 'AmziPy' sounds nice for the whole package, but for the actual name of the extension module, AmziProlog seems better because (a) Prolog is basically what it is (b) Amzi! has other products beside Prolog (c) there are other Prologs besides Amzi!'s that one might try something like this with (and some of them have Python bindings).


 Sections


 [ Prev - Top - Next ]