comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de>
Subject: Re: Ada Pointer Problem
Date: Fri, 8 Oct 2004 14:03:16 +0000 (UTC)
Date: 2004-10-08T14:03:16+00:00	[thread overview]
Message-ID: <ck66n4$atp$1@a1-hrz.uni-duisburg.de> (raw)
In-Reply-To: 35f054ea.0410071045.58d3e9af@posting.google.com

skidmarks <aschwarz@acm.org> wrote:
:  Ada has
: protected me to the point that I can't get my job done without
: research.

I know that feeling; as it happens I am just know changing a part
of a program to use access values (here: pointers to constant items),
however, not for reasons of speed but for semantic reasons.

Each time the compiler takes me through the tedium of making access to
objects explicit, I remember my every day work, debugging programs
written in languages that invite me, and others, to just do
this and just do that. And it turns out that many of the obscure
runtime failures and porting surprises are a result of forgiving
languages. Reference types, unchecked arrays, unchecked visibility,
and then suddenly an unforeseen value is passed in during an I/O
operation, and the whole thing breaks down leaving one and a half
pages of stack trace. Then the stack trace doesn't even provide
enough information, because some things are nicely handled by implicit
language mechanisms, and are thus not shown.

This may be an exaggeration in favour of Ada-like languages, but
empirically I find errors in programs more quickly and using fewer
levels of indirection using Ada and avoiding pointers.

: Why pointers? The compilers we are using pass by value. Arrays and
: records copied to the stack on subprogram entry, and copied back on
: subprogram exit (or so I have been told). A pointer reduces this copy
: operation.

Confirming what J-P Rosen has said, I find this surprising. The compilers
I use choose an efficient parameter passing mode. When records or arrays are
passed and are sufficiently small, this may mean by copy, provided the
language definition allows pass-by-copy. Otherwise the compilers choose
to pass references.


: Pointers are useful [...]

No doubt.

: The 'point' is that the required reading to do simple, but perhaps
: non-pedestrian things, is far larger than in other languages. This
: intrudes on my ability to produce a product (but does not impact good
: design).

How long are these products in use?


-- Georg



  parent reply	other threads:[~2004-10-08 14:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-01 19:34 Ada Pointer Problem aschwarz1309
2004-10-02  0:47 ` Jeffrey Carter
2004-10-02 23:37   ` Randy Brukardt
2004-10-06 15:43     ` skidmarks
2004-10-06 18:19       ` Jeffrey Carter
2004-10-16  3:53         ` Benjamin Ketcham
2004-10-16 13:25           ` John B. Matthews
2004-10-18 18:09           ` Georg Bauhaus
2004-10-06 19:29       ` Georg Bauhaus
2004-10-07 18:45         ` skidmarks
2004-10-08  0:35           ` Jeffrey Carter
2004-10-08 12:02           ` Jean-Pierre Rosen
2004-10-08 16:58             ` Ludovic Brenta
2004-10-08 23:26             ` Björn Persson
2004-10-10 18:01             ` skidmarks
2004-10-08 14:03           ` Georg Bauhaus [this message]
2004-10-08 14:23           ` Dale Stanbrough
  -- strict thread matches above, loose matches on Subject: below --
2004-10-01 15:26 skidmarks
2004-10-01 15:50 ` David C. Hoos
2004-10-01 18:15   ` Jeffrey Carter
2004-10-01 17:24 ` 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