On Mon, 11 May 1998, Alastair Reid wrote:
> Hugs' "server interface" provides a very limited ability for C functions
> to call Haskell.  Have a look at
> 
>   http://haskell.org/hugs/docs/server.html
> 
> Needless to say, it'll all be better in the new Hugs-GHC system
> we're working on.  

I have gotten a few emails on this new system and it sounds exciting, but
I am a little confused.  The HugServer effectively provides a way to
call use Hugs from within a C program.  I am looking for something
somewhat different (maybe this is H/Direct or not?).

The York system seems to be somewhat better, but still seems to require a
substantial amount of manual labor.

Ideally there would be a system which takes a Haskell project and exports
enumerated functions into a header file and set of C files.  This would
allow C code like:

#include "myHaskellProg.h" //functions prototypes + Haskell fun data structures

void main(int argc,char **argv) {
  printf(myHaskellFunction(argv[1]));
}

If the Haskell file contained its own main, then it would be a standalone
executable.

I could use this to write an adapter to the Apache module API.
It would also allow the use of Haskell code in C and Java libraries.
It would also run a lot faster than Hugs interpreted Haskell.
If you are also required to execute some initialization function,
that would not be soo bad either.

(yes, this begs the question of translating C arguments to Haskell, but 
 if export was restricted to basic types that would cover 80% of needs.
 it would be nice to write Haskell code to process C structs, but that is 
 really just bonus.)

If this is what H/Direct is about, that is great.  If not, I guess I will
just have to cope.

-Alex-

PS Erik, I have made a new version of the CGI library that is somewhat
   easier for newer Haskell users. I will forward once I've finished
   testing (if you are interested).  

___________________________________________________________________
S. Alexander Jacobson                   i2x Media  
1-212-697-0184 voice                    1-212-697-1427 fax



Reply via email to