Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Easier FFI
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-12-21 (03:38)
From: Dave Benjamin <dave@r...>
Subject: Re: [Caml-list] Easier FFI
Jon Harrop wrote:
> For example, why can't we have a generic FFI library that allows us to use any 
> external library (unsafely) without leaving OCaml? Then we could write or 
> generate our bindings entirely in OCaml and forget about these C stubs.

I would love something like this. I've used "ctypes", a similar library 
for Python, a few times, and it has really come in handy. Not something 
I want to use often (at least not directly), but for those times when 
use of an unsupported C library is necessary, it's so nice to have the 
ability to stay within the language rather than writing a bunch of 
wrapper code. I wonder if something like ctypes would translate well to 
a statically typed language like OCaml.