[GRASS5] Want GNU libavl ?

Working on the polygon simplification problem, I needed a balanced tree
to get efficient (n log n) sorted insert/retrieval. Anyway, I grabbed
Ben Pfaff's libavl 2.0, and it is working out pretty nicely.

I was wondering if it isn't something we might not want to add to the
GRASS repository (note: Ben writes the "library" is intended to be
included in code directly rather than distributed as a shared library).
It has some useful trees: A binary search tree, an AVL tree, and a
Red-Black tree (as well a some variants). It also is ridiculously
over documented (really comes as a book in CWEB format).

Anyway, I expect to include the AVL tree portion already, so ...?

URL: http://www.msu.edu/~pfaffben/avl/

--
Eric G. Miller <egm2@jps.net>

Mmm, I'm planning a full rewrite of s.voronoi, s.delaunay
cause the original Fortune algorithm implementation is not
commented and a bit difficult to read, moreover comp. geom.
textbooks tend to give a sligtly different description of the
alghorithm... I need a priority queue and a balanced tree and
I was considering using the code available at www.purists.org
were also an AVL tree is available...
Should we put togheter a little container library for GRASS
that could be statically linked into the executables? As far as
I remember a b-tree implementation is already in the GRASS cvs,
maybe a more complete library would be useful and could be included
in GRASS 5.1...
Best regards
Andrea Aime

----- Original Message -----
From: "Eric G. Miller" <egm2@jps.net>
To: "GRASS5" <grass5@grass.itc.it>
Sent: Monday, January 21, 2002 5:03 AM
Subject: [GRASS5] Want GNU libavl ?

Working on the polygon simplification problem, I needed a balanced tree
to get efficient (n log n) sorted insert/retrieval. Anyway, I grabbed
Ben Pfaff's libavl 2.0, and it is working out pretty nicely.

I was wondering if it isn't something we might not want to add to the
GRASS repository (note: Ben writes the "library" is intended to be
included in code directly rather than distributed as a shared library).
It has some useful trees: A binary search tree, an AVL tree, and a
Red-Black tree (as well a some variants). It also is ridiculously
over documented (really comes as a book in CWEB format).

Anyway, I expect to include the AVL tree portion already, so ...?

URL: http://www.msu.edu/~pfaffben/avl/

--
Eric G. Miller <egm2@jps.net>
_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

Ah, BTW, I'm not willing to rewrite them just to make
them look better, the fact is that s.voronoi has a bug
that I'm not able to track down and s.delaunay doesn't
support constrained triangulation...
Best regards
Andrea

Andrea Aime wrote:

Mmm, I'm planning a full rewrite of s.voronoi, s.delaunay
cause the original Fortune algorithm implementation is not
commented and a bit difficult to read, moreover comp. geom.
textbooks tend to give a sligtly different description of the
alghorithm... I need a priority queue and a balanced tree and
I was considering using the code available at www.purists.org
were also an AVL tree is available...
Should we put togheter a little container library for GRASS
that could be statically linked into the executables? As far as
I remember a b-tree implementation is already in the GRASS cvs,
maybe a more complete library would be useful and could be included
in GRASS 5.1...
Best regards
Andrea Aime

----- Original Message -----
From: "Eric G. Miller" <egm2@jps.net>
To: "GRASS5" <grass5@grass.itc.it>
Sent: Monday, January 21, 2002 5:03 AM
Subject: [GRASS5] Want GNU libavl ?

> Working on the polygon simplification problem, I needed a balanced tree
> to get efficient (n log n) sorted insert/retrieval. Anyway, I grabbed
> Ben Pfaff's libavl 2.0, and it is working out pretty nicely.
>
> I was wondering if it isn't something we might not want to add to the
> GRASS repository (note: Ben writes the "library" is intended to be
> included in code directly rather than distributed as a shared library).
> It has some useful trees: A binary search tree, an AVL tree, and a
> Red-Black tree (as well a some variants). It also is ridiculously
> over documented (really comes as a book in CWEB format).
>
> Anyway, I expect to include the AVL tree portion already, so ...?
>
> URL: http://www.msu.edu/~pfaffben/avl/
>
> --
> Eric G. Miller <egm2@jps.net>
> _______________________________________________
> grass5 mailing list
> grass5@grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5

_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

If two developers people need that library
we should plan to integrate it.
The idea using a wrapper library might turn out to be the way.

