Boost logo

Boost Users :

Subject: Re: [Boost-users] [Phoenix] review reminder
From: Zeljko Vrba (zvrba_at_[hidden])
Date: 2008-09-29 13:22:53


-cut-

Sorry for the reply to the wrong person, but I've deleted the original
call for reviews.

I used Phoenix 1 two years ago, while Phoenix 2 was still in its infancy.
(I also tested the development version of Phoenix 2 at that time, but it
was too unstable to be useful.) Being acquainted with functional programming
(I have some experience with SML and Ocaml), I can nothing but praise the
documentation -- everything needed to use the library is presented clearly
and (mostly) in logical order. For people not acquainted with FP, it might
be better to put the "Basics" chapter before "Starter Kit", because the
"Basics" chapter explains the basic concepts and motivates partial function
application and lazy evaluation.

I unsuccessfully [*] tried to use Phoenix 2; but if it is as good as Phoenix 1,
it is a great and useful library (I particularly like the "argN" placeholders
instead of _N from BLL). I certainly like the concepts it is built on.

The downside of Phoenix is its interaction (or lack of) with Boost.Lambda. A
while back it has been my main source of confusion -- should I use BLL which
_seems_ less powerful; or at least harder to extend [I really like the
polymorphic function concept in Phoenix]), or Phoenix? Reading about the
possibility of unification of BLL and Phoenix (on various mailing lists), but
without any concrete hints on whether cooperation of Jaako and Joel has begun
or not, does not help to resolve that confusion.

Personally, if my compiler supported the Phoenix library, I'd start using it
immediately. The thing that tips me over in favor of Phoenix 2 the most is its
transparent, logical and well-organized documentation and greater generality
over BLL. Phoenix2 manipulates polymorphic function objects and it is
impressive to see in the documentation the implementation of the lazy while_
statement. Thus, BLL looks like just a special case of Phoenix2.

To avert the confusion, it might help to put in the documentation a table
explaining the main differences between BLL and Phoenix2.

[*] Now, the bad thing: my main development platform is Solaris with SunCC,
version CC: Sun C++ 5.9 SunOS_i386 Patch 124864-07 2008/08/22

I tried to compile libs/spirit/phoenix/example/users_manual/all_odds.cpp
and it fails with many messages like:

"/home/zvrba/COMPILE/boost_1_36_0/boost/preprocessor/slot/detail/shared.hpp",
line 27: Error: Badly formed constant expression.

where the offending line(s) are of the form

# if (BOOST_PP_VALUE) / 1000000000UL == 0

(it seems that the preprocessor doesn't like the UL suffix).

Funnily enough, some programs from the tests/ directory compile and work OK.

That said, I'd recommend that Phoenix2 is accepted into Boost. The main
objection is the lack of description of its relation to BLL, as well as some
hints of future directions. In the long run, I don't think that it is good to
have two overlapping, if not even competing, libraries. My personal preference
goes clearly in favor of Phoenix 2, even though it does not work on the
platform where I'd like to use it (whereas BLL does work).

On Mon, Sep 29, 2008 at 09:24:54AM -0800, Robert Ramey wrote:
> I spent some time looking at this library. I'm looking at the documentation
> in release 1.36 for phoenix in the spirit library documentation.
>


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