Calling Haskell from Python / C++

Simon Peyton-Jones simonpj@microsoft.com
Wed, 13 Nov 2002 09:52:07 -0000


| So here is what I envision: I write the main
| application in Python. I write a (hopefully) small
| Haskell module that:
| a) Calls back to the main Python app for reading the
| text to be parsed, preferably using laziness.
| b) Parses the text, and maybe processes a bit.
| c) Returns the parsed data-structure. (This may be
| tricky, but I think I know how to do it).

If Python uses C's calling convention, it might be easy; just use
'foreign import' and 'foreign export' (see the FFI spec at haskell.org).

If it doesn't, someone would have to add the Python calling convention
to the various implementations.  =20

Simon