bind doesn't use tuple
why doesn't bind use tuple (internally)? I'm tempted to leave the email as just that. No more to say. OK, maybe one thing - I'm not asking because I necessarily think it should, I can imagine there are reasons, just wondering what they might be. Thanks Tony
Hi, I think whether or not there was a reason to not do it in the first place, the idea should be revisited. I recently implemented a bit of code that figured out the minimum number of parameters that would be required for an arbitrary bind expression. After a while, there was a boatload of code that was just to do with getting around the current bind implementation's decisions that I decided not to pursue it any further - the thing I really wanted to do was do a fusion::for_each... But that was not to be for me! -----Original Message----- From: boost-users-bounces@lists.boost.org on behalf of Gottlob Frege Sent: Wed 3/21/2007 7:11 PM To: boost-users@lists.boost.org Subject: [Boost-users] bind doesn't use tuple why doesn't bind use tuple (internally)? I'm tempted to leave the email as just that. No more to say. OK, maybe one thing - I'm not asking because I necessarily think it should, I can imagine there are reasons, just wondering what they might be.
Sohail Somani wrote:
Hi, I think whether or not there was a reason to not do it in the first place, the idea should be revisited. I recently implemented a bit of code that figured out the minimum number of parameters that would be required for an arbitrary bind expression. After a while, there was a boatload of code that was just to do with getting around the current bind implementation's decisions that I decided not to pursue it any further - the thing I really wanted to do was do a fusion::for_each... But that was not to be for me!
-----Original Message----- From: boost-users-bounces@lists.boost.org on behalf of Gottlob Frege
why doesn't bind use tuple (internally)?
I'm tempted to leave the email as just that. No more to say. OK, maybe one thing - I'm not asking because I necessarily think it should, I can imagine there are reasons, just wondering what they might be.
FWIW, Phoenix2 uses fusion. I wish I had more time to finally do the Lambda/Phoenix merger. Unfortunately, now, I'm too busy with Spirit2 and the Boost conference is just around the corner! Interesting to note that Fusion was developed for the Phoenix/ Lambda merger (among other things). I'm hoping someone else would want to pick up where I left off. Dan? Tobias? Joao? I'm CC'ing you guys :-) (Historical note: lambda did not use tuples for performance reasons. Jaakko noted that fusing the args had some overhead. That was then (g++ 2.95.3). Now, I have benchmarks to prove that the fusing of args into tuples has zero overhead on modern compilers such as VC7.1/8.0/intel. Alas, g++, still has an abstraction penalty. Let's hope g++ catches up in terms of optimization). Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
Gottlob Frege wrote:
why doesn't bind use tuple (internally)?
I don't remember. Tuple precedes Bind in the formal review schedule, so this is not the reason. I probably didn't consider Tuple stable enough to build on it. In those times, compilers such as MSVC6, Borland 5.5, HP aCC 3.x (?) were still important and had interesting limitations. It's easier to fix a compiler issue if everything is self-contained. One case where this paid off recently is when I added the space optimization to _bi::listN at Doug Gregor's request, to make placeholders not take up space in a bound expression. This optimization could've been more difficult with a tuple-based implementation.
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Peter Dimov Sent: Thursday, March 22, 2007 6:35 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] bind doesn't use tuple
One case where this paid off recently is when I added the space optimization to _bi::listN at Doug Gregor's request, to make placeholders not take up space in a bound expression. This optimization could've been more difficult with a tuple-based implementation.
A good point. Is this where the static placeholder came in? That's the point at which I said nevermind :-) Can fusion tuple support this use case?
Sohail Somani wrote:
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Peter Dimov Sent: Thursday, March 22, 2007 6:35 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] bind doesn't use tuple
One case where this paid off recently is when I added the space optimization to _bi::listN at Doug Gregor's request, to make placeholders not take up space in a bound expression. This optimization could've been more difficult with a tuple-based implementation.
A good point.
Is this where the static placeholder came in? That's the point at which I said nevermind :-)
Can fusion tuple support this use case?
Probably. Once I know what Peter is talking about exactly ;-) Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
participants (4)
-
Gottlob Frege
-
Joel de Guzman
-
Peter Dimov
-
Sohail Somani