Re: eXene and openGL

Vesa Karvonen <vesa.karvonen-bbCR+/[email protected]>
Newsgroups gmane.comp.lang.sml.smlnj
Message-ID <[email protected]>
Quoting brian <briand-/[email protected]>:
[...]
> ml-ffigen is not robust enough to deal with the C include insanity  
> and will often bail out.
[...]

Yes, I've noticed this too although I've been mostly using the MLton
version (mlnlffigen).  The problem seems to be that ml[-]nlffigen
(understandably) does not deal with non-standard C and compiler/OS
specific headers regularly contain non-standard C.

It might be possible to improve ml[-]nlffigen in this respect in various
ways (e.g. implement common extensions and make it deal more gracefully
with partial information and errors).

> How are you dealing with this ?

I'm writing a library (in my very limited spare time ATM) to help with
this.  The current idea is to create/generate "fake" (but accurate
enough) libc headers to use with ml[-]nlffigen.  Using the lib you'd
invoke ml[-]nlffigen with modified #include paths so that the fake
headers get included instead of the compiler/OS headers.  The lib would
also include a (practically) complete NLFFI interface to libc including
C side stubs where necessary (the C standard allows for much variation
in implementation techniques (e.g. whether something is implemented as
a macro or not)).

The library is *not yet ready* for use.  You can see some of the sources
at

  http://mlton.org/cgi-bin/viewsvn.cgi/mltonlib/trunk/org/mlton/vesak/libc/unstable/

but I've done some work (macroized almost all of the libc headers) that
isn't commited to the repository and the code in the repo doesn't entirely
reflect the current (more refined) idea (as expressed here).  I would
estimate that it needs about 2-3 days of work to get to a first usable
version which translates to 1-6 weeks of wall clock time...

Note that although the lib is hosted at the mltonlib repository, I intend
to support both MLton and SML/NJ.

-Vesa Karvonen

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.