Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2002-04-10 16:36:16


----- 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


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