[Haskell-cafe] Re: Boost equivalent

Al Falloon afalloon at synopsys.com
Thu Feb 1 15:35:31 EST 2007

Boost.Python is for extending Python with C++, or embedding Python in 
C++. This is especially useful because it allows you to use Python as an 
extension language for a C++ program.

Presumably Boost.Haskell would be for integrating Haskell code with C++, 
which would of course be useful, but the main use case (an embedded 
extension language) that draws people to Boost.Python isn't as much of a 
draw for Haskell because of the compilation phase.

On the other hand, I suppose you could always integrate a Haskell 
interpreter like Hugs, or even go the HsPlugins route and dynamically 
load a compiled module, but the fit doesn't seem as natural as it does 
with a latently typed scripting language.

There are also technical problems that are hard to overcome. Extending 
Python is mostly done in C, so a C++ library to add some nice sugar is a 
good fit. Haskell, OTOH, embeds C programs via its FFI. There doesn't 
seem to be any way to export functions and value from C++ to Haskell, 
but instead the C++ code must import from Haskell. All the heavy lifting 
is done on the Haskell side, so there isn't as much opportunity to write 
a slick C++ library.

This could change if someone made a version of Hugs that can be linked 
in as a library with a documented C API for evaluating Haskell code and 
mucking with Haskell values. But I don't think its much of a priority 
right now :)

Alan Falloon

Alexy Khrabrov wrote:
> One of the great strengths of Python is Boost.Python.  Practitioners say 
> it's a major advantage of Python over Ruby, for example.  So the 
> question is not whether there's a Boost in Haskell -- C++ and Haskell 
> are too different for it to have much meaning -- but whether there's or 
> going to be a Boost.Haskell?
> Cheers,
> Alexy
> On Feb 1, 2007, at 5:03 AM, John Ky wrote:
>> Does the Haskell community have an equivalent to C++ community's Boost 
>> project with the aim of writing libraries for the eventual inclusion 
>> into Haskell?

More information about the Haskell-Cafe mailing list