Boost logo

Boost :

From: Craig Tiller (ctiller_at_[hidden])
Date: 2002-04-16 13:10:06


I tend to thing that we should simply have both functional and
non-functional ways of solving a problem in meta-programming, simply
because, well, it seems we can :)

If I have a problem in front of me that I can solve in a functional way,
then I have the support tools there in front of me to be able to do so.

If I see the solution first in a non-functional way, then I have the
support tools there in front of me to be able to do so.

The beauty of being in a multiparadigm world is that we can write the
solution to look like the problem space (better than without a
multiparadigm world).

The only concern is that of cost - both compile time and run time. But I
think we have a win in brain time regardless.

On Wed, 2002-04-10 at 17:36, Fernando Cacciola wrote:
>
> ----- Original Message -----
> From: "Andrei Alexandrescu" <andrewalex_at_[hidden]>
> Newsgroups: gmane.comp.lib.boost.devel
> To: <boost_at_[hidden]>
> Sent: Wednesday, April 10, 2002 2:21 PM
> Subject: [boost] Re: Adding Loki to Boost (reprise)
>
>
> > [snipped]
> >
> > I don't know. What I /feel/ is that MPL simply goes in the wrong
> > direction. I don't want iteration and loops in the template engine. It
> > is a pure functional language, and in functional languages you recurse
> > (recurse = curse again :o)).
> >
>
> IMHO, Boost is not aimed at academic circles, but mostly at industry.
>
> Most professional software developers use C++ precisely because is it the
> only multi-paradigm language widely available.
>
> For example, in a pure object-oriented language there are no (free)
> functions, but if I wanted to think in terms of "everything is an object",
> I would use smalltalk, not C++.
>
> Similarly, I know that in a pure functional language there is no state, so I
> can't really iterate along a sequence (since that requires state); but then
> again, if I wanted a pure FL I wouldn't be using C++.
>
> I think that in the context of a non-academic C++ library you can't make an
> argument along the line: "this tool is great in itself, but belongs to a
> different paradigm so you can't use it, even though it is wonderfully
> simulated here".
>
> So the question is: what exactly is the cost of simulating iteration, loops,
> etc in FP? I can understand your argument from a strictly theoretical POV,
> but to put in the context of everyday development, I need to know 'how much
> wrong' is it to squeeze the template engine to do what *I* want to do with
> it (I don't asked it to be just a Turing machine).
>
> Perhaps the problem is that from the perspective of a C++ programmer -thus a
> non-functional programmer- the template engine is defective: it is *just*
> functional :-)
>
> I find it natural for us to try to use it as if it were as procedural as C++
> itself.
>
> >From this view, MPL is totally wonderful because it does precisely that:
> simulates a procedural language within the template engine.
>
> If I wouldn't have to code for a living, I wouldn't try to think in
> non-functional terms while writing template metacode; but I can afford that
> luxury, so in the meantime I need a tool that allows me to do my job in the
> context of my non-functional experience. Even if it means making a hole with
> a pencil :-)
>
> I agree that we need to start mastering more suitable ways to use the
> template engine, but that's not the goal of a 'boost' library.
>
> Fernando Cacciola
> Sierra s.r.l.
> fcacciola_at_[hidden]
> www.gosierra.com
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


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