RE: [boost] Re: Interesting Boost Implementation Details?

[ David Abrahams] I'll be giving two talks at SD West in March, one about template metaprogramming, and another called "Inside the Boost Libraries," where I plan to discuss some of the more interesting Boost internals. You can see a synopsis at http://www.cmpevents.com/SDw5/a.asp?option=G&V=3&id=271893
I'm trying to decide exactly what to cover there. I've listed some of my ideas below, but I'm obviously not familiar with the entire Boost codebase, so I thought I'd solicit suggestions. Thoughts, anyone?
More thoughts to add to this thread. Background: * I have attended presentations from folks that they have taken VERY interesting material and made it EXTREMELY boring * I have also attended presentations from folks and it has been exciting and thrilling to watch the information unfold. I was kept on the edge of my seat waiting to see what was going to happen next * I have noticed that the crowd's at the shows are not always the "Type A" programmers, and frequently don't seem to engage or have the background information necessary to really understand the topic being presented * With complex subjects, for myself, I have noticed that once I know how to "think about something" and then I "get it". I can than think about any aspect of that, because I understand the concepts necessary to process the information. * if one can find the "sweet spot" early in the presentation for getting the crowd to "think" the right way to grasp the rest of the presentation, then you have a much better chance of ending the talk with everyone excited. (because you have taught them something and then took them along for a ride where you showed how to USE that new way of thinking) * I spent *A LOT* of time with Boost.Lamda. Writing sample code, re-reading the documentation, over and over and over and over again. It took me many passes to "get it". This is an excellent library, and the document IS well done. I think this is just the classic problem of really smart people having a hard time figuring out how to present something to someone who does not "know how to think about it". I took a look at the phoenix v2 docs. What is cool is THIS PAGE: http://tinyurl.com/3khbu What stood out about it was THIS ONE PAGE would have saved me many many hours had it been in the original Lambda docs. Because it describes for me, how to "think" about the currying. My advice to you is to find a way, in your presentation of the boost internals, to make sure that you thread it such that the people watching "can think about it". If you establish this early on, you will have an excited audience and you will (hopefully) get more people to use boost. Detailed Suggestions: * the pics in the above link are conceptually excellent for describing how to think about currying. If you can accomplish something along the same lines with the techniques you are going to show, then you will really knock em dead. * Boost internals is an excellent subject matter, I think if you first hit common concepts- and THEN delve into those concepts and how the internals of the library(ies) use that concept you will give people something they can use. * in a previous mail I made the suggestion, which I will make again. Try to think of the most important techniques the boost libraries depend on, get them in peoples heads, and then delve into the internals. * a technique I have seen used in the mags, is to decompose the templates, I.e. show what the code looks like after the compiler has gone through the generation steps. * hopefully my suggestions, though not exactly what you asked for, will be of some use to you. :) Brian

Brian Braatz wrote:
What is cool is THIS PAGE:
What stood out about it was THIS ONE PAGE would have saved me many many hours had it been in the original Lambda docs. Because it describes for me, how to "think" about the currying.
Unfortunately this page confuses currying with partial function application as I explain here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52549 and also in this thread: http://tinyurl.com/4tgez
My advice to you is to find a way, in your presentation of the boost internals, to make sure that you thread it such that the people watching "can think about it".
I always try.
If you establish this early on, you will have an excited audience and you will (hopefully) get more people to use boost.
Detailed Suggestions: * the pics in the above link are conceptually excellent for describing how to think about currying.
Err, partial application.
If you can accomplish something along the same lines with the techniques you are going to show, then you will really knock em dead.
* Boost internals is an excellent subject matter, I think if you first hit common concepts- and THEN delve into those concepts and how the internals of the library(ies) use that concept you will give people something they can use.
I've noticed that many of the bigger-named speakers seem to dwell on the weird corners of C++ rather than making it understandable. People are left thinking "C++ is weird" rather than understanding its logic and feeling powerful using it. Audiences seem to eat it up, though. Or at least they keep going back for more punishment ;-). Most of my talks try to eschew curiosities and details and instead concentrate on the conceptual and fundamental. This one, however, is explicitly intended to look at details. That said, I will of course be putting things in context. I just feel compelled that way ;-)
* in a previous mail I made the suggestion, which I will make again. Try to think of the most important techniques the boost libraries depend on, get them in peoples heads, and then delve into the internals.
??? Hm. Those techniques _are_ the internals.
* a technique I have seen used in the mags, is to decompose the templates, I.e. show what the code looks like after the compiler has gone through the generation steps.
* hopefully my suggestions, though not exactly what you asked for, will be of some use to you.
I'll keep that in mind. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

