[Bf-committers] How about adding boost uBLAS librarytoblender/extern?

Yves Poissant ypoissant2 at videotron.ca
Mon Jan 26 15:34:03 CET 2009


From: "Shaul Kedem" <shaul.kedem at gmail.com>
Sent: Monday, January 26, 2009 9:08 AM


> - C++ is a superset of C, which means C++ can never be faster than C..

The reverse is also true.

> - Template based coding is hard to debug, sometimes impossible
> (believe me, when u see gdb crash it's not a pretty sight)

The fact that gdb crashes are ugly have little to do with template 
debugging. I have debugged templates in MSVC and it was not more difficult 
than debuging normal C or C++ code. At first, I feared that debugging 
templates was as impossible to do as debugging large macros but it is just 
not the case. Really, debugging templates proved as easy as debugging normal 
C or C++ statement. You can trace them and watch values just as well.

> - C is simpler and compilers are better in optimizing C code

You would have to supply proofs of that. I have compared C vs C++ generated 
assembly code side by side for the different segments of codes numerous 
times and I would be incapable of reaching this conclusion.

> if I'll take Yves' argument and reverse it - there is no reason why we
> can't learn from eigen and code the same optimizations in C,

I invite you to read the refences I provided , understand the technique used 
and think of how you could do that in C without using templates. The trick 
is not any black art. The trick have been used for years in C as well as in 
C++. It consist of hand parsing and coding every vector & matrix expressions 
so they are optimized to generate as less temps as possible and inline. The 
templates just do that for you.

Yves 



More information about the Bf-committers mailing list