What is the reason that the author does not
want libavl to be dynamically linked?

  Bernhard

On Mon, Jan 21, 2002 at 10:34:22AM +0100, Andrea Aime wrote:

Ah, BTW, I'm not willing to rewrite them just to make
them look better, the fact is that s.voronoi has a bug
that I'm not able to track down and s.delaunay doesn't
support constrained triangulation...

Andrea Aime wrote:
> Mmm, I'm planning a full rewrite of s.voronoi, s.delaunay

> I need a priority queue and a balanced tree and
> I was considering using the code available at www.purists.org
> were also an AVL tree is available...
> Should we put togheter a little container library for GRASS
> that could be statically linked into the executables?

> ----- Original Message -----
> From: "Eric G. Miller" <egm2@jps.net>
> To: "GRASS5" <grass5@grass.itc.it>
> Sent: Monday, January 21, 2002 5:03 AM
> Subject: [GRASS5] Want GNU libavl ?
>
> > Working on the polygon simplification problem, I needed a balanced tree
> > to get efficient (n log n) sorted insert/retrieval. Anyway, I grabbed
> > Ben Pfaff's libavl 2.0, and it is working out pretty nicely.
> >
> > I was wondering if it isn't something we might not want to add to the
> > GRASS repository (note: Ben writes the "library" is intended to be
> > included in code directly rather than distributed as a shared library).

--
Professional Service around Free Software (intevation.net)
The FreeGIS Project (freegis.org)
Association for a Free Informational Infrastructure (ffii.org)
FSF Europe (fsfeurope.org)

Andrea Aime wrote:

Mmm, I'm planning a full rewrite of s.voronoi, s.delaunay cause the original Fortune algorithm implementation is not
commented and a bit difficult to read, moreover comp. geom.
textbooks tend to give a sligtly different description of the
alghorithm... I need a priority queue and a balanced tree and
I was considering using the code available at www.purists.org
were also an AVL tree is available... Should we put togheter a little container library for GRASS
that could be statically linked into the executables? As far as
I remember a b-tree implementation is already in the GRASS cvs,
maybe a more complete library would be useful and could be included
in GRASS 5.1...

Actually there is a simple binary tree from way back. Maybe a btree has been added recently, I don't know, but we do need better container support. I first came across this when I started on the import filters a couple years back. In fact I first linked the v.in.shape binary against Berkeley DB2 btree, which gave a good result, but introducing it at that time was potentially a large job, and there were questions of platform support and its a big package to bundle if it's to become a dependency.

So I agree that a number of different containers could be included, and it would also be good to have some kind of uniformity in the interface to these, like a system of wrapper functions.

David

Alle 19:12, lunedì 21 gennaio 2002, David D Gray ha scritto:

[...]

Actually there is a simple binary tree from way back. Maybe a btree has
been added recently, I don't know, but we do need better container
support. I first came across this when I started on the import filters a
couple years back. In fact I first linked the v.in.shape binary against
Berkeley DB2 btree, which gave a good result, but introducing it at that
time was potentially a large job, and there were questions of platform
support and its a big package to bundle if it's to become a dependency.

So I agree that a number of different containers could be included, and
it would also be good to have some kind of uniformity in the interface
to these, like a system of wrapper functions.

Yes, I fully agree in principle. The problem is that I'm not aware of any
C equivalent of the STL, I mean, a set of container classes with consistent
interfaces. The containers mentioned above are coming from two different
libraries (libavl, www.purists.org), and if we need some other data
structures some other sources
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?
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...).
If I undestand correctly, the system of wrapper functions should be created
from the ground up, or we may accept the convention of a chosen library and
then adapt the other containers we need to these conventions...
Best regards
Andrea Aime

On Mon, 21 Jan 2002 11:19:01 +0100, Bernhard Reiter <bernhard@intevation.de> wrote:

If two developers people need that library
we should plan to integrate it.
The idea using a wrapper library might turn out to be the way.

What is the reason that the author does not
want libavl to be dynamically linked?

I don't think the author is necessarily against it. Basically
each tree type has it's own source file, so I guess the idea
was take what you want and leave the rest. It seems the
author was at least as interested in producing the book about
trees and ways to implement them (including how he did it).
The book is pretty lengthy...

--
Eric G. Miller <egm2@jps.net>

On Mon, 21 Jan 2002 20:33:21 +0100, Andrea Aime <aaime@libero.it> wrote:

