[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gsl] a question on an implementation choice
From: |
Nicolas Bock |
Subject: |
[Help-gsl] a question on an implementation choice |
Date: |
Thu, 17 Feb 2011 12:15:01 -0700 |
Hello gsl developers,
I am writing a small linear algebra library from scratch. Since I
fortunately have the freedom to choose, I thought quite long about
what language to implement it in and eventually decided on plain C. I
am at a point now where I would like to provide some data structures
with different types and would like to reuse existing code as much as
possible. I guess a way to look at it is to say that I am basically
trying to get the C++ template functionality from C. Since I have so
far not needed any C++ feature but the templates, I feel that
switching to C++ seems a bit like overkill.
I looked around in the gsl sources and how this problem is solved
there with preprocessor macros. As you have faced and solved the "C++
template in C" problem, I would be very interested in understanding
better what lead to the particular implementation choices you made.
* Why did you decide to stick with C and not use C++ and its template
functionality? Wouldn't that have lead to a cleaner implementation?
* Was portability an issue?
* Was there a particular reason to implement the templates in the C
files with includes to other C files as opposed to in the makefile
with "-D..." preprocessor arguments?
Thanks already,
nick