comp.lang.ada
 help / color / mirror / Atom feed
* An observation of Ada (may offend)
@ 1995-03-17  9:27 R.A.L Williams
  1995-03-17 15:23 ` Robb Nebbe
                   ` (4 more replies)
  0 siblings, 5 replies; 66+ messages in thread
From: R.A.L Williams @ 1995-03-17  9:27 UTC (permalink / raw)


In article <VLADIMIR.95Mar13204932> Vladimir Vukicevic wrote:

[well-deserved dismissal of student gripe deleted]

: Speaking of why people think Ada is not a good language... it'd be nice
: if someone collected the many myths about Ada, and collected them all
: together for distribution to the unbelievers. :-)  This would simplify
: telling people about Ada, especially if all they've heard was that it's
: a "big ugly ancient language used by the government", or that it's too
: 'huge' to be worth doing anything with.

Not 'myths' but 'gripes' - its a matter of perspective!

Some years ago I spent some time writing applications in Ada 83 (of
course, it was just 'Ada' then). I wrote both workstation and embedded
applications and I formulated a number of gripes about the language at
the time. I'm now (re-)learning Ada in its Ada95 form and I'm glad to
see that many of the gripes have been addressed.

Anyway, FWIW, here's a list (in no particular order). I'd be interested 
to see how many strike a chord with other people:

a. No unsigned integers (fixed in Ada95) HCTBAEL.