Alle 19:12, lunedì 21 gennaio 2002, David D Gray ha scritto:

[...]

> Actually there is a simple binary tree from way back. Maybe a btree has
> been added recently, I don't know, but we do need better container
> support. I first came across this when I started on the import filters a
> couple years back. In fact I first linked the v.in.shape binary against
> Berkeley DB2 btree, which gave a good result, but introducing it at that
> time was potentially a large job, and there were questions of platform
> support and its a big package to bundle if it's to become a dependency.
>
> So I agree that a number of different containers could be included, and
> it would also be good to have some kind of uniformity in the interface
> to these, like a system of wrapper functions.

Yes, I fully agree in principle. The problem is that I'm not aware of any
C equivalent of the STL, I mean, a set of container classes with consistent
interfaces. The containers mentioned above are coming from two different
libraries (libavl, www.purists.org), and if we need some other data
structures some other sources
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?

The latest GLib is probably the closest I can think of. It has hashes, trees,
sets, etc... The reason I went with libavl, is it is purportedly better
optimised for the balanced trees, and it's simple to include the files you
need (two in my case).

--
Eric G. Miller <egm2@jps.net>

Andrea Aime wrote:

Alle 19:12, lunedì 21 gennaio 2002, David D Gray ha scritto:

[...]

Actually there is a simple binary tree from way back. Maybe a btree has
been added recently, I don't know, but we do need better container
support. I first came across this when I started on the import filters a
couple years back. In fact I first linked the v.in.shape binary against
Berkeley DB2 btree, which gave a good result, but introducing it at that
time was potentially a large job, and there were questions of platform
support and its a big package to bundle if it's to become a dependency.

So I agree that a number of different containers could be included, and
it would also be good to have some kind of uniformity in the interface
to these, like a system of wrapper functions.

Yes, I fully agree in principle. The problem is that I'm not aware of any
C equivalent of the STL, I mean, a set of container classes with consistent
interfaces. The containers mentioned above are coming from two different
libraries (libavl, www.purists.org), and if we need some other data structures some other sources

Well, this is because C is not object-oriented, but I just meant that containers would come from different sources and have arbitrarily different entry points for the user (ie of the API), so it would help to create some kind of wrapper library with conventions convenient to us, so that a module author would not have the onerous task of setting up datum structures, allocating keys and data and so on. It would just be a matter of choosing the correct container and then it is one call to initialise it and then start using it. Of course there would still be some differences reflecting the different uses and capabilities of the various containers.

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.

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).

If I undestand correctly, the system of wrapper functions should be created
from the ground up, or we may accept the convention of a chosen library and
then adapt the other containers we need to these conventions...

Ground up in this case. But that might coincide largely with one of the libraries, we just choose the most appropriate design.

Regards

David

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

[snip]

> Yes, I fully agree in principle. The problem is that I'm not aware of any
> C equivalent of the STL, I mean, a set of container classes with consistent
> interfaces. The containers mentioned above are coming from two different
> libraries (libavl, www.purists.org), and if we need some other data
> structures some other sources

Well, this is because C is not object-oriented, but I just meant that
containers would come from different sources and have arbitrarily
different entry points for the user (ie of the API), so it would help to
create some kind of wrapper library with conventions convenient to us,
so that a module author would not have the onerous task of setting up
datum structures, allocating keys and data and so on. It would just be a
matter of choosing the correct container and then it is one call to
initialise it and then start using it. Of course there would still be
some differences reflecting the different uses and capabilities of the
various containers.

Frankly, I think the object-oriented'ness is less the issue, than the fact
that most GRASS API's are very low level (or non-existent). What is needed
is grouping common tasks/functionality into library routines so that there's
one consistent place to go to do X, rather than each module author having to
duplicate a lot of code in other modules.

> 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.

> 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.

> If I undestand correctly, the system of wrapper functions should be created
> from the ground up, or we may accept the convention of a chosen library and
> then adapt the other containers we need to these conventions...

Ground up in this case. But that might coincide largely with one of the
libraries, we just choose the most appropriate design.

Well, you'all are discussing something larger than what I was thinking of.
I think it's a good idea to some higher level data structures. If you guys
want to work on such a thing, great. It'd be nice to have standard things
like linked lists, queue's, stacks and trees along with the other basic
functions in libgis (and can we please change G_malloc and G_realloc not
to cast to a char * !! What a pain that is.).

