Changes and Issues
Updated 14 Oct 2002
Upper levels:
Amzi Python Interface 0.2...

 3. Changes and Issues

 [ Prev - Up - Next ] 

 Index


 Changelog

  [ Top ] 

v0.1
Released Oct 8, 2002.
v0.2
New Features:
  • Floats passed smoothly between Python and Prolog
  • Term Unification Methods ('Unification')
Other Improvements:
  • Better error reporting, but many of the cases hopefully covered haven't been tested (many error-returns from lsapi preds)


 Issues

  [ Top ] 

One set of is how to handle the various type conversions:

  • Unicode. Both Amzi and Python support unicode, maybe they'll play nicely, maybe not. Haven't thought about it at all.
  • Amzi has a type 'infinite precision real', without a counterpart in Python, and Python has 'long integers' (infinite length integers) without a counterpart in Amzi. Plus Python will at some point have 'rational numbers'. Not sure how that will all work out. Python also has complex numbers, perhaps they could be automatically converted to some artfully chosen binary functor structure.
  • Coercions: the Python class definition mechanisms allow for extensive conversions to different numberical types, so that for example if an AmziTerm term1 contained a string that represented a floating point number, then float(term1) could be gotten coerce it to float. Is this a good idea? (Python itself is not very agressive about this; to read a string as a float you'd have to stick an eval in.)
Another is the handling of Python calls from Prolog:
  • Currently tuple-returns from Python are packed into a list. Another possibility would be python2/3/4 etc. predicates dropping the tuple-members straight into variables. Not worth it unless the overhead of packing tuples into lists turned out to matter, which seems dubious.
  • It's almost certainly not possible to define an extended predicate in Python (no address for a machine-executable procedure). Maybe Pyrex? But that would be a differentproject.
And some other bugs/deficiencies
  • Reporting of various kinds of errors via exceptions is rather incomplete and deficient.
  • In particular, if there's an error in setting up a call of Python from Prolog, the clause where this happened isn't reported.
  • Floats seem to undergo some drift in the far decimal places when passed back and forth between Pythom and Prolog, not sure if anything can be done about that.

And finally note that thare are quite a number of potential 'engine methods of convenience' that could be defined in Python, in a Python-extension of the engine class. Perhaps the C-defined engne should actually the the _AmziEngine, with a Python file defining AmziEngine and providing more methods implemented in Python.


 The Future

  [ Top ] 

Things that might actually appear in the next numbered release, or the one after that

  • Verbose/quiet modes for engine
  • Different .cfg and .xpl file names
  • List-handling methods (gethead/gettail)
  • Initlsx (for adding extended predicates written in lgs other than Python)
  • GetVersion, CommandArgs
  • Init2

And maybe a bit later:

  • Accessing unbound variables in terms by their names (cool, but not really necessary); how to do in non-string-based interface?
  • Database handling (doesn't seem essential, since it can be done by calling the Prolog assert etc predicates).
  • Unicode



 [ Prev - Top - Next ]