David Abrahams wrote:
Brian Braatz wrote:
What is cool is THIS PAGE:
What stood out about it was THIS ONE PAGE would have saved me many many hours had it been in the original Lambda docs. Because it describes for me, how to "think" about the currying. >
Unfortunately this page confuses currying with partial function application as I explain here:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52549
and also in this thread: http://tinyurl.com/4tgez
I believe I patterned this after FC++: http://www.cc.gatech.edu/~yannis/fc++/currying.html http://www.cc.gatech.edu/~yannis/fc++/currying-tutorial.txt Are you saying that Brian and Yannis also got it wrong? ''' "Currying" basically refers to the ability to call a function on some subset of its arguments; such a function can be referred to as "curryable". The result of calling a function with only some of its arguments is a new function, which expects the rest of the arguments. ''' In a link that you provided: http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?curried+function it is defined as: A function of N arguments that is considered as a function of one argument which returns another function of N-1 arguments. IMHO, sticking strictly to this definition is pedantic. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net

On Mon, 10 Jan 2005 13:09:55 +0800, Joel <djowel@gmail.com> wrote:
In a link that you provided:
http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?curried+function
it is defined as:
A function of N arguments that is considered as a function of one argument which returns another function of N-1 arguments.
IMHO, sticking strictly to this definition is pedantic. It seems pretty good and concise to me (also stressing the point that curried functions are unary functions).
- Michael

Michael Walter wrote:
On Mon, 10 Jan 2005 13:09:55 +0800, Joel <djowel@gmail.com> wrote:
In a link that you provided:
http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?curried+function
it is defined as:
A function of N arguments that is considered as a function of one argument which returns another function of N-1 arguments.
IMHO, sticking strictly to this definition is pedantic.
It seems pretty good and concise to me (also stressing the point that curried functions are unary functions).
Ok, I'll have to agree with you and Dave. Let's keep the terms straight. Here's an update to the docs: http://tinyurl.com/3khbu Thanks! Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net

Joel wrote:
I believe I patterned this after FC++:
http://www.cc.gatech.edu/~yannis/fc++/currying.html http://www.cc.gatech.edu/~yannis/fc++/currying-tutorial.txt
Are you saying that Brian and Yannis also got it wrong?
They must have. Which is strange, because it was Brian who set me straight about this issue. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

David Abrahams wrote:
Joel wrote:
I believe I patterned this after FC++:
http://www.cc.gatech.edu/~yannis/fc++/currying.html http://www.cc.gatech.edu/~yannis/fc++/currying-tutorial.txt
Are you saying that Brian and Yannis also got it wrong?
They must have. Which is strange, because it was Brian who set me straight about this issue.
A google search for ["partial function application" currying] gives me lots of links that assume the equivalence: "partial function application (currying)..." "Partial function application is like super currying..." "allows currying, or partial function application..." "Currying arguments allows partial function application..." "partial function application (currying)..." "This is sometimes called partial function application..." "function application, colloquially known as currying..." "The technique is also related to currying, the partial function application mechanism in the functional programming domain..." "currying means partial function application..." "currying [Barendregt, 1993], or partial function application..." ... the list goes on. Even the boost lambda library mentions "currying": "currying, and using the sig template to specify the return..." There's no currying in BLL, at least not by the definition you gave. The wikipedia has an even stricter definition: ''' currying is the technique of transforming a function taking multiple arguments into a function that takes a single argument (the first of the arguments to the original function) and returns a new function which takes the remainder of the arguments and returns the result. ''' Here, it is only the first argument. If we follow this strict definition, I dare say that most (all?) modern languages (even Haskell) misuse the term "curry" and that the strict definition has little value now and should probably be modernized. Heck, Moses Schönfinkel invented that in 1924! Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net

Joel wrote:
The wikipedia has an even stricter definition:
''' currying is the technique of transforming a function taking multiple arguments into a function that takes a single argument (the first of the arguments to the original function) and returns a new function which takes the remainder of the arguments and returns the result. '''
Here, it is only the first argument. If we follow this strict definition, I dare say that most (all?) modern languages (even Haskell) misuse the term "curry" and that the strict definition has little value now and should probably be modernized. Heck, Moses Schönfinkel invented that in 1924!
Even the wikipedia contradicts itself when it says: ''' The practical motivation for currying is that very often the functions you get by supplying some but not all of the arguments to a curried function are useful; ... ''' the contradictory word is "some" vs. "single". [ http://en.wikipedia.org/wiki/Currying ] Cheers, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
participants (4)
-
Brian Braatz
-
David Abrahams
-
Joel
-
Michael Walter