SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
Cuchulainn
Topic Author
Posts: 61149
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Object Design Quiz

July 6th, 2012, 5:42 pm

QuoteOriginally posted by: PolterHey, Cuch (and others, feel free to tune in; BTW, to avoid any misunderstanding, I'm completely ignoring the subject of discussion for a moment ), incidentally, what do you think about Boost.Functional/OverloadedFunction (recently added in Boost Version 1.50.0): http://www.boost.org/doc/libs/release/l ... dex.htmlIt does not have a Rationale part, aka the Compelling Reason.I doubt if could find a way to use it in its current form.As outrun says, Boost is becoming a bunch of islands of low-level functionality, if you are not careful. Compare with ICL, for example that is extremely useful for MIS systems.
Last edited by Cuchulainn on July 5th, 2012, 10:00 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget
 
User avatar
Polter
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

Object Design Quiz

July 6th, 2012, 6:53 pm

outrun & cuch -- thanks for the input!Yeah, I haven't had time to look too deeply into this lib (hence asking about the opinions first :]; I have also missed the motivation part of the documentation), but I see your points.Definitely agree on the need for modularization! There's http://github.com/ryppl/boost-modularize / http://ryppl.org/ -- however, I'm not sure of the progress in this effort.
Last edited by Polter on July 5th, 2012, 10:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Topic Author
Posts: 61149
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Object Design Quiz

July 7th, 2012, 8:48 am

My 2 cent views on this.At some stage it becomes necessary to merge/use libraries in applications and one possible scenario of the future is to provide software modules/libraries/frameworks that use existing lower-level Boost library. Some kind of 'uses hierarchy' or Microkernel architecture (like OS Chorus) would be useful IMO.One positive feedback we receive is that readers/developers really appreciate it when librarie are well-documented (Math Toolkot and Date are super in this respect). Maybe a Boost version of NAG, IMSL, ...The learning curve is an issue; e.g. Flyweight library has a good approach as it uses various 'levels' of interface facades. Ex. Many libraries can be aggregated to form higher-level abstractions. Then the focus is not just CS savvy but also knwledge of the domain in questions. And there is a great opportunity for the Boost community. BTW why not more interop to C#, etc. After all, not everyone works with C++ all the time.
Last edited by Cuchulainn on July 6th, 2012, 10:00 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget
 
User avatar
Cuchulainn
Topic Author
Posts: 61149
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Object Design Quiz

July 7th, 2012, 9:02 am

QuoteThe learning burden doesn't outweight simple alternatives. I'm sure you can solve a problem like this in 1 minute using native language constructs by eg improving your design, True. But who decides what is and what is not useful? Is it idiosyncratic process until some marketing is done up-front.For example, would this idea fit into Boost?For me, I would use a different design and second the code will be difficult. This would be a reason for not adopting a library.Again, what is the "Compelling Reason scenario"?
Last edited by Cuchulainn on July 7th, 2012, 10:00 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget
 
User avatar
Cuchulainn
Topic Author
Posts: 61149
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Object Design Quiz

July 8th, 2012, 9:41 am

BTW I see about 5 new libraries in Boost 1.50. Wow.
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget
 
User avatar
Cuchulainn
Topic Author
Posts: 61149
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Object Design Quiz

July 9th, 2012, 4:47 am

QuoteOriginally posted by: PolterHey, Cuch (and others, feel free to tune in; BTW, to avoid any misunderstanding, I'm completely ignoring the subject of discussion for a moment ), incidentally, what do you think about Boost.Functional/OverloadedFunction (recently added in Boost Version 1.50.0): http://www.boost.org/doc/libs/release/l ... dex.htmlIt would seem that this library is implementing some kind of coercion in a compile-polymorphic way?Do the examples given crop up in real life? What about alternatives such as variant<f1, f2, f3> and a static_visitor? Or even return a Boost any and then cast to the correct type?
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget
 
User avatar
Polter
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

Object Design Quiz

July 9th, 2012, 6:17 pm

QuoteOriginally posted by: CuchulainnIt would seem that this library is implementing some kind of coercion in a compile-polymorphic way?Do the examples given crop up in real life? What about alternatives such as variant<f1, f2, f3> and a static_visitor? Or even return a Boost any and then cast to the correct type?Good questions!I wish these were answered in the docs, as they're among the ones that are of interest to me, too!As I've mentioned, haven't had time to go too deeply into this; I've skimmed through some discussions on the mailing list (admittedly, the docs don't provide that much rationale/motivation info anyway, which is rather unfortunate, IMHO; notice that both proposed (Boost.)Overload and accepted Boost.Functional/OverloadedFunction are discussed and compared), here are some of the relevant ones:http://lists.boost.org/Archives/boost/2 ... 191629.php // "Boost.Functional/OverloadedFunction was reviewed and accepted as part of the Boost.Local(Function) review."Quote"(Boost.)Overload is a dynamic wrapper of multiple callable objects. All started from a Joel de Guzman's post where he showed a proof of concept of a thin-wrapper of several Boost.Functions. See: http://lists.boost.org/Archives/boost/2 ... 127906.php On that code base, I designed (Boost.)Overload that provides an interface similar to Boost.Function.A first difference is that with (Boost.)Overload is possible to create an empty boost::overload object, and then set up callable targets at a later time, obviously the library provides methods for checking if a given callable target is empty. That matches exactly what Boost.Function does.. . .A natural use case is to utilize (Boost.)Overload for generating a Boost.Variant visitor"Source: http://lists.boost.org/Archives/boost/2 ... 669.phpFor a moment I got excited that we'd have a (statically-)polymorphic Boost.Function and that was mainly the reason that I've gotten briefly interested in this lib the first place (personally, that's where my "compelling reason scenarios" fit in -- I've got some annoyances with the limitations of monomorphic std::function & lambdas in C++11 and a standardized solution would be welcome) -- however, this turned out not to be possible: http://lists.boost.org/Archives/boost/2 ... hpQuote"No. Overload supports a *finite* overload set, what you'd like to design is a TemplateFunction supporting an *infinite* overload set:template_function< void(int, int), void (_1) > f( &mono, poly() );where _1 is a placeholder for a template parameter.As Steven Watanabe explained very clearly in the other post that is not doable in general.However Overload provides a method that accepts a polymorphic function object as argument. The passed function object sets/replaces all the existent object targets related to the call signatures supported by both the given instantiation of the template class overload and the passed function object itself. "Source: http://lists.boost.org/Archives/boost/2 ... 770.phpSee also (incl. links to reviews) "[Boost-announce] [boost] [review] [Local] Review Result - ACCEPTED":http://lists.boost.org/boost-announce/2011/12/0340.php
Last edited by Polter on July 8th, 2012, 10:00 pm, edited 1 time in total.
 
User avatar
quantmeh
Posts: 5974
Joined: April 6th, 2007, 1:39 pm

Object Design Quiz

July 9th, 2012, 9:06 pm

Objects don't need design. Structural code needs design, that's why it's so difficult to program. the object code is all about creating individual objects, and letting them figure out things between themselves.
 
User avatar
Cuchulainn
Topic Author
Posts: 61149
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Object Design Quiz

July 10th, 2012, 6:10 am

QuoteOriginally posted by: quantmehObjects don't need design. Structural code needs design, that's why it's so difficult to program. the object code is all about creating individual objects, and letting them figure out things between themselves.Ok, how does a square figure out its invariants?
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget
 
User avatar
Cuchulainn
Topic Author
Posts: 61149
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Object Design Quiz

July 10th, 2012, 6:14 am

I think something along the lines of a variant visitor is a good idea. If that happens someone is going to ask how to concatenate visitors (like continuations and catamorphisms in FP languages).BTW whatever happened to C++ FP library? Visitor and FP catamorphism(?)
Last edited by Cuchulainn on July 9th, 2012, 10:00 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget
 
User avatar
Polter
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

Object Design Quiz

July 10th, 2012, 12:26 pm

> BTW whatever happened to C++ FP library?http://c2.com/cgi/wiki?FunctoidsInCpp
 
User avatar
Polter
Posts: 2526
Joined: April 29th, 2008, 4:55 pm

Object Design Quiz

July 10th, 2012, 1:07 pm

outrun, I think we should genericize the dog-cheese connector to allow for arbitrary AnimalConcept and FoodConcept -- you never know! In the end, we should arrive at generic BeverageConcept factory :-)
Last edited by Polter on July 9th, 2012, 10:00 pm, edited 1 time in total.
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On