b. No bit level manipulation (fixed in Ada95 but only for unsigned
ie. mod INTEGERs, I can't test a sign bit, not that I need to) HCTBAEL.

c. Inflexible I/O - no unformatted binary files - this may
have been fixed in Ada95 but GNAT doesn't support STREAMs yet so
I haven't been able to play with it.

d. No pointers to functions - except for the 'ADDRESS attribute which,
being a chapter 13 item is at the whim of the compiler vendor (not very
portable). This is fixed in Ada95.

e. No short cut operators (+= etc.) -- sorry, we've had this debate
already in another thread, I've heard the objections, I still like the
operators.

f. Undefined 'baggage' in the run-time system. OK, this is unavoidable
with a language like Ada, it makes me nervous with Eiffel and C++ as
well, but, so far, I haven't tried to use those languages in embedded
systems (got a C++ one coming up soon). Its not so much needing a
run-time system, its not knowing what's in it. This is largely a compiler
vendor issue, not a language issue. HCTBAEL

g. Task overhead for serialized data access. Fixed in Ada95 with
protected types I believe, that's one of the next things to play with.

h. And a special one for Ada95: poor encapsulation of objects. I can
define a 'member function' for a class by including the class in the
parameter list. Unlike C++ or Eiffel, I can do this *anywhere* in my code,
even a nested function hidden somewhere seemingly 'irrelevant'. Whereas
other features of Ada go out of their way to force the programmer to
follow 'good practice' (sometimes a matter of opinion), this seems
very lax.

HCTBAEL = "How can this be an embedded language?" 

My experience with Ada, confirmed by many people that I spoke to at the
time was that, for embedded systems at least, Ada was used as cosmetic
window dressng to a vast quantity of assembler. This was made necessary
by the shortcomings of the language for addressing low level machine
interactions. To some extent, the same was also true of X11 software
on workstations. I see from responses in other threads that this may
have changed in recent years. All I can say is about time!

: 	-- Vladimir Vukicevicn
: 	-- vladimir@intrepid.com

Bill Williams
bill.williams@gec-mrc.co.uk




^ permalink raw reply	[flat|nested] 66+ messages in thread
* An observation of Ada (may offend)
@ 1995-03-30  0:00 R.A.L Williams
  1995-04-03  0:00 ` Norman H. Cohen
  0 siblings, 1 reply; 66+ messages in thread
From: R.A.L Williams @ 1995-03-30  0:00 UTC (permalink / raw)


In article <1995Mar28.120720.9512@eisner> Larry Kilgallen wrote:
  [deleted up to where I wrote...]
: > I agree that the representation clauses defined in the LRM are splendid,
: > the problem is that they are *optional*. I don't know what the situation
: > is now, but when I last did a lot of work in Ada many compilers had only
: > a fragmentary coverage. 

: Well, since the compiler _I_ use has them, who cares about the rest of
: you :-) :-) :-).

: Actually, if implementation of representation clauses was specified as
: optional (I cannot find that statement), the Ada83 author(s) presumably

LRM section 13.1 para 10:
"... An implementation may limit its acceptance of representation clauses
to those that can be handled simply by the underlying hardware. ..."

Now, in the old days, many compiler vendors treated this as a general cop-out.
I haven't bought an Ada compiler recently, so I don't know if this is still
the situation.

: felt they were hard to accomplishment and would require market pressure
: to cause implementation.  At least (unlike Pascal) the syntax for adding
: them is _standardized_, so once you have convinced your vendor, the
: implementation they provide will be compatible.

Yes, Pascal doesn't even have a *usable* standard. Every compiler I've come
across has vast numbers of incompatible extensions, little things like
separate compilation etc. (!)

ANSI C is standardized, but the standard is not explicit on the order
of bit fields within a structure.

The only ambiguity I know of in the Ada83 LRM is section 13.4, para 5, where
it says "...The first bit of a storage unit is numbered zero...." without
saying whether this is the MSB or the LSB (the same also goes for storage
units in a word of course).

: > Most of the time, as you say, bit fields are adequate, but how would you
: > implement ECC algorithms or maximal length sequence generators for instance?

: Larry Kilgallen

Bill Williams




^ permalink raw reply	[flat|nested] 66+ messages in thread
* An observation of Ada (may offend)
@ 1995-03-29  0:00 R.A.L Williams
  0 siblings, 0 replies; 66+ messages in thread
From: R.A.L Williams @ 1995-03-29  0:00 UTC (permalink / raw)


In article <1995Mar17.144930@lglsun.epfl.ch> Robb Nebbe wrote:
: In article <3kbkm1$41o@miranda.gmrc.gecm.com>, bill@valiant.gmrc.gecm.com (R.A.L Williams) writes:

: ...

: |> b. No bit level manipulation (fixed in Ada95 but only for unsigned
: |> ie. mod INTEGERs, I can't test a sign bit, not that I need to) HCTBAEL.

: It is trivial to write a generic package providing bit manipulation on
: arbitrary integer types in Ada 83.

What do you mean? 

One approach is to hack something together, ie. shift implemented as 
multiply/divide, and implemented as something very complex involving 
subtraction etc. (unpleasant)

The other approach is to define BIT a derived type of INTEGER, WORD
as an array of BIT's and use a representation clause to try to force 
this down to one bit per 'bit'.  The trouble with this is that there 
is no natural coversion to/from integer. Another problem may be that 
not all compilers (at least the last time I used Ada 83) actually 
*implement* representation clauses. They're all meant to check them
syntactically, but this is an implementation dependent feature.

Have I forgotten something? Is there another approach?

: I would expect that it would usually be more appropriate to check if
: a value was < 0 rather than checking the sign bit but I'll assume you
: had a good reason.

No, that was just an example - I don't dee many situations where I'd do that.

: |> 
: |> h. And a special one for Ada95: poor encapsulation of objects. I can
: |> define a 'member function' for a class by including the class in the
: |> parameter list. Unlike C++ or Eiffel, I can do this *anywhere* in my code,
: |> even a nested function hidden somewhere seemingly 'irrelevant'. Whereas
: |> other features of Ada go out of their way to force the programmer to
: |> follow 'good practice' (sometimes a matter of opinion), this seems
: |> very lax.

: If you declare a private type then the only place you can see the
: implementation is from inside the package where the type is declared
: (or a child package). You can declare subprograms that have parameters
: of this type elsewhere but that certainly doesn't qualify as a 'member
: function'.

: The idea you are looking for is 'primitive operations' which a
: explained in the LRM.

Yes, mea culpa. I got this entirely wrong. I must RTFM before activating
fingers in the future!

: Robb Nebbe


Bill Williams




^ permalink raw reply	[flat|nested] 66+ messages in thread
* An observation of Ada (may offend)
@ 1995-03-27 10:38 R.A.L Williams
  1995-03-30  3:14 ` Michael D. Griffin
  0 siblings, 1 reply; 66+ messages in thread
From: R.A.L Williams @ 1995-03-27 10:38 UTC (permalink / raw)


In article <D5Mz8J.AHB@inmet.camb.inmet.com> Tucker Taft wrote:
: R.A.L Williams (bill@valiant.gmrc.gecm.com) wrote:

: : h. And a special one for Ada95: poor encapsulation of objects. I can
: : define a 'member function' for a class by including the class in the
: : parameter list. Unlike C++ or Eiffel, I can do this *anywhere* in my code,
: : even a nested function hidden somewhere seemingly 'irrelevant'. Whereas
: : other features of Ada go out of their way to force the programmer to
: : follow 'good practice' (sometimes a matter of opinion), this seems
: : very lax.

: What are called "methods" in some OOPs are called "primitive 
: operations" or "dispatching operations" in Ada 95.  These 
: may be defined *only* immediately within the same package
: spec as the type.  (If a type extension is declared in a package body or
: declarative part, you can override inherited primtive ops there -- and
: only there -- for that typ extension, but you can't define any new ones.)

: So I don't think Ada 95 suffers from the above problem.  Perhaps
: you were referring to something else, but I can't quite imagine what
: problem it would be.  An example might help.  We certainly never meant
: for Ada 95 to be "lax" ;-).

No, that's what I was referring to. All I can do is apologise for activating
fingers without previously engaging brain. I hadn't spotted that in the LRM
and I never tried to do anything differently because, well, its not nice!

The sooner someone comes out with a really good text book for Ada 95 so
I can stop making boo-boos like this the better!

: -Tucker Taft  stt@inmet.com
: Intermetrics, Inc.

Bill Williams
bill.williams@gec-mrc.co.uk



^ permalink raw reply	[flat|nested] 66+ messages in thread
* An observation of Ada (may offend)
@ 1995-03-27 10:28 R.A.L Williams
  1995-03-27  0:00 ` Norman H. Cohen
  1995-03-28 17:07 ` Larry Kilgallen, LJK Software
  0 siblings, 2 replies; 66+ messages in thread
From: R.A.L Williams @ 1995-03-27 10:28 UTC (permalink / raw)


In article <1995Mar17.180137.9394@eisner> Larry Kilgallen wrote:
: In article <3kbkm1$41o@miranda.gmrc.gecm.com>, bill@valiant.gmrc.gecm.com (R.A.L Williams) writes:

: > b. No bit level manipulation (fixed in Ada95 but only for unsigned
: > ie. mod INTEGERs, I can't test a sign bit, not that I need to) HCTBAEL.

: Well some of us don't have Ada95 scheduled for our platforms...
: ...but I find that when I need to manipulate bits it is specific bit
: fields rather than generic bit-algebras :-).  Representation clauses
: in Ada are marvelous (although I have used similar capabilities from
: other languages which don't happen to be codified in their standards).

I agree that the representation clauses defined in the LRM are splendid,
the problem is that they are *optional*. I don't know what the situation
is now, but when I last did a lot of work in Ada many compilers had only
a fragmentary coverage. 

Most of the time, as you say, bit fields are adequate, but how would you
implement ECC alogorithms or maximal length sequence generators for instance?
So far as standards are concerned, I believe that bit fields are codified
in the ANSI C standard, and every ANSI C compiler I've used actually does
implement them.

: > e. No short cut operators (+= etc.) -- sorry, we've had this debate
: > already in another thread, I've heard the objections, I still like the
: > operators.

: I disagree, perhaps for a reason which has not been stated.  The 26 letters
: and the space bar are about all that I can touch-type.  Entering any
: punctuation requires looking at the keyboard, so I prefer long-cut
: operators.

Well, OK, but

  variable := variable + offset;

is 9 characters (not counting spaces for readability) longer than

  variable += offset;

I would also submit that, at least when the l-value gets more complex,
ie. array/structure dereference etc., that the short cut version is more
readable. For a simple statement like the example above there's no real
difference in readability. For my money, readability is the prime
criterion. I work on jobs where code inspection is often the most
cost-effective method of reducing test and integration costs. There is
also a benefit in long term maintenance.

: Larry Kilgallen

Bill Williams
bill.williams@gec-mrc.co.uk



^ permalink raw reply	[flat|nested] 66+ messages in thread
* An observation of Ada (may offend)
@ 1995-03-12 23:39 Matt Bruce
  1995-03-13  0:34 ` David Weller
  1995-03-14  4:49 ` Vladimir Vukicevic
  0 siblings, 2 replies; 66+ messages in thread
From: Matt Bruce @ 1995-03-12 23:39 UTC (permalink / raw)



Hi,

Is it my imagination, or is Ada the demonic lovechild of C and Pascal?

I've had to study Ada this semester for a unit at my Uni called Advanced
Programming Techniques. What fun. Not. :) Learning techniques AND a new
language - what an experience - considering I'm learning COBOL and SQL
this semester.

Enough of my griping. Back to the assignments...

-----------------------------------------------------------
Matt Bruce     st952adf@pilot.stu.cowan.edu.au  (preferred)
"Even with an IQ of 6,000, it's still brown trousers time."

--------
For information about this Usenet posting service, send mail to
remailer@soda.berkeley.edu, with Subject: remailer-info.
Please, don't throw knives.



^ permalink raw reply	[flat|nested] 66+ messages in thread

end of thread, other threads:[~1995-04-04  0:00 UTC | newest]

Thread overview: 66+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-03-17  9:27 An observation of Ada (may offend) R.A.L Williams
1995-03-17 15:23 ` Robb Nebbe
1995-03-17 17:08 ` Norman H. Cohen
1995-03-20  3:23   ` S. Tucker Taft
1995-03-20 10:13   ` Robb Nebbe
1995-03-21 21:05     ` Robert Dewar
1995-03-20 16:15   ` Robert I. Eachus
1995-03-21 19:47     ` Norman H. Cohen
1995-03-22  1:28       ` David Weller
1995-03-23  5:47       ` Robert Dewar
1995-03-23 16:38         ` Robert I. Eachus
1995-03-24 10:46           ` Peter Hermann
1995-03-24 16:52             ` David Weller
1995-03-26  4:03               ` Robert Dewar
1995-03-24 21:33             ` Tucker Taft
1995-03-27  9:59             ` Child packages Robb Nebbe
1995-03-28  1:11               ` Keith Thompson
1995-03-28 11:54                 ` Keith Thompson
1995-03-27 18:58             ` An observation of Ada (may offend) Mark A Biggar
1995-03-24 19:45           ` Garlington KE
1995-03-27 19:58             ` Robert I. Eachus
1995-03-28 16:29               ` Garlington KE
1995-03-28 19:30                 ` Robert I. Eachus
1995-03-28 22:37                   ` Garlington KE
1995-03-29  8:31                   ` Robb Nebbe
1995-03-25 17:58           ` Robert Dewar
1995-03-26  6:20             ` R_Tim_Coslet
1995-03-27 20:38               ` Robert I. Eachus
1995-03-26  3:50           ` celier
     [not found]           ` <3l1lkq$pm6@gnat.csn <3l2o9a$3a1@infomatch.com>
1995-03-27 23:16             ` Robert Dewar
1995-03-23 18:05       ` John DiCamillo
1995-03-17 23:01 ` Larry Kilgallen, LJK Software
1995-03-18 12:41 ` Tucker Taft
1995-03-22 16:50 ` Renaud HEBERT
1995-03-23 23:23   ` John Volan
1995-03-24  0:38   ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1995-03-30  0:00 R.A.L Williams
1995-04-03  0:00 ` Norman H. Cohen
1995-03-29  0:00 R.A.L Williams
1995-03-27 10:38 R.A.L Williams
1995-03-30  3:14 ` Michael D. Griffin
1995-03-30  0:00   ` David Weller
1995-04-04  0:00   ` Jack Beidler
1995-04-04  0:00   ` Brian Rogoff
1995-03-27 10:28 R.A.L Williams
1995-03-27  0:00 ` Norman H. Cohen
1995-04-04  0:00   ` Robert Dewar
1995-03-28 17:07 ` Larry Kilgallen, LJK Software
1995-03-12 23:39 Matt Bruce
1995-03-13  0:34 ` David Weller
1995-03-14  4:49 ` Vladimir Vukicevic
1995-03-17 17:00   ` Michael Feldman
1995-03-17 13:09     ` Fred J. McCall
1995-03-18 20:34       ` Michael Feldman
1995-03-19 22:20         ` Robert Dewar
1995-03-20 17:19           ` Michael Feldman
1995-03-21 21:02             ` Robert Dewar
1995-03-21 23:01             ` Kevin F. Quinn
1995-03-22 12:43             ` Mike Meier
1995-03-20 20:38           ` Kevin F. Quinn
1995-03-21  3:02         ` Michael M. Bishop
1995-03-20  9:31       ` Robb Nebbe
1995-03-20 20:16       ` Mats Weber
1995-03-22 19:44       ` Stephen McNeill
1995-03-28 14:48       ` Wes Groleau
1995-03-22 17:20     ` Richard G. Hash

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