--
Eric G. Miller <egm2@jps.net>

Eric G. Miller wrote:

> 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.

As well as agreeing with what Eric said, I'd also like to point out
that binaries generated from C tend to be significantly more portable
than those generated from C++. If a binary requires libstdc++, it
typically requires *exactly the same version* of libstdc++ that was
used to build it. And if you want to use a library which is written in
C++, you typically have to use more-or-less the same version of the
compiler that was used to build the library.

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.

Oh yes.

(and can we please change G_malloc and G_realloc not
to cast to a char * !! What a pain that is.).

Consider it done.

--
Glynn Clements <glynn.clements@virgin.net>

On Mon, Jan 21, 2002 at 04:38:24PM -0800, Eric G. Miller wrote:
[...]

Frankly, I think the object-oriented'ness is less the issue, than the fact
that most GRASS API's are very low level (or non-existent). What is needed
is grouping common tasks/functionality into library routines so that there's
one consistent place to go to do X, rather than each module author having to
duplicate a lot of code in other modules.

At GRASS Developers Workshop (Nov. 2001) we had an interesting talk
from Paolo Tonella, ITC-irst, exactly addressing above issue.
Find his paper (Postscript) at:
http://mpa.itc.it/grass2001/proceedings.html
-> Paolo Tonella, ITC-irst: "An Introduction to Clone Detection"

Paolo Tonella <tonella@itc.it> is willing to help the GRASS Development Team
in working on above problems, guiding someone in applying the "clone
detectors" to the GRASS code. Perhaps a nice thesis for an upcoming software
engineer?

Markus

On Mon, Jan 21, 2002 at 10:39:07PM +0000, David D Gray wrote:

I know that we have this long-standing policy of preferring ANSI C as
the central language for GRASS.

For many freshly founded Free Software-projects C still is the first
choice for a reason.

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 do not agree with the statement.
And even if I did I call it a mistake to bet on C++.
We can agree upon that this mistake is made by a large group of
people, though. There is no reason to repeat it.

Without going into the details I do not consider C++ a nice
programming language. There are also general doubts regarding
the object-orientated approach in computer science now.
It concerns databases and programming languages.

For a pointer to skepticsm regarding C++ see one of the
better "language discussions":

  http://www.advogato.org/article/207.html

--
Professional Service around Free Software (intevation.net)
The FreeGIS Project (freegis.org)
Association for a Free Informational Infrastructure (ffii.org)
FSF Europe (fsfeurope.org)

[...]

Well, this is because C is not object-oriented, but I just meant that
containers would come from different sources and have arbitrarily
different entry points for the user (ie of the API), so it would help to
create some kind of wrapper library with conventions convenient to us,
so that a module author would not have the onerous task of setting up
datum structures, allocating keys and data and so on. It would just be a
matter of choosing the correct container and then it is one call to
initialise it and then start using it. Of course there would still be
some differences reflecting the different uses and capabilities of the
various containers.

I agree...

> 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 agree here, too... I definitely prefer OO programming, but that's
mine (and yours) preference... I would like to know what the other
developers think about this issue... in fact I think that having a C++
wrapper over the current libraries could attract some more
developers...

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.

Yes, that's why the KDE project refuses to use exceptions and sticks
to QT containers, less powerful than STL ones but more portable

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).

Yes. BTW, by having C++ wrappers we could also create some
bindings to other languages (Python, Java, and so on, the QT/KDE bindings are
generated by a semi-automated procedure as far as I know)

> If I undestand correctly, the system of wrapper functions should be
> created from the ground up, or we may accept the convention of a chosen
> library and then adapt the other containers we need to these
> conventions...

Ground up in this case. But that might coincide largely with one of the
libraries, we just choose the most appropriate design.

Regards

David

Alle 11:27, martedì 22 gennaio 2002, Bernhard Reiter ha scritto:

On Mon, Jan 21, 2002 at 10:39:07PM +0000, David D Gray wrote:
> I know that we have this long-standing policy of preferring ANSI C as
> the central language for GRASS.

For many freshly founded Free Software-projects C still is the first
choice for a reason.

Portability I think...

> 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 do not agree with the statement.
And even if I did I call it a mistake to bet on C++.
We can agree upon that this mistake is made by a large group of
people, though. There is no reason to repeat it.

