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.2 required=5.0 tests=BAYES_00,FROM_WORDY, 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: "Nick Roberts" Subject: Re: should I be interested in ada? Date: 1999/02/18 Message-ID: <7aganu$qsc$1@plug.news.pipex.net>#1/1 X-Deja-AN: 445600642 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> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: UUNET WorldCom server (post doesn't reflect views of UUNET WorldCom) Newsgroups: comp.lang.ada Date: 1999-02-18T00:00:00+00:00 List-Id: robert_dewar@my-dejanews.com wrote in message <7afttr$7v3$1@nnrp1.dejanews.com>... |In article <7afc1o$3mi$2@plug.news.pipex.net>, | "Nick Roberts" wrote: |> Other than this, there's nothing Fortran can do that Ada |> cannot, and quite a few things that Ada can do better. It |> may be, in practice, that sometimes Fortran compilers |> can/will produce faster object code, but I think this is, |> in every case (or almost), only a matter of practice, |> rather than a theoretical limit. | |Yes of course all languages are Turing complete, so of |course you can do anything in any language, but Fortran-90 |has many features not present in Ada. To give just one |example, it has a much more sophisticated mechanism for |dealing with array aggregates and array aggregate |operations. Maybe I could have phrased it a little more clearly. I meant there's nothing Fortran can do that Ada cannot also do reasonably easily. Certainly, Fortran has some convenience notations that are not so convenient in Ada. To take Fortran's array facilities as an example, in Fortran one can put: real, dimension (1:10) :: x ... x = 1.0 setting all the elements of x to 1.0 (a 'broadcast scalar'), whereas in Ada to do the same thing, you must code something like: X: array (1..10) of Float; ... for i in X'Range loop X(i) := 1.0; end loop; or define a utility procedure, e.g.: type Vector is array (Integer range <>) of Float; ... X: Vector(1..10); ... procedure Fill (Object: in out Vector; Value: in Float) is begin for i in Object'Range loop Object(i) := Value; end loop; end; and then one can simply call: Fill(X,1.0); Fortran provides the handy 'where' statement, e.g.: where (x /= 0.0) x = 1.0/x reciprocates all the elements of x except those which are zero. The equivalent in Ada might be: for i in X'Range loop if X(i) /= 0.0 then X(i) := 1.0/X(i); end if; end loop; Or again, defining a procedure: procedure Reciprocate(V: Vector) is begin for i in V'Range loop if V(i) /= 0.0 then V(i) := 1.0/V(i); end if; end loop; end; and then the call: Reciprocate(X); will do the trick. And so on. I think it's probably best to leave the reader to decide whether the Ada equivalents I have demonstrated here are likely to be an onerous burden to the programmer or not. I believe Jean Ichbiah (leader of the team that designed 'Green', the language that became Ada 83) once said "Ada is a very simple language". Personally, I think Ada strikes a good balance of sophistication where it is needed, but simplicity where it is not. |I find it hard to believe that Nick knows Fortran-90 if |he writes such a claim. I'm afraid I must say that this strikes me as being a slightly unprofessional comment. May I suggest that comments as to the lack of knowledgeability of fellow usenet users are best made with a little greater caution? |It does not help Ada 95 to make bogus claims about it based |on lack of knowledge of languages to which you are |comparing it. After all people are always doing this to |Ada, don't make the same mistake! Certainly true. I will endeavour not to make bogus claims, and hope that others will make a similar effort. ------------------------------------- Nick Roberts 'The time has come,' the Walrus said, 'To talk of many things: Of shoes--of ships--and sealing wax-- Of cabbages--and kings-- And why the sea is boiling hot-- And whether pigs have wings.' Lewis Carroll "Through the Looking Glass" -------------------------------------