Start of topic | Skip to actions

The Monty Project FFI Task

Owners: Blake Kaplan, Peter Hokanson.

Goal: To create a foreign function interface to allow OCaml to access and execute Python libraries written in C

Extending the OCaml interface to Python/C API (11/09/2007)

Goal time for completion: Sat Nov 10, noon.

Pete and Blake will extend the OCaml interface to the Python/C API. The following API interface functions will be implemented (click on links to see the actual Python/C API documentation of the functions):

  • Abstract object layer (Pete)
    • Object Protocol
    • Number Protocol: Most of the functionality is there at the moment. I ignored all of the InPlace functions in favor of completing the rest as well as the Coerce and AsSsize_t functions.
    • Sequence Protocol: Skipped all with Py_ssize_t
    • Mapping Protocol: Skipped: PyMapping_DelItemString PyMapping_HasKeyString PyMapping_GetItemString PyMapping_SetItemString
    • Iterator Protocol

  • Concrete object layer (Blake)
    • Numeric objects (int, float, complex, long)
    • Sequence objects (string, list, tuple, unicode, buffer)
    • Mapping objects (dict)
    • Module objects
    • DateTime objects (basic functionality)
    • Set objects (basic functionality)

As Pete and Blake add these functions, they will be adding a list of each function implemented correctly to the wiki. If they leave an API function or have problems implementing it, that will be on the wiki.

TODO (11/05/2007)

We are still in the design phase, and we believe that the following steps may help getting started.
  • Read Python/C API
  • Read Extending & embedding the Python interpreter
  • Download and examine Pycaml, an existing OCaml to Python interface for a slightly older Python version.

Discussion

I looked briefly at the Python/C API documentation yesterday and outside of the type declarations that it provides, it doesn't look like it's going to be useful for our FFI implementation. I met up with Raj today after the meeting and we talked briefly about exactly what problems we need to solve. So far our talks have been focusing on FFI+libraries. I think that reformulating the problem as being "introduce an FFI for Monty" and separately "implement Python libraries" will give us better separation and allow us to wrap our heads around the various problems more easily. -- BlakeKaplan - 07 Nov 2007

Useful links

  • OCaml manual
  • Developing applications with Objective Caml aka The O'Reilly OCaml book.


The Man Behind the Curtain
  • Set ALLOWTOPICCHANGE = WalidTaha, RajB, BlakeKaplan, PeterHokanson

End of topic
Skip to actions | Back to top
RAP.TaskMontyFFI moved from RAP.TaskForeignFunctionInterface on 06 Nov 2007 - 23:43 by Main.WalidTaha - put it back
Creative Commons LicenseThis work is licensed under a Creative Commons Attribution 2.5 License. Please follow our citation guidelines.