[Haskell-cafe] Talking to Java from Haskell?

John Lato jwlato at gmail.com
Fri Jul 9 09:31:02 EDT 2010

> From: Daniel Cook <danielkcook at gmail.com>
> Hi,
> Someone has written a large Java library (QuickFIX/J) which speaks a
> gnarled, ugly protocol (FIX).  There don't appear to be any FIX
> protocol libraries in Hackage.  I need my Haskell program to talk to a
> 3rd-party system that only speaks FIX.
> Should I:
> a) Reimplement the protocol directly Haskell?  (This appears to be non-trivial)
> b) Wrap the Java library with some code to use a lightweight message
> queue (zeromq) to send messages to my Haskell program?  (This would
> require essentially re-implementing an abstracted subset of the the
> protocol into 0MQ messages)

I think you need to answer these two questions to make a decision:

1)  How stable/defined is FIX?
2)  How large of a subset of FIX do you use?

If FIX is relatively stable or has multiple (non-C) implementations in
current use, and you'd be using a large-enough subset, then I expect
implementing a Haskell implementation would be the smallest amount of
work overall.  If FIX has only one canonical implementation, changes
frequently, or you'll only use a small portion of it, then b) would
likely be simplest.

Another option would be to expose hooks to your Haskell program
through the FFI and have it called by Java.


More information about the Haskell-Cafe mailing list