comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: Overloading parentheses and type expectations
Date: Fri, 02 Sep 2011 18:08:49 +0200
Date: 2011-09-02T18:08:50+02:00	[thread overview]
Message-ID: <4e60ff91$0$6550$9b4e6d93@newsspool4.arcor-online.net> (raw)
In-Reply-To: <1imztu5j0f0pv$.1oy8qpcm0cpvv$.dlg@40tude.net>

On 02.09.11 14:40, Dmitry A. Kazakov wrote:

> empirical, adj
> ...
> 2. based on practical experience rather than scientific proof
> 3. (of a proposition) subject, at least theoretically, to verification 
> 4. (Medicine) of or relating to medical quackery

The non-scientific meanings are not applicable to how this study
of understanding programming languages was conducted.



> Integral is not an addition.

Other operations aren't addition either, yet some are considered
more worthy of inclusion as infix symbols than others. I just think
that language design should reflect computers' + more than + from
school. How?

Specialists in using + let us know that most programmers have no idea
of what they are doing, for example, when adding floats. (I don't
say I have.  Dewar, author of a number of chapters on FPT units
in microprocessors, has hinted that he will consult specialists,
so I don't feed all too bad.)  Still we all write x + y, and many
don't care what this actually means.

The point is: the language does not draw attention to +
as a source of errors induced by school think.  It does
not encourage learning about computer addition by making
the default syntax for + so conventional.


> Addition is used by (Lebesque) integration,
> but defined on a set measure. It has the standard notation +, e.g.
> 
>    µ(A U B) = µ(A) + µ(B)   if A and B are disjoint, etc

µ is equally abhorred, as is ∪.  Maybe ∪ should not be used
in languages other than SETL because ∪ implies properties
of data structures that typical implementations of a Set will
not have?

>> Is there anything about + that makes its meaning more special
>> than that of ∫?
> 
> Yes. Integral is a value according to some measure. + is an operation of a
> group. (I hope you won't argue that * is addition because it could be
> defined in terms of +)

This is a mathematical perspective on mathematical properties only,
not simply on program text.  In a computer program, you write

  + (1, 2)
  ∫ (f'access, a, b)

How is ∫ special?  I'm *not* suggesting ∫ should be specially present in a
general purpose programming language. But, by the same token, I think
that + should trigger the same restraint as do ∫ or ∪.

At the very least, an operator such as + should not be predefined to
the maximum extent possible. The operator should convey that it
will not perform high school addition but computer addition. We
would be getting better programs, because programmers are better
informed.


> Sorry, people can be unaware of anything.

We typically assume that we are aware of the meaning of expressions.
But we frequently aren't, and more so when the language obfuscates actual
differences by painting them all in the same mathematical color (syntax),
such as in the pointer(), array(), and function() examples.
Makes them all look the same, even though they behave differently.
There wouldn't be different mechanism in a language otherwise,
would there?

> Nope. Mathematically there is no difference between an array and a valued
> pure subprogram. Both are run-time implementations of a mapping. Why there
> should be different notation for them?

The study by McIver & Conway explains a number of reasons,
all having to do with programmers.

> 1. Overflow is not an error it is a valid, mandated behavior.

I still don't want most programs to overflow. Mistakes are
not mandated behavior, unless you share Microsoft's office
sales strategy.


> Wrong. There are two meanings of brackets above:
> 
> 1. "()" : N -> N   , e.g. (1)=1
> 
> 2. "()" : <exceptional-state> -> <exceptional-state> , e.g.
> Constraint_Error is propagated out of brackets.

Which, I guess, can be reduced to

"()" : N_|_ -> N_|_

> I care little of Smalltalk (sorry, for unintended pun).

To me, it matters what programmers think about +, and about
how + works, and about what happens to the operands. Thus,
what they think about what happens in x + y - z, and how
a language's syntax helps with understanding what actually
happens.


> That does not change the semantics of +.

The symbol + has no semantics of its own, like you explain later.


>> The human brain needs to learn, and then to rummage through a mountain
>> of, information about the expression and its meaning in order to see,
>> for example, from where this strange and irregularly occurring difference
>> in executing x + y should stem, for seemingly the same x and y, by the
>> looks of it.  (Timing dependent shared variable update through y, say.)
> 
> And a consistent use of Whatever.Package.Name.Add instead of + is supposed
> to ease the process of learning?

Not + alone, but a suitably defined language allowing programmers
to express their expectations, and be given clear and simple indications
of its effects.  If a language mandates the use of grouping, (x + y)
not x + y, then this rule draws attention to the effects of association
in a computer.

A simple example, also related to "the semantics of symbols":

  a = a + 1

The hypothetical student sees this statement when she is
first exposed to programming in her life (BASIC).  She then reads
all the gibberish about storage locations, accumulators
and whatnots, but stills has no idea just how a number can be equal
to its successor!  `=' is very unmathematical in most programming
languages, yet programmers fervently defend its choice.  The + case
is lighter I think, but otherwise not much different.

What can aid understanding?

The Semitic languages, when written and read by specialists,
leave out the vowels.  Similarly, trained readers can understand
a text written in shorthand. Likewise, cryptographers will have
little difficulty assigning meaning to hexadecimal gobbledegook.

If the three groups of specialists write diacritics for vowels,
write in "normal hand", or don't encrypt their messages,
respectively, then this is a first step towards understanding.

Revert the removal of subjectively felt redundancy.



  reply	other threads:[~2011-09-02 16:08 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 15:46 Address and bit mask milouz
2011-08-29 16:06 ` Martin
2011-08-29 16:33   ` milouz
2011-08-29 17:47     ` Dmitry A. Kazakov
2011-08-29 17:54     ` Martin
2011-08-29 18:46     ` tmoran
2011-08-29 19:41 ` Ludovic Brenta
2011-08-29 19:54   ` Adam Beneschan
2011-08-30  9:14     ` milouz
2011-08-30 10:34       ` Ludovic Brenta
2011-08-30 10:58         ` Ludovic Brenta
2011-08-30 12:44           ` Georg Bauhaus
2011-08-30 14:04             ` Dmitry A. Kazakov
2011-08-30 16:12               ` Georg Bauhaus
2011-08-30 16:59                 ` Dmitry A. Kazakov
2011-08-30 14:52         ` Adam Beneschan
2011-08-30 10:40       ` Simon Wright
2011-08-30 10:44         ` Simon Wright
2011-08-30 15:20         ` tmoran
2011-08-30 16:08           ` milouz
2011-08-30 16:45             ` Georg Bauhaus
2011-08-30 19:31               ` Adam Beneschan
2011-08-30 19:56                 ` Dmitry A. Kazakov
2011-08-31  6:16                   ` The simple Image issue (was: Address and bit mask) Georg Bauhaus
2011-08-31 14:44                     ` The simple Image issue Dmitry A. Kazakov
2011-08-31 15:36                       ` Georg Bauhaus
2011-08-31 15:53                         ` Dmitry A. Kazakov
2011-08-31 16:23                           ` Georg Bauhaus
2011-08-31 16:27                             ` Dmitry A. Kazakov
2011-08-31 16:30                               ` Georg Bauhaus
2011-08-31 16:50                                 ` Dmitry A. Kazakov
2011-08-31 20:41                                   ` Georg Bauhaus
2011-08-31 21:17                                     ` Robert A Duff
2011-09-01  7:36                                       ` Dmitry A. Kazakov
2011-09-01  7:46                                     ` Dmitry A. Kazakov
2011-09-01  9:50                                       ` Overloading parentheses and type expectations (was: The simple Image issue) Georg Bauhaus
2011-09-02  7:54                                         ` Overloading parentheses and type expectations Dmitry A. Kazakov
2011-09-02 10:37                                           ` Georg Bauhaus
2011-09-02 12:40                                             ` Dmitry A. Kazakov
2011-09-02 16:08                                               ` Georg Bauhaus [this message]
2011-09-02 17:29                                                 ` Dmitry A. Kazakov
2011-08-31 15:53                     ` The simple Image issue Hyman Rosen
2011-08-31 16:07                       ` Dmitry A. Kazakov
2011-08-31 16:08                       ` Simon Wright
2011-08-31 16:26                         ` Dmitry A. Kazakov
2011-08-31 16:25                       ` Georg Bauhaus
2011-08-31 16:30                         ` Hyman Rosen
2011-08-31 16:34                           ` Georg Bauhaus
2011-08-31 16:43                             ` Adam Beneschan
2011-08-31 21:58                               ` Georg Bauhaus
2011-09-01  7:59                                 ` Dmitry A. Kazakov
2011-08-31 16:08                     ` The simple Image issue (was: Address and bit mask) Adam Beneschan
2011-08-31 16:53                       ` The simple Image issue Simon Wright
2011-08-31 17:02                         ` Hyman Rosen
2011-08-31 20:33                       ` Georg Bauhaus
2011-08-30 19:37             ` Address and bit mask Martin
2011-08-30 16:32           ` Simon Wright
2011-08-31  7:55             ` Ludovic Brenta
2011-08-30 12:35       ` Georg Bauhaus
2011-08-30 13:03       ` Georg Bauhaus
2011-08-30 15:14       ` Adam Beneschan
2011-08-30 15:59         ` Adam Beneschan
2011-08-31  7:45         ` milouz
2011-08-31  8:35           ` Ludovic Brenta
replies disabled

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