Boost logo

Boost :

From: Brian McNamara (lorgon_at_[hidden])
Date: 2003-07-28 14:16:52


On Mon, Jul 28, 2003 at 05:38:01PM +0200, Miroslav Silovic wrote:
> Well, nobody posted anything definite on FC++, which is a pity, since I
> find this library potentially very useful. Here are some comments.
> Caveat: I haven't extensively used the library, but I have quite a bit
> of experience with functional programming. I won't comment on the naming
> scheme or the docs - that was covered in the original post.

I expect the docs are a big issue (as David Abrahams commented); most of
the docs on the web site are aimed at an audience of researchers in
functional programming. Over the next couple of weeks I will make
documentation of the boostified version of FC++ that's aimed at a C++
audience. Hopefully that will help.

> First, FC++ duplicates Boost::bind with its currying. Are there any
> plans to reuse the Boost code for this? Boost::bind seems more powerful
> and general, in that it can take functions with any arity and bind any
> argument(s).

(Perhaps again this is the fault of the documentation being poor.) FC++
full functoids are fully curryable by default. The "prefix" and
"underscore" styles of currying are the preferred ways to do things.
See http://www.cc.gatech.edu/~yannis/fc++/currying.html
for some examples. You can do the same things with boost::bind (or
boost::lambda, or fcpp::lambda) too. I am talking to Jaakko and Joel
(off-list) about the boost infrastructure there to ensure that, at the
least, FC++ interoperates with the boost stuff, and at best, that much
of the infrastructure can be reused.

> I think FC++ could profit from pluggable memory management, perhaps as a
> policy parameter. In particular, zonal allocation could allow one to do
> away with refcounting for calculate-and-exit trips into FC++ code (where
> you just carve small chunks from a list of memory pages, then nuke the
> entire block once you're done with the calculation).

This sounds like an interesting extension, though I don't know that I
would be the right person to implement it. :)

> One interesting Haskell feature that FC++ doesn't have are monadic
> arrays. Are there any plans to communicate with writable STL containers
> using monads?

The monad stuff is very new; this sound like a terrific idea. I'll put it
on my to-do list.

> I also couldn't find any reference to tuples in the docs. Is there any
> support for them? (This could be a low-hanging fruit, since Boost
> already has tuples).

There is nothing (other than std::pair and fcpp::mk_pair). I don't see
any reason boost tuples couldn't be used in fc++ code, though.

-- 
-Brian McNamara (lorgon_at_[hidden])

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk