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 X-Google-Thread: 103376,fd3a5ba6349a6060 X-Google-Attributes: gid103376,public From: Gautier Subject: Re: should I be interested in ada? Date: 1999/02/15 Message-ID: <36C863E0.F79EFE5D@Maths.UniNe.CH>#1/1 X-Deja-AN: 444653980 Content-Transfer-Encoding: 8bit References: <7a72e6$g55$1@probity.mcc.ac.uk> To: p.helbig@jb.man.ac.uk Content-Type: text/plain; charset=iso-8859-1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-02-15T00:00:00+00:00 List-Id: > I'm actually quite happy programming in Fortran95 but Ada seems to be > the one language I regularly hear good things about (which also seem > believable AND relevant to me). > > Is there any reason to use Ada as opposed to Fortran95 for my stuff > (mainly number crunching, numerical analysis etc, some home-grown > graphics software, relatively simple text processing etc; almost all > code I use is my own)? The pluses: see below The minus: as for every language change there are decisions to take with the software already done: - translate (f2a perl script does the most) - interface when it would take too long to translate - see example as P.S. In terms of time, in my own project, the minus has costed me a week, the pluses have saved me about 6 months. So far I didn't need a debugger! It lets me plenty of time to read and answer the news 8-� ! > What are the main advantages/disadvantages of Fortran and Ada? Ada has been conceived with the experience of mistakes done with old languages (Fortran, C,...) and by clever people. You'll enjoy, among others: - readibility - well-done variable visibility: important for large numerics programs - strong typing which allows to catch plenty of mistakes - bounds of arrays always obtainable (that can be save plenty of hairs nerves, keyboards in usual Fortran programming life) - exceptions: replaces complicated Fortran error management codes useful when a 0 determinant should result as an error in a context and not in another (see P.S., "raise" statements) - modularity - portability The combination of the 2 latter allows me to use the same source file containing a Finite Element library for my calculations under OpenVMS (DEC Ada) and for the graphics program on PC (GNAT/DOS) to interpolate positions in elements, for displaying results. > How many platforms have ada compilers (in principle AND in practice)? Just for the freeware GNAT, there are plenty! Here is a list of the "official" ones: http://www.gnat.com/platforms.HTM -- Gautier -------- Homepage: http://www.unine.ch/math/Personnel/Assistants/Gautier/Montmollin.html Software: http://www.unine.ch/math/Personnel/Assistants/Gautier/Gaut_FTP.htm. PS: example of interfacing Fortran/Ada for LAPACK (perhaps could be made simpler, but it works...) -------------- --- DPBTRF --- -------------- procedure DGBTRF_f(M,N, KL,KU: Natural; AB: in out Matrix; LDAB: Positive; IPIV: out IVector; INFO: out Integer); PRAGMA Interface (FORTRAN, DGBTRF_f); PRAGMA Import_Procedure(Dgbtrf_f, Dgbtrf, Parameter_Types => (Natural,Natural,Natural,Natural, Matrix,Positive,IVector,Integer), Mechanism => (Reference,Reference,Reference,Reference, Reference,Reference,Reference,Reference)); procedure DGBTRF(M,N, KL,KU: Natural; AB: in out Matrix; LDAB: Positive; IPIV: out IVector) is begin DGBTRF_f(M,N,KL,KU,AB,LDAB,IPIV,INFO); if INFO<0 then raise Illegal_value; elsif INFO>0 then raise Computation_error; end if; end;