comp.lang.ada
 help / color / mirror / Atom feed
From: "MMM" <terekhov@emc.com>
Subject: Re: GCC 4.0 Ada.Containers Cursor danger.
Date: 11 Jul 2005 19:11:31 -0700
Date: 2005-07-11T19:11:31-07:00	[thread overview]
Message-ID: <1121134291.379399.79460@z14g2000cwz.googlegroups.com> (raw)
In-Reply-To: 42d2bc2d$0$20148$9b4e6d93@newsread2.arcor-online.net

Georg Bauhaus wrote:
> MMM wrote:
>
>> The reason is that, if one
>> remember some mathematics, having an order is a fundamental property
>> that distinguish vectors and lists on the one side and sets and hashes
>> on the other.
>
>
> I think it is not too helpful to consider Ada.Containers to be
> derived from some collection of mathematical notions and from
> nothing else.
>
You are right that for the person not familiar with mathematics
that will be of no help. But I suspect that people designing
computer programs in general and designing programs in Ada in
particular have some knowledge of at least simple math. Note also
that mathematics is the lingua franca not only for the science but
also for programming and computers in general. Note also that it is
not "some collection of mathematical notions", it is a well known
theory, while current proposal of container types *is* some collection
of mixed notations and it looks like it is derived from "nothing else"
only.

> First, Ada.Containers is not trying to approximate some notions
> from linear algebra ("orthogonal normal basis"), metaphorically
Note that this notion is not limited to linear algebra and I'm not
agitating
for implementation of this notion in Ada.Containers in any way!
;):);):)
What I've ment is that library should implement all commonly used and
accepted abstractions and then, if it is practical, implement all
needed
specialisations, mixtures, etc.

> or not. ;-) You'll have justify the implication that
> we should build computer libraries around some specific
> choice of notions loosly derived from mathematics. Doing this
> is not a matter of course, as reactive systems are not all
> about mathematics.
I'm not sure what you mean by "reactive systems", but anyway.
My justification is very simple. Such a generic library as
Ada.Containers, which should serve as a basis for a wide variety
of programs, should be based on a well known abstraction commonly
accepted and understood by every programmer, not only by couple of
authors. The foundations of this library should be derived from the
common experience, not from the experience of one man. For example
of what other programmers think about containers see the following
links (as well as how this abstraction is implemented in other
languages such as Java, Python etc.)

http://en.wikipedia.org/wiki/Set_%28computer_science%29
http://en.wikipedia.org/wiki/Hash_table
http://en.wikipedia.org/wiki/List_%28computer_science%29
http://en.wikipedia.org/wiki/Array

Actually current proposal have to justify the use of such a
wonderful abstractions as Ordered_Sets, Hashed_Sets, Hashed_Maps and
Ordered_Maps as a basic set of abstractions.

>
> Second, the way Ada.Containers invites you to think about the order
> of elements ("containers are nothing, elements are everything").
> There might be some physical/logical correspondence between the
> order of elements in some container on the one hand, and their
> order as implied by the user's ordering functions passed during
> instantiation. Or there might not. It is more important what a
Can't argue with that ;)

> user wishes to to using the elements that happen to be elements
> of some collection. I.e. while it remains advisable to choose the
> proper container, Cursors are among the means to choose different
> containers when the need arises, ideally without disturbing the rest of
> the program.
I can't say I understand you here, but anyway, how cursors could
help to change container type without disturbing the rest of the
program?

>
> There are a number of "orders" of elements in this discussion.
I think you overestimate a little here. Order either is present
or is not.

> There are those on which you seem to build your correspondence, IIUC.
> Elements ordered relative to one another in the list and vector
> abstractions,
> because that is what a mathematician might assign to the notions.
Yes, YUIC. But it is not because "a mathematician" created this notion.
This is how all mathematicians *and* programmers understand it.

> But some elements are ordered relative to one another in ordered sets or
> maps
> that are ordered by key. This order need not entail the use of a list,
> and indeed requiring List/Vector <-> order will defeat several uses
> of the library which is rather more flexible. If I want a set for
> (a) memebership test, and (b) an ordered collection, then why should I
> store
> the elements in some List oder Vector just because I want element
> insertion to preserve order as well?
This exaple doesn't count. Membership test is common to any collection.
If you only need ordering then you can use array/vector or list
depending
on what kind of access you need. Why would you choose a set or hash?
And if you chose to have such a specialized type as Ordered_Map then
you

> Indeed, a close correspondence of order and choice of container
> will defeat some generic algorithms.
Care to provide an example of such a generic algorithm? If your
algorithm is so generic that order and access details are not
important, then express you algorithm in terms of Abstract_Collection.
Then averyone could choose any collection type that fits the task
in question most.

