comp.lang.ada
 help / color / mirror / Atom feed
From: 18k11tm001@sneakemail.com (Russ)
Subject: Re: status of Ada STL?
Date: 18 Jun 2002 20:37:29 -0700
Date: 2002-06-19T03:37:30+00:00	[thread overview]
Message-ID: <bebbba07.0206181937.2b17f4f2@posting.google.com> (raw)
In-Reply-To: wcc8z5czi89.fsf@shell01.TheWorld.com

Robert A Duff <bobduff@shell01.TheWorld.com> wrote in message news:<wcc8z5czi89.fsf@shell01.TheWorld.com>...
> 18k11tm001@sneakemail.com (Russ) writes:
> 
> > I really don't understand the objection to my proposal. 
> 
> OK, I'll try to explain *my* objections.  (And I will refrain from
> accusing you of being a C lover. ;-)  Your proposal clearly states that
> your ideas come from Fortran and Python.)  I even agree with some of
> what you said.

Thanks for your thoughtful reply. I have a few rebuttals below.

> I understand your point that you can write a preprocessor, so people can
> choose whichever notation they like.  I think that's a bad idea,
> because it hinders communication among Ada programmers.
> 
> Here's your proposal, with my comments:
> 
> > A Cleaner Syntax for Ada Programming
> > 
> > Ada 95 is a great programming language with an excellent fundamental
> > design. However, it has an awkward, "klunky" syntax. I propose to
> > simplify its syntax by borrowing features from Fortran 95 and Python. I
> > will tentatively call the resulting new dialect "Ada-F". Ada-F maintains
> > all the safety features of Ada and can be converted into standard Ada 95
> > with a simple pre-processor (to be developed). Existing Ada compilers
> > can still be used, therefore, and programmers who wish to continue using
> > the old syntax can do so. Here are the changes I propose:
> > 
> > 1. Eliminate semicolons, except for combining multiple statements on a
> >    single line, as in Python and Fortran 95, and use "\" (backslash) to
> >    continue a statement on the next line when necessary. Semicolons are
> >    unnecessary clutter, and they cause many nuisance compilation
> >    errors. 
> 
> Equating "statement" with "line", and then having a convention like "\"
> to mean "I didn't really mean end-of-line; I just ran out of room" seems
> kludgy to me.  The ";" seems much cleaner, and I don't find it a
> nuisance at all.
> 
> There are some languages that eliminate the need for ";" by carefully
> designing the syntax to avoid the need.  That seems reasonable,
> but the "\" convention is an abomination.

I'm open to suggestions. Actually, if an open "(" has yet to be
closed, you don't need any line-continuation symbol. That takes care
of most multi-line statements right there, perhaps.

Also, I do not see why "\" is so bad. Fortran uses "&", which is
preferable, but that symbol is already used in Ada. The backslash is
used in many scripting languages, so it seems appropriate to me.

> > 2. Use "=" rather than ":=" for assignment. The vast majority of
> >    languages use "=" for assignment, which is simpler and perfectly
> >    adequate. (Continue to use "=" for equality testing if confusion with
> >    assignment can be avoided, otherwise use "==", but never allow
> >    assignment within an "if" test.) 
> 
> As I said in a different posting, maths tradition ought to trump the
> faddish concerns of an industry that's only a few decades old.  ;-)

Consider the major languages in widespread use today, such as C, C++,
Java, Perl, Python, and Fortran. They all use "=" for assignment. It's
virtually a standard, and it makes it easier for programmers to become
fluent in several languages. But Ada is the oddball. A programmer who
wants to be multi-lingual will therefore constantly have annoying
compilation errors when using Ada. The life of a programmer is filled
with enough annoyances already without stupid ones like that.

> > 3. Use "=" instead of "=>" for passing arguments by named association,
> >    as in Python and Fortran 95. Again, it is simpler and perfectly
> >    adequate. 
> 
> I don't much like "=>" either, but this is another example of using "="
> to mean something other than equality -- see my previous point.

