From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,efe381d5ed2da234 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!newsfeed.stueberl.de!news-mue1.dfn.de!news-ber1.dfn.de!news.uni-hamburg.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Ada Pointer Problem Date: Fri, 8 Oct 2004 14:03:16 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <7KadnU33z-bmpsLcRVn-og@megapath.net> <35f054ea.0410060743.7b73aac3@posting.google.com> <35f054ea.0410071045.58d3e9af@posting.google.com> NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1097244196 11193 134.91.1.34 (8 Oct 2004 14:03:16 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Fri, 8 Oct 2004 14:03:16 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: g2news1.google.com comp.lang.ada:4924 Date: 2004-10-08T14:03:16+00:00 List-Id: skidmarks 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