[MLton-user] Compiling ML/C Program to dll / Writing a Java GUI for an ML program

Steffen J. Smolka steffen.smolka at in.tum.de
Fri Jul 29 12:57:29 PDT 2011


Hi,

I have been wondering for a while now if there's a good way to make ML code
and Java code work together.
What I would love to do is write a program in ML and wrap it with a GUI
written in Java/Scala.

What I have found so far is that it's possible to make Java work with C
(JNI/JNA) and C work with ML (with MLton's Foreign Function Interface).
Combining this, I would hope to get Java working with ML (via an interface
written in C).
However, it seems that JNI/JNA only works with dynamic libraries, that is
dlls in Windows.
The problem is that i can't get MLton to compile my ML/C program to a
dll. Compiling
the program to an executable works just fine.
Is it just not possible to compile ML programs to dlls with MLton or am I
doing something wrong?
Or is there possibly a better way to make ML code and Java code work
together?

I know it's possible to compile the ML programm to a standalone executable
and simply call that executable from within Java.
The problem is that this would limit data transfer beetween the programs to
strings which might require lots of encoding and decoding and doesn't seem
like a good solution.

Regards
Steffen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton-user/attachments/20110729/46c172c1/attachment.html


More information about the MLton-user mailing list