Boost, I really want to love you

Every once in a while I get this idea that the template magic that goes on in the deeper parts of Boost is actually useful — how can you argue with code reuse and separation of concerns? It’s a good thing then that BGL always dilligently reminds me that driving needles under your fingernails can, in comparison, be a great way to spend a few hours. I hereby allow anyone to smack me in the head next time I wax poetic about templates.

Advertisements

2 responses to “Boost, I really want to love you

  1. Much of the time you don’t have to worry about the template metaprogramming black magic…. but this is also why some people prefer Haskell etc.

    • carlosscheidegger

      Absolutely, and I actually use the sane parts of boost – shared_ptr, for example. I also use the iostream and spirit libraries, with mixed levels of success. Spirit has some pretty ugly error messages, but it pales in comparison to what I got with BGL. I see the point of internal and external properties, property maps, etc. But the resulting implementation is so clunky that it is easier to just open the white book and rewrite the algorithms and data structures.

      I would love to use Haskell or OCaml for this. Unfortunately, they’re not nearly as fast as C++, and performance is a deciding factor for this project’s success. I’m fairly profficient in Haskell and OCaml, but multiprocessing with them is much harder than it needs to be. gcc now offers OpenMP which works for much of what I need, so there’s a huge incentive to use it instead. Haskell seems to be moving towards multiprocess graph reduction and GC, but the OCaml guys seem pretty adamant about not supporting multiprocessing. OCaml is almost fast enough to be practical, but you still need lots of performance tweaking like defunctorizing. Maybe I’ll check back 3 years from now.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s