On your other question:
Next, a question on CInterface: Is is possible in PolyML to bind an ML function to a C function found in the current executable (poly), rather an in a shared library ? This is not essential as I can always build a shared library that packs the required functions; it would just be convenient.
If you use Poly/ML through the normal shared library mechanism then the executable contains very little more than the exported ML code. The Poly/ML run-time system and everything else is in shared libraries. You can load those shared libraries through the CInterface mechanism and use anything that is exported. That includes functions in libpolyml but bear in mind that this is mostly C++ rather than C and I'm not sure how many of the symbols are exported.
If you're looking to use standard C library functions that are also used by the Poly/ML library it may be possible by loading the appropriate library. What this is will vary between operating systems. To be honest I think it would be easiest and most portable to write your own shared library.
David