[MLton] better support for C pointers

Stephen Weeks MLton@mlton.org
Mon, 1 Dec 2003 10:31:45 -0800

> Another idea:
> A malloc / free interface? Using ML-types maybe?

I think it would be nice to have this, but it might be better to base
it on C types that are embedded in phantom types.  Have a look at
Mathhias Blume's NLFFI paper, especially section 3.


I think one might be able to attach get/set functions to his RTTI
(run-time type information) to be able to have malloc "know" the right
size.  I haven't done any coding yet though, so I'm not sure.

Also, with the new MLton.Pointer in place, I think we're pretty close
to having enough primitives so that someone could add support for
NLFFI (or an NLFFI-like system) if they wanted.