comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <bauhaus@futureapps.de>
Subject: Re: Rational for not making cursor tagged in Containers
Date: Fri, 20 Apr 2007 16:42:27 +0200
Date: 2007-04-20T15:40:48+02:00	[thread overview]
Message-ID: <1177080147.5876.87.camel@localhost.localdomain> (raw)
In-Reply-To: <pioojxhb01th.lq5kuqqdsatm.dlg@40tude.net>

On Fri, 2007-04-20 at 12:39 +0200, Dmitry A. Kazakov wrote:
> On Fri, 20 Apr 2007 12:56:23 +0200, Georg Bauhaus wrote:

> >    type Foo is interface record ...
> >  ... There is no
> > way of knowing whether reading or writing a record component will
> > just move some bits, or try to compute the first prime number of
> > the 1969 lottery on the way.
> 
> And you claim to know it. Always? With all possible pragmas applied,
> including Pack, as well as representation clauses like for X'Address use
> ...?

The practical difference between a simple record and a programmer-
defined record interface implementation is a set of fixed rules in
the first case and full (sub)programs in the second case.

>  As for me, I don't know it in 90% cases, and in 99% of these, I just
> don't care.

Right, I assume you don't care to known what an assignment to
a record component does because you either rely on the
thing being a "sufficiently normal" data component or you can
trust the authors of the program and assume they haven't
introduced an overly ambitious algorithm for Adjust that
would let your application hang for a while.

> BTW, Ada has private types from the day one.

If the type in question is private, there is nothing
to argue about. But your record type construction interface
wasn't private; and it didn't announce that Mumble isn't
just a record component. To emphasize: I don't want to loose
comparatively simple building blocks (records) just because
some smart programmers can build similar things (implementing
record interfaces) with more effects. I'm not forced to provide
get {} and set {} in C#, and neither assigners in Eiffel.


> > And, considering Controlled, forcing *all* types to be derived
> > from this base suffers from the same effects for the same reason.
> 
> Because multiple-inheritance is *the* answer. You need not to force anybody
> to anything if an interface (and an implementation of) can be added later.

This is where it becomes dangerous, I think. Suggesting that programmers
can implement "linguistic interfaces" forces programmers to be language
designers, profiting from decades of language research, compilation
technology, etc. etc..


> But more things you have hard-wired
> in the language, more complex it becomes for everybody, you, me, the
> compiler vendor and the Pentium.

If the hard-wired features of a language don't suit your problem, or
your solution, it might become a complex issue to work around
the language. Using a language construction language (sic) that suits
your problem solution will be a more pleasant experience. But for whom?
A reader will have to acquire complex language construction language
rules; just as look-at-my-neat-domain-language-macros
are both clever and not recommended in the general case (by Graham).



> > Not every programming team consists of real or even wannabe
> > language designers. But who else has even got a chance of knowing
> > what they are doing to a larger program when implementing the
> > concept of record?
> 
> Why they are allowed to implement a concept of task,

Uh, what do you mean? Ordering entry calls? Specifying rules
of conditional acceptance? In the more common case, I find
that much better than using a language that "gives you the
freedom to roll your own" tasking.

>  Where do you draw the line?

For a general purpose language, I draw the line where the
programmers would otherwise be forced to fiddle with
the tiny bits usually done by compilers. The operations
of private types are not tiny bits, but forcing plain record
component assignments to be full subprograms should not be
the default in Ada.





  reply	other threads:[~2007-04-20 14:42 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-19 16:05 Rational for not making cursor tagged in Containers Anh Vo
2007-04-19 18:25 ` Robert A Duff
2007-04-19 19:28   ` Anh Vo
2007-04-19 20:45     ` Robert A Duff
2007-04-19 21:43       ` Dmitry A. Kazakov
2007-04-19 23:59         ` Ray Blaak
2007-04-20  7:54           ` Dmitry A. Kazakov
2007-04-20 10:56             ` Georg Bauhaus
2007-04-20 10:39               ` Dmitry A. Kazakov
2007-04-20 14:42                 ` Georg Bauhaus [this message]
2007-04-20 14:45                   ` Georg Bauhaus
2007-04-20 15:13                   ` Dmitry A. Kazakov
2007-04-20 19:37                     ` Georg Bauhaus
2007-04-20 19:32                       ` Dmitry A. Kazakov
2007-04-20 20:59                         ` Robert A Duff
2007-04-20 22:14                           ` Dmitry A. Kazakov
2007-04-23 17:38                             ` Adam Beneschan
2007-04-23 19:18                               ` Dmitry A. Kazakov
2007-04-24  0:15                                 ` Adam Beneschan
2007-04-24 10:43                                   ` Dmitry A. Kazakov
2007-04-24 16:27                                     ` Adam Beneschan
2007-04-24 20:19                                       ` Dmitry A. Kazakov
2007-04-26  0:58                                         ` Adam Beneschan
2007-04-26  7:50                                           ` Dmitry A. Kazakov
2007-04-26  8:09                                             ` Markus E Leypold
2007-04-27  8:46                                               ` Dmitry A. Kazakov
2007-04-27 11:37                                                 ` Markus E Leypold
2007-04-28 17:35                                                   ` Dmitry A. Kazakov
2007-04-29  2:31                                                     ` Randy Brukardt
2007-04-29  8:45                                                       ` Dmitry A. Kazakov
2007-04-27 20:44                                               ` Robert A Duff
2007-04-26  8:33                                             ` Markus E Leypold
2007-04-26 11:09                                               ` Markus E Leypold
2007-04-20 19:55                       ` Randy Brukardt
2007-04-22  9:54                         ` Georg Bauhaus
2007-04-22 11:19                           ` Dmitry A. Kazakov
2007-04-20 20:44                       ` Robert A Duff
2007-04-21  5:38                         ` Randy Brukardt
2007-04-22  1:14                           ` Robert A Duff
2007-04-22  4:08                             ` Randy Brukardt
2007-04-20 20:11                     ` Randy Brukardt
2007-04-20 21:28                       ` Dmitry A. Kazakov
2007-04-21  5:33                         ` Randy Brukardt
2007-04-21  9:39                           ` Dmitry A. Kazakov
2007-04-22  4:28                             ` Randy Brukardt
2007-04-22  8:38                               ` Dmitry A. Kazakov
2007-04-23 23:26                                 ` Randy Brukardt
2007-04-24 10:43                                   ` Dmitry A. Kazakov
2007-04-24  8:58                                 ` Georg Bauhaus
2007-04-24 12:21                                   ` Dmitry A. Kazakov
2007-04-21  4:48                       ` unifying arrays and records (was Re: Rational for not making cursor tagged in Containers) Ray Blaak
2007-04-20 17:05             ` Rational for not making cursor tagged in Containers Ray Blaak
2007-04-20 18:46               ` Dmitry A. Kazakov
2007-04-20 18:52                 ` Ray Blaak
2007-04-20 19:54                   ` Robert A Duff
2007-04-20  1:18         ` Anh Vo
2007-04-20  7:53           ` Dmitry A. Kazakov
2007-04-20  9:26             ` Maciej Sobczak
2007-04-20 10:15               ` Dmitry A. Kazakov
2007-04-20 11:59           ` Jean-Pierre Rosen
2007-04-20 13:23             ` Anh Vo
2007-04-20 16:02               ` Jean-Pierre Rosen
2007-04-21  2:53                 ` Anh Vo
2007-04-20  3:03   ` Randy Brukardt
2007-04-20  2:53 ` Randy Brukardt
2007-04-20 16:08   ` Anh Vo
replies disabled

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