[GRASS5] Want GNU libavl ?

David D Gray ddgray at armadce.demon.co.uk
Tue Jan 22 15:55:02 EST 2002


Eric G. Miller wrote:

 >>On Mon, 21 Jan 2002 22:39:07 +0000, David D Gray 
 >><ddgray at armadce.demon.co.uk> wrote:

 >[...]



 >>>could be used, coming from more different plances (which may lead to 
 >>>more
 >>>confusion, at least in principle...)
 >>>Is there anyone who is aware of a usable (GPL'd, LGPL'd) container 
 >>>library for the C programming language?


 >>I know that we have this long-standing policy of preferring ANSI C as 
 >>the central language for GRASS. But the truth is that few people _if 
 >>any_ today in engineering, research, academia use C as the 
development >>language. It is almost universally C++ that is used. I 
think that we >>have to accept that now and move on. We don't need to 
necessarily code >>the core of GRASS in C++, but we should be able to 
wrap in external >>data structures if these are only available (or the 
best >>implementations are available ) in C++. Also reflect : Mitab, 
Dime ... >>the list goes on.


 >I think it's mostly a matter of pragmatism.  ANSI/ISO C89 works well 
 >pretty
 >much everywhere.  Also, GRASS has a lot of code.  Do you want to >rewrite
 >it all?  One problem with C++, it's a one-way street.  Sure, you can 
 >write
 >C that is C++ friendly, but the reverse is difficult.  That a lot of 
 >other
 >folks are primarily using C++ for relatively new projects doesn't have
 >a lot of bearing, when you consider maintaining/enhancing an existing
 >code base written in C.




I'm certainly not advocating C++ for standard developer use. It's just 
that much functionality is more available (by a large order) in C++ 
libraries than in C. If it could enhance the functionality of GRASS, 
even if felt by many to be an uncomfortable add-on, then is it not worth 
at least considering. But as it is poorly portable (at least STL) [and 
Glynn has also pointed this out], maybe it is not useful in this instance.


 >>>The only container library I'm aware of are for the C++ programming 
 >>>language,
 >>>the STL provided with libstdc++, the container library of the 
 >>>WxWindows framework (based on macros rather than on templates) and
 >>>STLPort (www.stlport.org, not sure about the license, anyway it's 
 >>>still
 >>>an STL implementation...).


 >>One of the things that's really lame about C++ is the poor general 
 >>support for some of it's features - core features in my view - like 
 >>exceptions and STL across the range of platforms. So much so that 
even >>it's advocates generally recommend coding without relying on 
these >>features. But it gets a bit of a headache when you create whole 
 >>development systems as a dependency for anyone who wants to build 
 >>GRASS if we choose to use implementations from other languages (like 
 >>Ada/Gnat).


 >Well, if I had a choice between C++ and Ada95, I'd probably choose the
 >latter.  C++ keeps all the dangerous stuff of C and adds new ways to
 >shoot yourself in the foot.  I don't see requiring GNAT as >fundamentally
 >different than requiring bison.  BTW, Ada should be supported in GCC >3.1,
 >as ACT donated their public GNAT to the GCC team.  I hope the GCC folks
 >give it due attention.




I would (and do) prefer Ada95 also. But is it really that portable? 
True, GNAT is portable, but few (no?) other Ada compilers are complete 
.. they're like a box of chocolates... A large problem is resolved if 
GNAT becomes effectively a part of gcc, but how many people compile 
GRASS with something other than gcc?


David





More information about the grass-dev mailing list