The other thing that bothers me about "=>" used this way is that it is
backwards. It should really be "<=", but of course that's already
taken. If you Ada folks were consistent, you would use "=>" for
assignment too:

x => 3;

How does that grab you?

> An early version of Ada used ":=", ":=:", and "=:" to indicate 'in',
> 'in out', and 'out' actual parameters.  This I like, because I think
> it's useful to indicate this information at the call site.
> 
> > 4. Use ":" instead of ".." to denote a range of numbers, as in Fortran,
> >    Python, and Matlab. 
> 
> Shrug.  I see no advantage or disadvantage to ":" vs. "..".
> So why change?

It's not a big deal, but ":" is more consistent with other languages,
such as Python, Fortran, and Matlab. Also, it does use one less
character, and it looks better without spaces, for example: (1:3) vs
(1..3). In the latter case, the first dot looks like a decimal point.

> > 5. Add assignment operators such as "+=", "-=", "*=", and "/=". These
> >    operators produce cleaner code. They could also facilitate much more
> >    efficient vector/matrix operations if integrated into the core
> >    language. 
> 
> I agree with you that there should be a notation for these, but given
> that I reject number 2, I don't like *these* notations.  And of course,
> "/=" already means something else in Ada.  I believe Algol 68 uses
> "+:=", which seems OK, but I would actually prefer "Increment" or
> "Incr".  The goal is not to make the notation short, but to avoid having
> "X" appear twice in things like "X := X + 1;".  X could be a long
> expression, and having it appear twice means the reader has to carefully
> notice whether it's really the same, and also whether there are side
> effects that might occur twice.  I think this:
> 
>     Incr(X, By => 2);
>     Incr(X); -- By defaults to 1.
> 
> is more readable than:
> 
>     X := X + 1;
> 
> if X is a medium-to-long expression.
> 
> So on this point, I partly agree with you.
> 
> Your point about efficiency is partly right: If you call a procedure
> that updates one of its parameters, that can be more efficient (eg in
> the matrix case, as you say).  But this is true whether or not the
> notation is built in -- it could just as well be a user-defined
> 
>     Matrix_Add(X, Y);

Yes, but the name of your Matrix_Add function above does not make it
clear what is happening. Does it return the sum or add them in place?
The advantage of "+=" is that it is clear what is happening (assuming
it is implemented properly, of course). That was the original idea
behind operator overloading in the first place, wasn't it?

> > 6. Allow a more natural declaration/initialization syntax, as
> >    illustrated by the following example: 
> > 
> >    count: integer := 0; -- old syntax
> > 
> >    count = 0: integer -- new syntax
> > 
> >    The assignment is to the variable, not the type, and the new syntax
> >    shows that. The same applies to default subprogram arguments. 
> 
> Shrug.  Maybe I'm just used to it, but it seems perfectly reasonable to
> me to have the name of the thing, followed by its type, followed by its
> initial value (more important info ... least important info).

Sorry, but I don't see how it makes sense to assign the value to the
type. Also, my syntax is consistent with an assignment statement, and
that's aesthetically pleasing to me.

> > 7. Let "use" imply "with" so files need not be cluttered with both
> >    "with" and "use" for the same package. Note that this would not
> >    preclude the explicit use of "with" if that is deemed preferable. 
> 
> I agree with this point.  Saying "with X; use X;" is useless clutter
> when you could just say "use X;".  (With child packages, X is often
> quite long, so saying it twice hinders readability.)

Some people seem to think I want to eliminate "with" altogether. Not
so. But all those duplicated "with" and "use" statements are enough to
drive a beginner away from Ada, particularly when they are for nothing
but basic I/O formatting.

> > With these relatively minor changes, I believe Ada could gain the
> > popularity it deserves.
> 
> This is the point I most strongly disagree with.  All of the above
> issues are trivial, and even if I agreed with all of them, I don't think
> they would have the slightest effect on people's language choices.

