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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd3a5ba6349a6060 X-Google-Attributes: gid103376,public From: robert_dewar@my-dejanews.com Subject: Re: should I be interested in ada? Date: 1999/02/20 Message-ID: <7aldu1$4q$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 446296672 References: <7a72e6$g55$1@probity.mcc.ac.uk> <36C93BB4.1429@ecs.soton.ac.uk> <7afc1o$3mi$2@plug.news.pipex.net> <7afttr$7v3$1@nnrp1.dejanews.com> <7aganu$qsc$1@plug.news.pipex.net> <36CC3AEA.59E2@lanl.gov> <7ai502$6an$1@nnrp1.dejanews.com> <36CD8DBA.237C@lanl.gov> <7akvao$j5t$2@plug.news.pipex.net> X-Http-Proxy: 1.0 x7.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Sat Feb 20 04:33:05 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-02-20T00:00:00+00:00 List-Id: In article <7akvao$j5t$2@plug.news.pipex.net>, "Nick Roberts" wrote: > Reorder(X,J) > > You've got to declare a utility procedure, certainly, but > otherwise this is just as neat as the Fortran, surely? My goodness one would almost think that Nick was trying to make Ada look bad by making dubious arguments. First, the Ada code is far uglier and less safe than the Fortran code, I really cannot imagine anyone thinking otherwise. But more importantly, the Ada code does not catch the semantics of the FORALL at all, there is no parallelism at all in the Ada code, and indeed it is quite likely that not even a clever optimizer can bail this out, because, as always it is the exceptions that get you in Ada (if an exception is raised, the semantics dictate exactly which iterations of the loop have occured and which have not). Nick has conveniently ignored this in his thinking, but it turns out to be absolutely crucial. All sorts of loops in Fortran that can be assumed to be parallel by the optimizer even if FORALL is not used CANNOT be assumed to be parallel in Ada because of the exception issue. This means that FOR ALL is in a sense even more crucial in Ada (which doesn't have it) than in Fortran 95 (which does). All this was covered in rather excruciating detail in the thread a few years ago about implementing FOR ALL in Ada. More so, perhaps? And it will not > necessarily produce object code which is any less efficient than the Fortran > equivalent. > > The basic principle is that there is no Fortran 90 construct which cannot be > modelled, perfectly adequately, by an Ada abstraction (typically a procedure > or function). Furthermore, you get something extra in making that > abstraction: encapsulation (factoring out common code), and a degree of > self-documentation (the name of the subprogram says what it does). > > ------------------------------------- > Nick Roberts > ------------------------------------- > > -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own