Boost logo

Boost Users :

From: Joel de Guzman (joel_at_[hidden])
Date: 2008-07-20 07:39:02


Zeljko Vrba wrote:
> On Sun, Jul 20, 2008 at 08:14:16AM +0800, Joel de Guzman wrote:
>> Look at it this way: Imagine a world where STL didn't have iterators
>> and algorithms.
>>
> These are tools to get the job done. I can map my problem domain to these
> tools well, which is not the case with fusion. (As I said earlier -- I do
> *not* claim that fusion is useless -- just that I might be working in a wrong
> problem domain, and that's what I'm trying to find out.)
>
>> STL is still immensely useful. It does not have a pattern-matching facility.
>> MPL is still immensely useful. It does not have a pattern-matching facility.
>>
> Neither claims to implement tuples.

They are *all* libraries for data-structures. Data structures +
algorithms==programs. That's what it is all about. Fusion is a
library for dealing with heterogeneous sequences. The tuple, is
just an example of a heterogeneous sequence.

STL deals with data structures in the runtime world.
MPL, in the compile time world.
Fusion, in both.

Can't see the connection yet? Don't limit yourself to just thinking in
terms of tuples. Think in terms of data-structures, sequences, containers,
views.

> Ironically enough, I *do* see how zip/filter/etc. are useful -- I used them
> extensively when coding in ML. However, in ML they work on lists of arbitrary
> length, not on tuples of fixed length, and this generality, together with low

Wrong analogy. ML has homogeneous lists, like STL. A list (in ML) is
essentially a sequence of items but they must be all of the same type.

> barrier of entry (friendly syntax, mostly informative error messages), makes
> functional style of thinking easy and encourages it. These algorithms just "do
> not seem" useful at compile-time.. at least not when I'm thinking ML where

Are you saying that MPL is not useful too? Out of curiosity,
have you used MPL?

> probably most of the features provided by fusion come "for free", as
> nonintrusive, almost invisible, language features.
>
> I guess my expectations of fusion are too high -- not only it heavily uses

No, I think your expectations of fusion is not high -- it is wrong.
I am an advocate of FP. I've written FP libraries. There's nothing
special about pattern matching and ML. It's just not what fusion is.

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net