>
> I think it is of no primary concern here that some branches of
> mathematics can
> do without ordered sets, and that there is a natural ordering by position
> in a list. The library is for programmers, not for mathematical
> housekeepers. ;-)  There is a treasure trove of mathematical theory of
> computation that starts from computation in computers, and not the other
> way round :-)
>
I really hope that the smiles you put here really mean something ;)
Otherwise your disregard of mathematics and computer science could led
you to reinvent a lot of weels. ;( One need to have a knowledge to
distinguish a therasure from trash :) The sad thing is that this
proposal
forces the whole Ada comunity to learn the hard way and to reinvent
collections from scratch. Take a look at others languages collections
implementations.

>
>
>> Another silliness is overgeneralization of the
>> 'iterrator' concept and renaming it to 'cursor'.
>
>
> Given the operations of Cursors, I can see clearly how I can
> use Cursor operations in iteration. OTOH, iteration
Of course you can! One can use his computer to watch TV or even to
move his lawn, but that is not a justification for renaming this
computer to TV-set or mover. Authors of this proposal stated that
they model their library on STL. So why to name the same thing
differently?

> means doing something again, but an STL iterator (a pointer,
> really, or cursor if you wish) doesn't require that I do something
> again...
So what?

>
>
>> The problem here is that this terminology doesn't reflect the
>> fundamental differences between these types and mixes underlying
>> mathematical conncepts in some unregular way.
>
>
> If the library confuses a mathematician because he/she is used
> to some meanings of words, then maybe emphasising the Ada definitions,
> which relate to computers, will help?
>
Ok, it looks like you really hate mathematicians :) Why? To soothe you
I
can tell that I'm not a mathematician. I'm a physisist by education
and a programmer for the last 20 years. This library confuses me as a
programmer. I've always loved Ada 83 and 95. I really believe that its
standard library stands out by its clarity, completeness and
correctness.
Current proposal for Ada.Containers doesn't meet these high standards
yet.
It is too raw. It looks like the authors of this proposal didn't have a
goal of creating clear and solid foundation for future library
development.
It looks like they provided just a bunch of special case algorithms and

abstractions using far from perfect terminology. To understand this one
need
no degree in mathematics, just look around - STL,Java,Python, etc.,etc.

> 
> -- Georg

Mikhail




  reply	other threads:[~2005-07-12  2:11 UTC|newest]

