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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1dd28d5040ded1f8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-15 07:57:34 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dennison@telepath.com (Ted Dennison) Newsgroups: comp.lang.ada Subject: Re: Announce: Grace project site operational Date: 15 May 2002 07:57:34 -0700 Organization: http://groups.google.com/ Message-ID: <4519e058.0205150657.3b695758@posting.google.com> References: <3CD88FBD.4070706@telepath.com> <3CD91E31.1060004@telepath.com> <3CDBD673.FF452A3D@otelco.net> <4519e058.0205140718.3ddb1b2a@posting.google.com> <3ce1424a$1@pull.gecm.com> NNTP-Posting-Host: 65.115.221.98 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1021474654 18118 127.0.0.1 (15 May 2002 14:57:34 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 15 May 2002 14:57:34 GMT Xref: archiver1.google.com comp.lang.ada:24097 Date: 2002-05-15T14:57:34+00:00 List-Id: "Martin Dowie" wrote in message news:<3ce1424a$1@pull.gecm.com>... > "Ted Dennison" wrote in message > news:4519e058.0205140718.3ddb1b2a@posting.google.com... > > To do this kind of thing *right*, you'd really need a language that > > relies on structural equivalence for types, and automaticly generates > > the proper new type given the operator and the types of its operands. > > In Ada, you just can't do that. ... > In the same vein as the standard Ada maths library doesn't try to > cover _all_ possible maths packages, an 'elementary SI' package should > be possible (I feel) to cover 99% of project needs (e.g. SI units and > support for powers to the +/- 3 plus a base 'dimensionless' unit). ... > It might be big, it might not be pretty, but once its there it's not > exactly going to be changing! :-) I'm certianly not an engineering math expert, but I've watched enough of them try to go this route and fail that I'm skeptical. The big problem was always the geometric explosion of operators required for every new unit added. Its no biggie when you just have positions and velocities, but at ((n-1)n * p)/2 custom operators requred (where n = # of units in your system and p = the average number of operators per unit combo), you could potentially have to add 45p operators when the 10th unit is added, 105p operators when the 15th unit is added, and 190p operators when the 20th unit is added. If p is 2 ("*" and "/"), then that's 90, 210, and 380 operator subprograms respectively. According to http://www.unc.edu/~rowlett/units/index.html, there are actually 7 "fundamental" units, 22 more derived units with approved names, and a theoreticly limitless amount of derived units without approved names (eg: volume, luminance). There are 21 prefixes (powers of 10 scalings) any one of these units may have applied to them. Of course many of those would make no sense and could probably be left out (eg: yottaseconds, zeptoamperes). But if you try to do the math from here, you get into a ludicrous number of operator routines you are going to have to create. Now its quite possible that p is not constant in this equation, in other words that there are only a limited number of other units that any one unit will ever have to interact with (not related at all to n). That might make things manageable. That's one of the things I wouldn't know, not being an engineering math user myself. Now I'm not saying I think an SI package is a Bad Idea. Every project I've worked on had its own auxililary math ops and types package, so that would be a silly claim. Even without a separate type for every SI, it would be useful. I just want to make sure you really know what you are getting into. If you do go down this path, at least figure out up front how you are going to cull things down to keep it humanly doable. -- T.E.D. Home - mailto:dennison@telepath.com (Yahoo: Ted_Dennison) Homepage - http://www.telepath.com/dennison/Ted/TED.html (down)