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,5ac12f5a60b1bfe X-Google-Attributes: gid103376,public From: "Marin David Condic, 407.796.8997, M/S 731-93" Subject: Re: Ada versus PL/I (was: Re: Ariane 5 - not an exception?) Date: 1996/09/05 Message-ID: <96090517174549@psavax.pwfl.com>#1/1 X-Deja-AN: 179016510 sender: Ada programming language comments: Gated by NETNEWS@AUVM.AMERICAN.EDU x-vms-to: SMTP%"INFO-ADA@VM1.NODAK.EDU" newsgroups: comp.lang.ada x-vms-cc: CONDIC Date: 1996-09-05T00:00:00+00:00 List-Id: "J. Kanze" writes: >> ---In Fortran, BASIC, Pascal, Algol, PL/I, Turbo C, you just >> use it [SQRT]. Nothing special needed. > >This isn't true for C (and thus Turbo C), of course. You have to >include math.h. While it is a built in in older lanugages like Fortran >or Basic, most modern languages will require a declaration for the >function somewhere. (I'm tempted to say that a language that doesn't >require a declaration for a function is somewhat deficient, but SQRT is >a special case.) > Well here's a point that ought to be considered before deciding if SQRT should be intrinsic or declared somewhere: Ada was (and still is) intended to serve the needs of embedded programming. (Yes! yes! yes! You can *still* use it to print paychecks and it works just fine!) In embedded systems, you are frequently limited in the amount of memory you have available and so you don't like to drag along lots of extra functions & procedures which will never be called. I've built or seen *LOTS* of embedded software which *NEVER* does any arithmetic more complicated than +, -, * and /. Hence you'd like to exclude things like SQRT, LOG, SIN, etc. as well as any other code that might be "intrinsic" in some other language. Making those routines live in a "with'ed" package has got to make this job a lot easier. I'm not really up on the latest "Linker" theory, but I'd be willing to bet that it is a lot simpler to never include an unused math package than it is to get a linker to find unused "intrinsic" functions built into the RTK and remove them as "dead code". Perhaps someone out there a little bit smarter than me can shed some light on it? Is it theoretically possible for a linker to find *all* unused code and eliminate it? Are most language compiler/linker combinations in use today going through appropriate gyrations to do this? (A plausible argument for not building packages with a bazillion functions in them?) MDC Marin David Condic, Senior Computer Engineer ATT: 407.796.8997 M/S 731-96 Technet: 796.8997 Pratt & Whitney, GESP Fax: 407.796.4669 P.O. Box 109600 Internet: CONDICMA@PWFL.COM West Palm Beach, FL 33410-9600 Internet: CONDIC@FLINET.COM =============================================================================== "Thanks to the Interstate Highway System, it is now possible to travel across the country from coast to coast without seeing anything." -- Charles Kuralt ===============================================================================