Interesting project: someone has written a reimplementation of the Python/C API for OCaml (of course the native-code compiler, not the bytecode interpreter). This makes it possible to do the following things:

  • Write Python extension libraries in OCaml
  • Use Python-C extension libraries in OCaml
  • Use Python modules in OCaml (generally use the Python interpreter in OCaml)
  • Use the Python toplevel for OCaml

It all sounds very exciting and could be very interesting for some applications - OCaml produces very fast code and can easily compete with C in this area. Especially for implementing the parts of code that are too slow in Python, OCaml is of course much more interesting than C because of its significantly better type safety.

Here's the original article.