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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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 Path: g2news2.google.com!news4.google.com!news.glorb.com!cycny01.gnilink.net!spamkiller.gnilink.net!gnilink.net!trnddc07.POSTED!87bf9b22!not-for-mail From: Dan Nagle Reply-To: dnagle@erols.com Organization: Purple Sage Computing Solutions, Inc. User-Agent: Thunderbird 1.5.0.2 (X11/20060420) MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: Ada vs Fortran for scientific applications References: <0ugu4e.4i7.ln@hunter.axlog.fr> In-Reply-To: <0ugu4e.4i7.ln@hunter.axlog.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Date: Tue, 23 May 2006 11:40:27 GMT NNTP-Posting-Host: 70.108.4.182 X-Complaints-To: abuse@verizon.net X-Trace: trnddc07 1148384427 70.108.4.182 (Tue, 23 May 2006 07:40:27 EDT) NNTP-Posting-Date: Tue, 23 May 2006 07:40:27 EDT Xref: g2news2.google.com comp.lang.ada:4361 comp.lang.fortran:10111 Date: 2006-05-23T11:40:27+00:00 List-Id: Hello, Jean-Pierre Rosen wrote: > Disclaimer: > I am an Ada guy. FORTRAN was my first programming language, but it was > long, long ago, and I don't know about the latest improvements to the > language. I'll answer some questions here, but I'd like to be > enlightened on the latest trade from the FORTRAN side. Little things first: I write Ada, you write Fortran. > Dan Nagle a �crit : >> Can you compare and contrast Ada packages >> with Fortran modules and submodules? > Honestly, I don't know about Fortran modules. Metcalf, Reid & Cohen, _Fortran 95/2003 Explained_ is a great place to start. (I have Barnes for Ada 95, the Ada 2005 book is back-ordered until summer :-( ) > Is it possible in Fortran to define three *incompatible* types Length, > Time, and Speed, and define a "/" operator between Length and Time that > returns Speed? Yes. > I need to be educated about Fortran's kind, but can you use it to > specify that you want a type with guaranteed 5 digits accuracy? Yes. > Ada's accuracy requirement is independent from any hardware (or > software) implementation of floating points, and are applicable even for > non IEEE machines. These days, computers use 754 arithmetic (and if 754r finally completes, I expect 754r arithmetic will follow eventually). The Fortran committees are tracking 754r. Fortran isn't usually used for embedded systems with "interesting" floating point. >> Can you compare Interfaces.C to ISO_C_BINDING? >> How is one better or worse than the other? > Sorry, I don't know what you are refering to (except for Interfaces.C :-) iso_c_binding is the standard-defined module providing Fortran definitions of C entities. It's about 95% of Fortran's "Interoperability with C" feature. > Concurrency has been in Ada since 1983! Moreover, it's a multi-tasking > model, not concurrent statements model. Both models have benefits and > drawbacks, it depends on the needs. Co-arrays are the main concurrency of f08. For a quick update, the paper is at Rutherford-Appleton Labs, see http://epubs.cclrc.ac.uk/bitstream/161/raltr-1998060.pdf > More convenient to write: > Mat1 := Mat2 * Mat3; A programmer may define a matrix type where the * may be the matrix multiplication operator. This has been discussed a bit in this thread. > In practice, compiling an Ada program with or without bounds checking > shows very little difference in execution speed, because only the really > useful checks are left, all the spurious ones have been eliminated. In practice, bounds checking is available with every Fortran compiler. It's usually off by default (for performance). Fortran has not been f77 for 15 years now, modern Fortran is so different some purists like to pretend it's a different language. :-) -- Cheers! Dan Nagle Purple Sage Computing Solutions, Inc.