c backend

Jagannathan, Suresh Suresh.Jagannathan@storagenetworks.com
Thu, 15 Nov 2001 13:52:28 -0500


The problem is we have a bunch of Java code that uses its
C FFI to make calls to C routines.  These routines don't
yet exist, and I suggested that MLton could be used instead of
C.  Having  C->SML hooks would be a start, but cumbersome,
since we still need to write the C stubs that would be called
from Java.  I was hoping to just use SML and have MLton produce
the necessary C output.  It might make selling MLton here a 
bit easier.

-- sj

-----Original Message-----
From: Stephen Weeks [mailto:sweeks@intertrust.com]
Sent: Thursday, November 15, 2001 1:47 PM
To: MLton@sourcelight.com
Subject: c backend



Suresh writes:
> There are a number of cases in the project we're doing here where using
> MLton would
> make sense, but where the need to interoperate with C++ or Java would make
> the
> C-backend useful.  For example, we'd like to include a C library, which is
> ideally
> generated from MLton.
> 
> Are there any plans to resurrect the C backend code generator?

The C backend still works, but we don't test it very much or worry
about its performance.

OTOH, why do you think you need the C backend for this?  We already
have the ability to call C with the native backend.  As to the other
direction, calling SML from C, we have had a couple of requests from
other people for this functionality.  Matthew and I discussed it in
August and believe we know how to do it without too much work.  In
that case, we could use MLton to build a .o file that you could link
into your C app and make calls to, just as if you had generated the .o
file with gcc from C sources.  Is that good enough?