[Haskell-cafe] Interoperability with other languages and haskell
moran at galois.com
Thu Sep 16 16:27:06 EDT 2004
On Thursday 16 September 2004 02:46 pm, Vincenzo aka Nick Name wrote:
> Again, I will try to take benefit of the thread on the "senior" list to
> ask a question to everybody who uses haskell in industry (so you people
> at Galois Connection can't avoid to answer, I know you are there :D ):
> are your solutions entierely written in haskell, or are there parts
> written in other languages? If so, how do you let all parts
> interoperate? Do you use some form of RPC, or CORBA, do you just use a
> database to store common data, do you use custom protocols (e.g.
> command line arguments) or what? Do you have experience with wrong ways
> to achieve this goal?
Almost all of our projects are written entirely in Haskell. The reminder
use the excellent GHC FFI mechanisms to call out to C, and in one case, Tcl
(via TclHaskell). We don't develop multi-process applications, distributed
or otherwise, so we have no need for RPC or more complex middleware(*), or
other more baroque solutions.
> I ask this because "it might be" that in the next years our sleeping
> company will produce some software, and I can easily convince other
> people to use "new" languages, if I can ensure them that in case it
> proves difficult for any reason, we can finish with a certain module
> and implement the rest of the system using "more conventional"
Here's what you say: "Let's prototype it in Haskell, and then replace any
performance bottlenecks with C." For some application areas (like tools),
you won't have to bother with the last step. If you do need to rewrite
some component in C, the FFI is there to help.
I'd like to say that this approach has worked for us time and time again,
but, to date, we've never had to rewrite a slow component in C :-) For us,
C interoperability has always been a case of linking to third party
software, or for writing test harnesses to test generated C.
Things are different if your application is multi-process and/or
distributed, and you're not going to be using an established protocol (like
HTTP, for instance). In that case, you might want to look at HDirect
(giving access to CORBA, COM, DCOM), if you need to talk to CORBA/COM/DCOM
objects. There are many simple solutions to RPC available too, if that's
all you need.
(*) We have prototyped our own secure middleware, which had an elegant,
powerful, class-based RPC for Haskell processes, but we haven't really used
that in other projects.
Andy Moran Ph. (503) 626 6616, x113
Galois Connections Inc. Fax. (503) 350 0833
12725 SW Millikan Way, Suite #290 http://www.galois.com
Beaverton, OR 97005 moran at galois.com
More information about the Haskell-Cafe