Hi.
It would be great if it were possible to use Poly/ML from other programming languages. There would be a polyml.so or polyml.dll file, that could be linked with, for example, the following C program:
#include "polyml.h"
main() { Poly_LoadDatabase("mydb.pmd"); int result = Poly_InvokeFunction_Int_Int("add_one", 5); printf("%d plus one is %d\n", 5, result); }
It would of course be better still if there could be a Poly/ML COM component or Poly/ML .NET component (unmanaged and non-verifiable, of course).
The problem with these scenarios is that Poly/ML would have to live together with other modules in the same process. This probably causes multithreading issues and address space issues.
Poly/ML uses memory mapping to load the database. It uses fixed addresses for this. What if the address range is being used by other modules?
Poly/ML uses certain operating system functionality to implement multithreading. Could this interfere with other modules?
We have a design space here: one extreme is Poly/ML, which is very efficient, but has rather poor interoperability. The other extreme is SML.NET (see www.research.microsoft.com) (I'm talking about the concept, since it has not (yet?) been released): this would provide great interoperability, but most probably at the expense of efficiency in time and space.
Of course, Poly/ML is the greatest programming language ever and all other languages are superfluous :-), but we cannot avoid the fact that some people use other languages, and, as a result, useful libraries get written in other languages. My problem is that I want to combine the Isabelle theorem proving system (isabelle.in.tum.de), written in SML, with the .NET Framework's user interface components.
As an approximation to the DLL approach I discussed above, I'm looking into writing some simple remote procedure call code to connect the Poly/ML process and the .NET process. That way, Poly/ML would be a kind of "server" accepting remote procedure calls through a socket. (See also my previous mail.)
Is it possible to run Poly/ML on Windows without the user interface? This would allow me to invisibly launch Poly/ML from the .NET program, with a database that contains an "onEntry" function that listens on a TCP port and accepts remote procedure calls.
Any thoughts on this?