And here I though I was making progress! You Ada guys never cease to
baffle me. On the one hand, my proposed changes are "trivial," and on
the other hand, implementing them will be like "moving a mountain."

> >... Yet existing compilers would still work, and
> > programmers who prefer the old syntax could continue to use
> > it.
> 
> This makes it even worse.  It's bad enough that people won't follow the
> RM-recommended indentation and capitalization styles.  Now you're saying
> they don't have to agree on the spelling of assignment and whatnot!

If you really want them to follow indentation conventions, you could
always force the issue, as Python does. But even I wouldn't go that
far.

You Ada guys are so worried about having two slightly different
dialects of Ada, but a much bigger problem for Ada is that it uses
basic syntax that is inconsistent with all the other major languages
in widespread use today, as I explained above. Unless you guys wake up
to that fact, I'm afraid Ada is on the way out -- and that's a shame.



  parent reply	other threads:[~2002-06-19  3:37 UTC|newest]

Thread overview: 188+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-14  7:21 status of Ada STL? Russ
2002-06-14 16:29 ` Stephen Leake
2002-06-14 18:44 ` Ted Dennison
2002-06-14 20:34 ` Ehud Lamm
2002-06-15 18:52   ` Russ
2002-06-16  2:42     ` David Marceau
2002-06-16  8:07     ` Pascal Obry
2002-06-16 18:23       ` Russ
2002-06-16 19:01         ` Pascal Obry
2002-06-16 19:04         ` Vinzent Hoefler
2002-06-17  1:59           ` Jeffrey Carter
2002-06-17  6:48             ` Russ
2002-06-17  7:04               ` Dale Stanbrough
2002-06-18  6:16                 ` Russ
2002-06-19  1:07                   ` Dale Stanbrough
2002-06-17  9:38               ` chris.danx
2002-06-17 15:53               ` Ted Dennison
2002-06-18  7:52                 ` Russ
2002-06-18 10:57                   ` chris.danx
2002-06-18 14:38                   ` Robert A Duff
2002-06-18 16:19                     ` Brian Rogoff
2002-06-18 17:12                       ` Frank J. Lhota
2002-06-18 18:03                         ` Brian Rogoff
2002-06-18 19:24                           ` Frank J. Lhota
2002-06-18 19:41                             ` Brian Rogoff
2002-06-25  0:02                         ` Steven Deller
2002-06-25  1:24                           ` Yet another assignment variation (was Re: status of Ada STL?) Dale Stanbrough
2002-06-25 12:53                             ` Frank J. Lhota
2002-06-25 17:48                             ` Georg Bauhaus
2002-06-26  3:13                             ` Robert A Duff
2002-06-18 19:03                     ` status of Ada STL? Robert A Duff
2002-06-18 19:54                       ` Brian Rogoff
2002-06-18 21:09                         ` Robert A Duff
2002-06-18 23:36                           ` Brian Rogoff
2002-06-19  1:37                             ` Robert A Duff
2002-06-19 16:25                               ` Brian Rogoff
2002-06-19 18:53                                 ` Robert A Duff
2002-06-19 20:23                                   ` Brian Rogoff
2002-06-19  3:57                           ` Russ
2002-06-18 21:55                   ` Dmitry A.Kazakov
2002-06-19  5:32                     ` Russ
2002-06-19 12:37                       ` Dmitry A. Kazakov
2002-06-20  6:50                         ` Russ
2002-06-20 12:21                           ` Ted Dennison
2002-06-20 21:42                           ` Dmitry A.Kazakov
2002-06-20 18:20                             ` Russ
2002-06-21 10:27                               ` Dmitry A. Kazakov
2002-06-20 18:21                             ` Russ
2002-06-20 19:09                             ` Russ
2002-06-17 17:16               ` Pascal Obry
2002-06-18  5:27                 ` Russ
2002-06-17 17:17               ` Pascal Obry
2002-06-17 21:40             ` Vinzent Hoefler
2002-06-17  5:20           ` Russ
2002-06-17  8:22             ` chris.danx
2002-06-17 14:00               ` Frank J. Lhota
2002-06-17 15:57               ` Marin David Condic
2002-06-18  6:12               ` Russ
2002-06-18  8:16                 ` chris.danx
2002-06-18 14:52                   ` Robert A Duff
2002-06-18 16:02                     ` Pascal Obry
2002-06-18 16:54                       ` Hyman Rosen
2002-06-18 22:58                         ` Jacob Sparre Andersen
2002-06-18 19:09                     ` Robert A Duff
     [not found]                     ` <ud6uolglz.fsf@w <wccsn3kxv3g.fsf@shell01.TheWorld.com>
