comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Self pointer in limited record
Date: Thu, 13 Sep 2007 16:37:51 -0500
Date: 2007-09-13T16:37:51-05:00	[thread overview]
Message-ID: <fccae2$rni$1@jacob-sparre.dk> (raw)
In-Reply-To: 16dbv6ehzvw3q.1ccv5mc0b5a2m.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
news:16dbv6ehzvw3q.1ccv5mc0b5a2m.dlg@40tude.net...
> On Wed, 12 Sep 2007 16:57:05 -0500, Randy Brukardt wrote:
>
> > "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message
> > news:uffdiv96c9bc.6mn4qaig7owe.dlg@40tude.net...
>
> >> What happens when somebody would create some of these objects on the
stack?
> >
> > Works fine -- that's the whole point of this design. When the objects
get
> > finalized, the Claw code for Finalize unlinks them from their parent's
list
> > of children (after destroying any children that they might have). No
fuss,
> > no muss, quite cheap to do, and no dangling pointers.
>
> But then storage management should be made elsewhere, I mean, if children
> are only finalized but not deallocated.

True. But it is best to let the user decide how to do storage management (it
should be a separate choice from the ADT). If stack management will work for
their application (as is does for most Claw programs), then why make them
(or the runtime, for that matter) mess with something more complicated? And
if they do need dynamic allocation, they're much more likely to have
knowledge of how it should be accomplished than any generic ADT designer.
(And, of course, the ADT can easily be combined with any one of the
containers packages; we shouldn't be deciding that they need a list when
they might really need a map.)

> >> You argue for automatic collection, that is my point too. But I would
go
> >> further and hide target objects behind handles to. That would eliminate
> >> "access." The language problem is though that there is no simple way to
> >> delegate operations from handle to the target object. It requires a lot
of
> >> work.
> >
> > Not worth it, because you either lose extension or gain a second level
of
> > tagged types for no real benefit.
>
> One benefit is GC (thought reference counting, for example), another is an
> ability to share object implementations (aliasing). Both add their
problems
> too, of course. (:-))

True enough. As noted above, I generally prefer to separate memory
management/data structures from the ADT itself. Of course, the ADT has to do
its own internal memory management as needed.

> BTW, are you going to port Claw to X11 anytime? (In the recent time I
> worked much with GTK+, what a mess!)

We've thought about it some, but haven't had the customer that really wanted
it. OTOH, I'm seriously looking at moving a lot of my work to Linux (have
gotten disgusted with Microsoft DRM in the OS), so that could force some
level of porting. (We've done a few pieces, like the sockets library, but
that isn't really what needs to be done.)

                           Randy.





      reply	other threads:[~2007-09-13 21:37 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-04 19:31 Self pointer in limited record Maciej Sobczak
2007-07-05  8:22 ` Dmitry A. Kazakov
2007-07-05 10:35   ` Maciej Sobczak
2007-07-05 11:01     ` Pascal Obry
2007-07-05 11:14     ` Georg Bauhaus
2007-07-05 12:36     ` Dmitry A. Kazakov
2007-08-31 16:47 ` amado.alves
2007-08-31 17:09   ` Pascal Obry
2007-08-31 17:37   ` Adam Beneschan
2007-08-31 18:26   ` Jeffrey R. Carter
2007-08-31 19:33   ` Dmitry A. Kazakov
2007-09-01 13:33     ` Georg Bauhaus
2007-09-01 13:46       ` Dmitry A. Kazakov
2007-09-01 14:15         ` Georg Bauhaus
2007-09-01 16:03           ` Dmitry A. Kazakov
2007-09-01 19:49             ` Georg Bauhaus
2007-09-01 20:09               ` Dmitry A. Kazakov
2007-09-02 21:37                 ` Georg Bauhaus
     [not found]                   ` <re7ei5lc7dzf$.11qtcnh35jmzg$.dlg@40tude.net>
2007-09-03 10:51                     ` Georg Bauhaus
2007-09-03 14:17                       ` Dmitry A. Kazakov
2007-09-03 15:55                         ` Jean-Pierre Rosen
2007-09-03 19:17                           ` Dmitry A. Kazakov
2007-09-03 19:32                             ` Markus E L
2007-09-03 20:14                             ` Georg Bauhaus
2007-09-04  8:24                               ` Dmitry A. Kazakov
2007-09-04  9:36                                 ` Jean-Pierre Rosen
2007-09-04 10:14                                   ` Dmitry A. Kazakov
2007-09-05 10:49                                 ` Georg Bauhaus
2007-09-05 12:04                                   ` Dmitry A. Kazakov
2007-09-05 13:12                                     ` Jean-Pierre Rosen
2007-09-05 15:10                                       ` Dmitry A. Kazakov
2007-09-05 16:25                                         ` Jean-Pierre Rosen
2007-09-05 19:52                                           ` Dmitry A. Kazakov
2007-09-06  7:19                                             ` Jean-Pierre Rosen
2007-09-06  9:28                                               ` Dmitry A. Kazakov
2007-09-06 11:53                                                 ` Jean-Pierre Rosen
2007-09-06 15:35                                                   ` Dmitry A. Kazakov
2007-09-05 18:31                                     ` Georg Bauhaus
2007-09-05 19:52                                       ` Dmitry A. Kazakov
2007-09-05 21:38                                         ` Georg Bauhaus
2007-09-06  7:37                                           ` Dmitry A. Kazakov
2007-09-06 10:26                                             ` Georg Bauhaus
2007-09-06 12:25                                               ` Dmitry A. Kazakov
2007-09-08  1:27                                               ` Randy Brukardt
2007-09-06  9:14                                         ` Markus E L
2007-09-06  9:48                                           ` Dmitry A. Kazakov
2007-09-04  8:23                             ` Jean-Pierre Rosen
2007-10-31 23:59                           ` adaworks
2007-09-03 20:38                         ` Georg Bauhaus
2007-09-04  8:24                           ` Dmitry A. Kazakov
2007-09-03  7:54             ` Jean-Pierre Rosen
2007-09-01 15:33         ` Markus E L
2007-09-04 14:55           ` Adam Beneschan
2007-09-04 15:09             ` Jean-Pierre Rosen
2007-09-08  1:36               ` Randy Brukardt
2007-09-04 17:31             ` Georg Bauhaus
2007-09-08  1:16     ` Randy Brukardt
2007-09-10 16:27       ` amado.alves
2007-09-10 17:13         ` Adam Beneschan
2007-09-10 19:00         ` Dmitry A. Kazakov
2007-09-11  3:12           ` Randy Brukardt
2007-09-11  9:38             ` Dmitry A. Kazakov
2007-09-12 21:57               ` Randy Brukardt
2007-09-13  8:03                 ` Dmitry A. Kazakov
2007-09-13 21:37                   ` Randy Brukardt [this message]
replies disabled

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