[Haskell-cafe] Re: Boost equivalent

Slavomir Kaslev slavomir.kaslev at gmail.com
Thu Feb 1 17:15:50 EST 2007

On 2/1/07, Al Falloon <afalloon at synopsys.com> wrote:
> 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

I think a more common scenario would be using C++ legacy code in
Haskell project. I would imagine Boost.Haskell as collection of code
generation templates for exposing C++ APIs to be used in Haskell. That
would be sweet. Even sweeter is easily accessing .Net Framework from
ghc, especially for Windows users. .Net Framework is huge. It is
de-facto _the_ windows framework. Are there any projects going in this

Slavomir Kaslev

More information about the Haskell-Cafe mailing list