2002-06-19  8:09                       ` Pascal Obry
2002-06-19  3:04                   ` Russ
2002-06-19 16:40                     ` Hyman Rosen
2002-06-19 18:07                       ` Brian Rogoff
2002-06-18  9:37                 ` Fraser Wilson
2002-06-18 15:45                   ` Hyman Rosen
2002-06-19 16:55                   ` Robert I. Eachus
2002-06-19 19:13                     ` Robert A Duff
2002-06-20  7:43                       ` Dmitry A.Kazakov
2002-06-22 22:05                       ` Robert I. Eachus
2002-06-17 21:40             ` Vinzent Hoefler
2002-06-18 15:05               ` Robert A Duff
2002-06-18 22:36                 ` Vinzent Hoefler
2002-06-19 12:45                   ` Dmitry A. Kazakov
2002-06-19 14:35                     ` Marin David Condic
2002-06-21 11:03                       ` Dmitry A. Kazakov
2002-06-21 16:58                         ` Mark Biggar
2002-06-22 23:23                           ` Dmitry A.Kazakov
2002-06-27  3:00                       ` David Thompson
2002-06-28 13:36                         ` Marin David Condic
2002-06-30  4:05                           ` Russ
2002-06-30 13:50                             ` Ted Dennison
2002-07-01 13:12                             ` Marin David Condic
2002-07-02 19:56                           ` Robert A Duff
     [not found]                           ` <bebbba07.0206292005.45ad915a@p <wcc4rfhj43l.fsf@shell01.TheWorld.com>
2002-07-02 20:40                             ` Pat Rogers
2002-06-18 15:21             ` Robert A Duff
2002-06-19  0:34               ` tmoran
2002-06-19  2:55               ` Russ
2002-06-19  4:53                 ` Ted Dennison
2002-06-19  8:21                 ` Pascal Obry
2002-06-19 14:52                 ` Stephen Leake
2002-06-20  1:45                 ` SteveD
2002-06-20  2:01                   ` Ted Dennison
2002-06-16 20:01         ` Pascal Obry
2002-06-17  5:29           ` Russ
2002-06-16 23:02         ` Ted Dennison
2002-06-17  5:07           ` Russ
2002-06-17 14:03             ` Frank J. Lhota
2002-06-17 14:11             ` Ted Dennison
2002-06-18  5:55               ` Russ
2002-06-18 14:30                 ` Ted Dennison
2002-06-18 15:14                   ` Marin David Condic
2002-06-19 14:19                     ` Ted Dennison
2002-06-19 16:05                       ` Marin David Condic
2002-06-19  5:58                   ` Russ
2002-06-19 14:35                     ` Ted Dennison
2002-06-20  7:06                       ` Russ
2002-06-20 12:27                         ` Ted Dennison
2002-06-20 23:22                           ` Russ
2002-06-21  2:00                             ` Ted Dennison
2002-06-22  4:28                               ` Russ
2002-06-22 15:05                                 ` Ted Dennison
2002-06-21  8:48                             ` Ian Wild
2002-06-22  4:54                             ` Russ
2002-06-20 22:47                   ` Russ
2002-06-21  0:43                     ` Ted Dennison
2002-06-22  4:05                       ` Russ
2002-06-22 14:41                         ` Jano
2002-06-22 20:27                         ` Ted Dennison
2002-06-21 13:12                     ` Marin David Condic
2002-06-24  8:29                       ` Russ
2002-06-24 20:19                         ` Chad R. Meiners
2002-06-18 22:36                 ` Vinzent Hoefler
2002-06-18 22:42                   ` Ed Falis
2002-06-19  0:07                     ` Vinzent Hoefler
2002-06-19  0:07                   ` Vinzent Hoefler
2002-06-17 22:37             ` Dmitry A.Kazakov
2002-06-17 14:09               ` Frank J. Lhota
2002-06-18 21:40                 ` Dmitry A.Kazakov
2002-06-18 16:04         ` Robert A Duff
2002-06-18 16:37           ` Pascal Obry
2002-06-18 18:56             ` Robert A Duff
2002-06-18 22:20               ` Pascal Obry
2002-06-19 12:53               ` Dmitry A. Kazakov
2002-06-19  3:37           ` Russ [this message]
2002-06-19  8:31             ` Pascal Obry
2002-06-20  7:58               ` Russ
2002-06-20 20:34                 ` Pascal Obry
2002-06-21  4:07                   ` Russ
2002-06-17 15:33     ` Marin David Condic
2002-06-18 10:28       ` Adrian Hoe
2002-06-19  7:58         ` Ole-Hjalmar Kristensen
2002-06-19 13:55           ` Marin David Condic
2002-06-19 13:52         ` Marin David Condic
2002-09-18 15:23           ` Matthew Heaney
2002-09-19 12:11             ` Marin David Condic
2002-09-19 14:13               ` Hyman Rosen
2002-09-20 12:24                 ` Marin David Condic
2002-09-22  7:22                   ` Kevin Cline
2002-09-23 13:55                     ` Hyman Rosen
2002-09-19 19:42               ` Randy Brukardt
2002-09-20 12:38                 ` Marin David Condic
2002-09-27 21:21                   ` Michael Bode
2002-09-27 22:11                     ` Pat Rogers
2002-09-28 13:25                       ` Marin David Condic
2002-09-28 14:52                         ` Pat Rogers
2002-09-28 15:18                           ` Martin Dowie
2002-09-29 18:02                           ` Marin David Condic
2002-09-29 19:02                             ` Jeffrey Carter
2002-09-30  1:36                               ` Marin David Condic
2002-10-02 22:17                     ` Matthew Heaney
2002-09-28 17:25                 ` Richard Riehle
2002-09-30 17:12                   ` Marin David Condic
2002-10-01 18:41                     ` Randy Brukardt
2002-10-02  8:38                       ` Jean-Pierre Rosen
2002-10-02 12:43                         ` Marin David Condic
2002-10-02 14:26                           ` Jean-Pierre Rosen
2002-10-02 12:30                       ` Marin David Condic
2002-06-18  1:56     ` SteveD
2002-06-18 14:12       ` Robert A Duff
2002-06-18 14:28         ` chris.danx
2002-06-18 15:59           ` Pascal Obry
2002-06-18 18:58           ` Robert A Duff
2002-06-18 19:58           ` Randy Brukardt
2002-06-19 14:07             ` Marin David Condic
2002-06-19  2:19         ` SteveD
2002-06-18 11:40     ` Colin Paul Gloster
2002-06-20 15:15       ` Colin Paul Gloster
2002-06-18 19:34     ` Mike Silva
2002-06-25 16:31     ` Kevin Cline
2002-06-14 20:34 ` Dan Andreatta
  -- strict thread matches above, loose matches on Subject: below --
2002-06-17 11:05 Grein, Christoph
2002-06-18  5:36 ` Russ
2002-06-26 10:50 Grein, Christoph
replies disabled

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