replacing guile with haskell?

David Roundy droundy at abridgegame.org
Fri Oct 17 08:48:06 EDT 2003


I'm wondering what the possibilities are for replacing the use of guile
with a haskell interpereter? I'd like to be able to embed a haskell
interpereter (presumably hugs) withing my program, so that the input file
could be a haskell program.  The application is a numerical simulation
code, for which the input is (among other things) a photonic crystal
structure.  Practically, this means that the input file needs to be a
program (or the user needs to write a program to generate the input
file--ugly).

Currently my code works as a C++ library, but that isn't particularly
convenient (except for development).  A similar code (mpb--it's available
in debian) by a coworker has the input format in scheme using guile.
That's nice in many ways, except I can't stand scheme.  So I'm wondering
whether there might be some convenient way to accomplish the same goal with
haskell.

Currently, my best (and only) idea is to make the input file a script with
#!/usr/bin/env runhugs
at the top (and compiling an interface module with ffihugs).

There are a couple of issues with this.  The first is that I've heard that
hugs isn't intended for numerical work (which is what I'm doing).  I'm not
sure if this will be a problem, since hugs won't be doing any of the real
work anyways.

The other is that according to the man page, it seems that hugs only
supports ffi on x86, powerpc and sparc, which seems likely to be a show
stopper.  Since I'll need to run the code on supercomputers, I won't always
have a choice of architectures, and at least support for POWER (maybe comes
free with powerpc?) would be necesary--IBM SP machines are quite nice.  In
this regard, ghc seems worse than hugs (the thought of bootstrapping ghc on
a supercomputer gives me the shivers), and nhc98 last time I looked didn't
support 64 bit platforms.

Is there a solution to these problems, or will I be stuck with thousands of
parentheses in my input file?
-- 
David Roundy
http://www.abridgegame.org/darcs


More information about the Haskell-Cafe mailing list