Thread overview: 195+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-04 11:01 GCC 4.0 Ada.Containers Cursor danger Dmitriy Anisimkov
2005-07-04 18:56 ` Georg Bauhaus
2005-07-04 19:07   ` Georg Bauhaus
2005-07-05  4:27   ` Dmitriy Anisimkov
2005-07-05 15:01     ` Matthew Heaney
2005-07-06  9:10   ` Maxim Reznik
2005-07-06 10:45     ` Georg Bauhaus
2005-07-06 13:57       ` Maxim Reznik
2005-07-06 14:53         ` Georg Bauhaus
2005-07-06 15:09         ` Matthew Heaney
2005-07-06 16:37           ` Dmitriy Anisimkov
2005-07-06 16:43             ` Matthew Heaney
2005-07-06 22:24         ` Randy Brukardt
2005-07-07 10:23         ` Alex R. Mosteo
2005-07-06 12:41     ` Matthew Heaney
2005-07-06 15:37     ` Matthew Heaney
2005-07-06 21:51   ` Randy Brukardt
2005-07-05 14:51 ` Matthew Heaney
2005-07-05 17:11   ` Dmitriy Anisimkov
2005-07-05 18:02     ` Matthew Heaney
2005-07-05 19:08       ` Dmitriy Anisimkov
2005-07-05 19:26         ` Matthew Heaney
2005-07-05 19:44           ` Dmitriy Anisimkov
2005-07-05 20:06             ` Matthew Heaney
2005-07-06  2:10               ` Dmitriy Anisimkov
2005-07-06 22:44                 ` Randy Brukardt
2005-07-07  3:41                   ` Dmitriy Anisimkov
2005-07-07 19:18                     ` Randy Brukardt
2005-07-08  3:01                       ` Dmitriy Anisimkov
2005-07-09  6:17                         ` Simon Wright
2005-07-11  2:24                           ` Dmitriy Anisimkov
2005-07-11  2:24                           ` Dmitriy Anisimkov
2005-07-06  5:52     ` Martin Dowie
2005-07-06  7:02       ` Dmitriy Anisimkov
2005-07-06  8:02         ` Georg Bauhaus
2005-07-06  8:37           ` Dmitriy Anisimkov
2005-07-06  9:06             ` Pascal Obry
2005-07-06 12:14             ` Georg Bauhaus
2005-07-06  7:53       ` Pascal Obry
2005-07-06  8:44         ` Dmitriy Anisimkov
2005-07-06  9:03           ` Pascal Obry
2005-07-06  9:34             ` Dmitriy Anisimkov
2005-07-06  9:42               ` Pascal Obry
2005-07-06  9:45                 ` Dmitriy Anisimkov
2005-07-06 10:40                   ` Georg Bauhaus
2005-07-06 16:22                     ` Dmitriy Anisimkov
2005-07-06 16:42                       ` Matthew Heaney
2005-07-06 16:59                         ` Dmitriy Anisimkov
2005-07-06 17:12                           ` Matthew Heaney
2005-07-06 18:12                       ` Georg Bauhaus
2005-07-07 12:29                         ` Dmitriy Anisimkov
2005-07-07 12:46                           ` Matthew Heaney
2005-07-07 13:01                             ` Dmitriy Anisimkov
2005-07-07 13:20                               ` Matthew Heaney
2005-07-07 13:54                           ` Georg Bauhaus
2005-07-07 17:56                             ` Dmitriy Anisimkov
2005-07-07 22:12                               ` Georg Bauhaus
2005-07-15 18:03                                 ` Dmitriy Anisimkov
2005-07-16  1:45                                   ` Matthew Heaney
2005-07-17  3:55                                     ` Dmitriy Anisimkov
2005-07-17  4:29                                       ` Matthew Heaney
2005-07-07 19:29                           ` Randy Brukardt
2005-07-08  2:41                             ` Dmitriy Anisimkov
2005-07-06 22:56               ` Randy Brukardt
2005-07-06 22:51         ` Randy Brukardt
2005-07-07  0:24           ` Matthew Heaney
2005-07-07  3:20             ` Randy Brukardt
2005-07-06  7:30     ` Dmitry A. Kazakov
2005-07-06  7:50       ` Georg Bauhaus
2005-07-06  8:11         ` Dmitriy Anisimkov
2005-07-06 11:36         ` Dmitry A. Kazakov
2005-07-06 12:14           ` Georg Bauhaus
2005-07-06 23:07           ` Randy Brukardt
2005-07-07  8:01             ` Dmitry A. Kazakov
2005-07-07 10:38               ` Georg Bauhaus
2005-07-07 13:00                 ` Dmitry A. Kazakov
2005-07-07 13:41                   ` Matthew Heaney
2005-07-07 22:12                   ` Georg Bauhaus
2005-07-08  8:48                     ` Dmitry A. Kazakov
2005-07-08 10:41                       ` Georg Bauhaus
2005-07-08 13:03                         ` Dmitry A. Kazakov
2005-07-08 13:31                           ` Matthew Heaney
2005-07-10  2:12                           ` Randy Brukardt
2005-07-10  8:52                             ` Dmitry A. Kazakov
2005-07-11 10:58                               ` Georg Bauhaus
2005-07-11 12:18                                 ` Dmitry A. Kazakov
2005-07-11 13:50                                   ` Georg Bauhaus
2005-07-11 18:38                               ` Randy Brukardt
2005-07-12  8:44                                 ` Dmitry A. Kazakov
2005-07-12 10:33                                   ` Georg Bauhaus
2005-07-12 20:38                                   ` Randy Brukardt
2005-07-08 13:15                       ` Matthew Heaney
2005-07-08 14:02                         ` Dmitry A. Kazakov
2005-07-08 14:52                           ` Matthew Heaney
2005-07-11 14:57                             ` MMM
2005-07-11 18:36                               ` Georg Bauhaus
2005-07-12  2:11                                 ` MMM [this message]
2005-07-12 21:47                                   ` Randy Brukardt
2005-07-13  4:31                                     ` MMM
2005-07-13  1:15                                   ` Georg Bauhaus
2005-07-13  2:46                                     ` Matthew Heaney
2005-07-14  4:11                                     ` Mikhail Terekhov
2005-07-14 12:44                                       ` Matthew Heaney
2005-07-19  1:38                                         ` Mikhail Terekhov
2005-07-19  3:21                                           ` Matthew Heaney
2005-07-14 23:03                                       ` Georg Bauhaus
2005-07-15  8:36                                         ` Dmitry A. Kazakov
2005-07-15 10:39                                           ` Georg Bauhaus
2005-07-15 14:10                                             ` Dmitry A. Kazakov
2005-07-15 12:10                                           ` Matthew Heaney
2005-07-19  3:51                                             ` Mikhail Terekhov
2005-07-19 11:35                                               ` Matthew Heaney
2005-07-19  3:11                                         ` Mikhail Terekhov
2005-07-19 12:44                                           ` Matthew Heaney
2005-07-20  5:20                                             ` Simon Wright
2005-07-21  2:39                                               ` Matthew Heaney
2005-07-21  3:23                                               ` Randy Brukardt
2005-07-19 23:51                                           ` Randy Brukardt
2005-07-20 15:33                                             ` Robert A Duff
2005-07-11 14:56                         ` MMM
2005-07-11 23:24                           ` Matthew Heaney
2005-07-12  3:05                             ` MMM
2005-07-12  5:32                               ` Simon Wright
2005-07-13  2:41                                 ` MMM
2005-07-12 11:16                               ` Georg Bauhaus
2005-07-16 22:28                                 ` Robert A Duff
2005-07-12 13:32                               ` Marc A. Criley
2005-07-12 14:51                                 ` MMM
2005-07-12 15:35                                   ` Matthew Heaney
2005-07-12 18:40                                     ` MMM
2005-07-12 19:12                                       ` Matthew Heaney
2005-07-12 19:42                                         ` MMM
2005-07-12 20:02                                           ` Georg Bauhaus
2005-07-13  3:52                                             ` MMM
2005-07-12 20:13                                           ` Matthew Heaney
2005-07-12 21:38                                     ` Simon Wright
2005-07-12 17:44                                   ` Marc A. Criley
2005-07-12 18:51                                     ` MMM
2005-07-12 19:15                                       ` Matthew Heaney
2005-07-12 19:47                                         ` Georg Bauhaus
2005-07-13  2:20                                           ` Matthew Heaney
2005-07-12 20:00                                         ` MMM
2005-07-12 20:09                                           ` Georg Bauhaus
2005-07-12 20:15                                           ` Matthew Heaney
2005-07-12 21:01                                           ` Randy Brukardt
2005-07-13  4:16                                             ` MMM
2005-07-19 23:58                                               ` Randy Brukardt
2005-07-12 21:59                                         ` Simon Wright
2005-07-12 20:56                                       ` Randy Brukardt
2005-07-14  5:01                                         ` Mikhail Terekhov
2005-07-20  0:10                                           ` Randy Brukardt
2005-07-07 12:36               ` Matthew Heaney
2005-07-07 12:52             ` Dmitriy Anisimkov
2005-07-07 13:52               ` Georg Bauhaus
2005-07-07 17:49               ` Dmitriy Anisimkov
2005-07-07 18:35                 ` Matthew Heaney
2005-07-08 17:52                   ` Craig Carey
2005-07-07 17:50               ` Dmitriy Anisimkov
2005-07-07 19:47               ` Randy Brukardt
2005-07-08  2:28                 ` Dmitriy Anisimkov
2005-07-09 14:20                   ` Matthew Heaney
2005-07-10  1:51                   ` Randy Brukardt
2005-07-10  5:46                     ` Craig Carey
2005-07-10  6:13                       ` Craig Carey
2005-07-11 17:33                       ` OT: Greg and Colin? (was Re: GCC 4.0 Ada.Containers Cursor danger.) Marc A. Criley
2005-07-06 22:34     ` GCC 4.0 Ada.Containers Cursor danger Randy Brukardt
2005-07-07  0:22       ` Matthew Heaney
2005-07-07  3:17         ` Randy Brukardt
2005-07-08  5:34           ` Jeffrey Carter
2005-07-10  1:53             ` Randy Brukardt
2005-07-10 19:32               ` Jeffrey Carter
2005-07-07  3:24         ` Randy Brukardt
2005-07-16 23:24 ` Matthew Heaney
2005-07-17  4:04   ` Dmitriy Anisimkov
2005-07-17  5:01     ` Matthew Heaney
2005-07-17 17:13       ` Dmitriy Anisimkov
2005-07-17 17:36         ` Matthew Heaney
2005-07-17 17:49           ` Dmitriy Anisimkov
2005-07-17 18:12             ` Matthew Heaney
2005-07-17 17:40       ` Dmitriy Anisimkov
2005-07-17 17:50         ` Dmitriy Anisimkov
2005-07-17 18:08         ` Matthew Heaney
2005-07-19  4:36           ` Mikhail Terekhov
2005-07-20  1:59             ` Matthew Heaney
2005-07-20 14:00               ` Pascal Obry
2005-07-20 14:34                 ` Matthew Heaney
2005-07-20 16:51                   ` Pascal Obry
2005-07-20 16:53                   ` Pascal Obry
2005-07-21  3:18                   ` Randy Brukardt
2005-07-20  2:37             ` Robert I. Eachus
2005-08-02 16:59               ` Craig Carey
2005-08-02 20:55                 ` Simon Wright
2005-07-20  7:20             ` Georg Bauhaus
2005-07-17  9:28     ` Georg Bauhaus
2005-07-17 14:26       ` Matthew Heaney
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox