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,c7f5c70275787af8 X-Google-Attributes: gid103376,public From: Gautier Subject: Re: Ada vs Delphi? Date: 1999/08/07 Message-ID: <37AC015A.F0178539@maths.unine.ch>#1/1 X-Deja-AN: 509891632 Content-Transfer-Encoding: 7bit References: <37ab421a.5414989@news.total.net> To: Andre Ratel Content-Type: text/plain; charset=us-ascii MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-08-07T00:00:00+00:00 List-Id: > I am currently using Delphi (and Object Pascal) for my scientific > programming. I heard a lot lately about Ada. From what I have > seen, its syntax is very similar to Object Pascal. (This is no > surprise since both languages are derived from Algol.) > What would be the advantages of Ada over Delphi? For scientific programming, the advantages are enormous: - the language is standardized instead of proprietary; - there are plenty of compilers; - these compilers provide optimization; - you can compile the same program on other platforms than Windows e.g. I'm using the same Finite Element library sources on a DEC Alpha for calculations and on a PC for post-processing and display; - you can set the precision of floating-point types; you can obtain all limitations of floating-point types ('first, 'last, 'epsilon, ... attributes); - you can define vectors, matrices etc. and operators on these objects; - bounds of array are always available, in an elegant and easy way ('first, 'last, 'range attributes); - generics allows you to program one thing for various usages, e.g. matrices with integer or floating-point componants; a small example: function "*"(A:matrix; x:vector) return vector is r: field_elt; Ax: vector(A'range(1)); begin if A'length(2)/=x'length then raise constraint_error; end if; for i in A'range(1) loop r:= zero; for j in x'range loop r:= r + A(i,j-x'first+A'first(2)) * x(j); end loop; Ax(i):= r; end loop; return Ax; end; -- Gautier -------- http://members.xoom.com/gdemont/