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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4cb2c432feebd9d X-Google-Thread: 1094ba,c4cb2c432feebd9d X-Google-Attributes: gid103376,gid1094ba,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!j55g2000cwa.googlegroups.com!not-for-mail From: gautier_niouzes@hotmail.com Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: Ada vs Fortran for scientific applications Date: 23 May 2006 01:34:12 -0700 Organization: http://groups.google.com Message-ID: <1148373252.570182.201140@j55g2000cwa.googlegroups.com> References: NNTP-Posting-Host: 206.122.158.4 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1148373257 32518 127.0.0.1 (23 May 2006 08:34:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 23 May 2006 08:34:17 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: j55g2000cwa.googlegroups.com; posting-host=206.122.158.4; posting-account=CZAoAgwAAAD9ntJQ85OlWL0_Q5EFdzP_ Xref: g2news2.google.com comp.lang.ada:4358 comp.lang.fortran:10106 Date: 2006-05-23T01:34:12-07:00 List-Id: Nasser Abbasi: # I like to discuss the technical reasons why Ada is not used as much as # Fortran for scientific and number crunching type applications? The main reason is: - Fortran started in 1953 - Ada started in 1983 During the 30 years before Ada *tons* of scientific software were done and the Fortran compiler technology probabily still has a solid advance over the "newcomers" in terms of numerical efficiency. Generations of scientifics and engineers learned and then taught the language. Add to it that Fortran is readable and fully bracketed, which makes it *on that point* as good as Ada. # To make the discussion more focused, let's assume you want to start # developing a large scientific application in the domain where Fortran is # commonly used. Say you want to develop a new large Finite Elements Methods # program or large computational physics simulation system. Assume you can # choose either Ada or Fortran. If you have to program from scratch your FEM/CFD program, I suggest Ada (successful experience); but most of the time projects will reuse existing code, then, it depends... The advantages of transition to Ada appear not immediately: probabily you'll have to interface to Fortran routines, which is easy but not as easy as not having to interface. Only then the advantages begin to appear: - the compiler finds plenty of nasty bugs, including in "established" pieces of Fortran code you pass through f2a - you prevent lots of bugs like bad element numbering by using subtypes of Integer (Positive, arrays' ranges) - you add much clarty by using enumerated types for coding boundary conditions, methods, formats, options, etc. and let the compilation of "case" statement find forgotten cases - you can use the same code on several machines (no language dialect, compatible I/O, you can select floating-point type in one "subtype Real is ..." for the whole project) - you can use the same code for filling several matrix types (sparse, band) through generics A few other advantages may have been levelled in Fortran 9x+, eventually by breaking compatibility with previous versions - please comment! - you prevent bugs and add readbility with "for i in A'Range(1) loop" and not having to pass dimensions as parameters - no possibility of bugs like passing matrix,vector instead of vector,matrix as parameters and other type mismatches - no problem like real_variable = (integer expression) putting fuzzy contents as floating-point data - no problem of undefined variables (ijk written as jik): Ada has an implicit overall "implicit none" - no need of explaining for each subroutine parameter its dimensions and base type (Ada has user-defined types) - no problem with several formats for floating-point litterals (1.3e7, 4.2d5) IMHO all advantages concern essentially reliability and and an important programmer-time reduction. Gautier ______________________________________________________________ Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm NB: For a direct answer, e-mail address on the Web site!