Boost logo

Boost Users :

Subject: Re: [Boost-users] [phoenix] V2, V3 and the amount of memory needed by the compiler to just include them
From: Joel de Guzman (joel_at_[hidden])
Date: 2011-02-23 20:57:01


On 2/24/2011 7:58 AM, Mathieu Champlon wrote:
> Phoenix is an outstanding component, I have no doubt about that.
> However I have had some mixed results for my use case using V2 and now switching to V3.
>
> I'm writing a (header only/template) library which uses Boost.Phoenix internally.
> By nature this library (a mock object library) often ends up in precompiled headers
> because it's convenient to have it de facto included for whole (unit test) applications.
> By default Microsoft Visual Studio allocates a certain amount of memory for compiling a
> precompiled header, and if it actually needs more then it fails to compile.

We push the compilers hard. No doubt about that. The more (TMP) template metaprogramming
infrastructure library beneath, the more harder it is for the compiler. Phoenix3
has MPL, Fusion and Proto under the hood. These are very powerful infrastructure
libraries (Spirit has all these, plus Phoenix under its hood). I often hear
people rant that TMP is not scalable. And you say that you "fear for the future
usability of Phoenix". To be honest, I did too. I had a deep sabbatical last
year and thought hard about the libraries that I authored (Spirit, Fusion and Phoenix).
I was deeply troubled about these legitimate concerns. I was entertaining the idea
of keeping things plain and simple again and wondered about how life would be
without MPL, Proto and Fusion.

   Until yesterday...

when Bryce Lelbach and Hartmut Kaiser ran the full Spirit regression tests on a
32 core machine with 64 GB of memory in a little more than one minute. Surely, you
would say: but we don't have that kind of a machine! And I don't either :-) But
here's one thing for sure: such multi-core machines with massive memory will
be the norm soon (for a certain definition of "soon"). So to me, this argument
goes back again to the days of 8-bit CPUs and 16KB RAM when people rant about
the usability of higher level languages vs. plain assembler. And quoting
Michael Caisse: "Hello, welcome to 2011. Multicore processors and memory
almost grow on trees."

So will TMP scale? Definitely! Will there be a future for Phoenix and other
template heavy libraries? Unequivocally YES!

   At the very least I would say: Phoenix3 is ahead of its time. Thomas Heller
   did an amazing job!

Regards,

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

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