Mmm, for what is worth, I can confirm David opinion... here
academic people are using C++ for hard core tasks and Java for
everything else, as far as I can see...

Without going into the details I do not consider C++ a nice
programming language. There are also general doubts regarding
the object-orientated approach in computer science now.
It concerns databases and programming languages.

For a pointer to skepticsm regarding C++ see one of the
better "language discussions":

  http://www.advogato.org/article/207.html

I will read the article, but in fact I keep finding C libraries a bit messy
when compared to well done OO libraries (QT, WxWindows and the like...)
For what concerns use of programming languages in general, I can
report the experience I am having here in Italy. The most widely used
PL here is Visual Basic, followed by Java for net oriented applications
and C++ when you really need speed on a very complicated application
(GIS is one example)... the common opinion here is that if you use C
you're coming from the age of stone... (not my opinion, just what you
hear "on the road", I know only a couple of italian software houses
using straight C, and just to maintain old software until the new version
is written). Ok, stop complaining, it's just that when I'm speaking with
GRASS hackers I have the feeling of living on a different planet :wink: ...

Anyway is not a problem for me to continue using C, but I agree with
other posting here that the GRASS library needs a clean-up :slight_smile:
Best regards
Andrea

The latest GLib is probably the closest I can think of. It has hashes,
trees, sets, etc... The reason I went with libavl, is it is purportedly
better optimised for the balanced trees, and it's simple to include the
files you need (two in my case).

I see... but GLib is at the core of the GNOME programming environment...
is it possible to extract only the more general part without having to
carry also GNOME dependacies?

Andrea

On Tue, Jan 22, 2002 at 12:11:23PM +0100, Andrea Aime wrote:

For what concerns use of programming languages in general, I can
report the experience I am having here in Italy. The most widely used
PL here is Visual Basic, followed by Java for net oriented applications
and C++ when you really need speed on a very complicated application
(GIS is one example)... the common opinion here is that if you use C
you're coming from the age of stone...

It still does not make it a good decision.
We should have the faith to follow our own thinking.

Ok, stop complaining, it's just that when I'm speaking with
GRASS hackers I have the feeling of living on a different planet :wink: ...

The link I gave you will show you that a lot of high profile
Free Software hacker are with us on skeptisism about the choices
academic or commercial chief of development make as you reported.
And they are the bunch that give proprietory software vendors
a run for their money... :slight_smile:

Anyway is not a problem for me to continue using C, but I agree with
other posting here that the GRASS library needs a clean-up :slight_smile:

It certainly does.
It is happening slowly, because it is dirty hard work.
More hands welcome.

  Bernhard
--
Professional Service for Free Software (intevation.net)
The FreeGIS Project (freegis.org)
Association for a Free Informational Infrastructure (ffii.org)
FSF Europe (fsfeurope.org)

Andrea Aime wrote:

>
> The latest GLib is probably the closest I can think of. It has hashes,
> trees, sets, etc... The reason I went with libavl, is it is purportedly
> better optimised for the balanced trees, and it's simple to include the
> files you need (two in my case).

I see... but GLib is at the core of the GNOME programming environment...
is it possible to extract only the more general part without having to
carry also GNOME dependacies?

GLIB can be used alone. It is why they made it a separate lib.

Andrea
_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

--
Robert Lagacé, professeur
Pavillon Comtois
Université Laval
Ste-Foy, Québec, G1K 7P4
tel : (418)-656-2131#2276
Fax : (418)-656-3723
E-mail : lagace@grr.ulaval.ca

Eric G. Miller wrote:

>>On Mon, 21 Jan 2002 22:39:07 +0000, David D Gray >><ddgray@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

Andrea Aime wrote:

[...]

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 agree here, too... I definitely prefer OO programming, but that's
mine (and yours) preference... I would like to know what the other
developers think about this issue... in fact I think that having a C++
wrapper over the current libraries could attract some more
developers...

>

[...]

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).

Yes. BTW, by having C++ wrappers we could also create some bindings to other languages (Python, Java, and so on, the QT/KDE bindings are
generated by a semi-automated procedure as far as I know)

I think ever more complex data structures get developed faster if you use OOP techniques, but I'm not really advocating C++. I much prefer java, Ada - a host of others - before C++. I do concede however that C++ is mainstream and many good implementations are available that are difficult to find elsewhere, even in C, and we should adjust our policy now to be more accomodating to these.

David