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-Thread: 103376,9742b7560760142d X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!post02.iad01!roadrunner.com!not-for-mail Date: Wed, 11 Jul 2007 21:27:30 -0400 From: none <""knoppix\"@(none)"> User-Agent: Debian Thunderbird 1.0.6 (X11/20050802) X-Accept-Language: us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: WG: SI Units - has Ada missed the boat? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <46958287$0$8946$4c368faf@roadrunner.com> Organization: Road Runner High Speed Online http://www.rr.com X-Complaints-To: abuse@rr.com Xref: g2news1.google.com comp.lang.ada:16468 Date: 2007-07-11T21:27:30-04:00 List-Id: Grein, Christoph (Fa. ESG) wrote: >>One of my pet hopes for Ada2005 was that it would include some method >>of automatically checking systems of units at compilation time or with >>minimal run-time checking. Alas it was voted down due to time > > > I have to admit that I was the main perpetrator who killed that > proposal. > > >>Is anyone still working on an Ada solution to this? > > > I don't think so, if you mean a method to include in the Ada standard. > Back in the 80's I was working on a simulator, where we the software people wrote the infrastucture and the various subject area specialists wrote the code for the things they wanted to simulate. We (software weenies) created a package (wish I could remember the name of it) that provided basic types LENGTH_UNITS, TIME_UNITS, SPEED_UNITS, DISTANCE_UNITS, TEMPERATURE_UNITS, ANGLE_UNTIS, etc. and then defined all of the overloaded operators to convert between those. The upshot of this was the convers stuff got so large and complec that we wrote a program that would read a text file that would define the conversions i.e. LENGTH_UNITS = SPEED_UNITS * TIME_UNITS... etc, the program then was able to define the base conversion and the related conversions ( SPEED_UNITS = LENGTH_UNITS / TIME_UNITS ), etc. I don't remember the details but there was also a way to define the conversion from various units into the generic _UNITS. For instance for LENGTH_UNITS, METERS would = 1, feet would be whatever the conversion from feet to meters is, furlongs would be defined similarly. This program would then write the ADA specs and bodies for the conversion. Down side : This was in 1986ish. The "UNITS" package took about 4 hours to compile (on a VAX using VAX ADA) and every component took a long time to compile because every expression had to be compared to the myriad of overloads to determine if the expression was valid. If a conversion didn't exist, you added the appropriate info to the conversion file (and hope you did it right), checked it back into CM, and the build ran overnight. The next morning you could compile your expression. Up side : We NEVER had unit conversion issues, as the unit analysis was done by the compiler. This enabled the subject matter experts to write code that defined a value of type say mytime : TIME_UNITS, and myspeed : SPEED_UNITS, mydistance : LENGTH_UNITS (sorry rusty ADA syntax) and then mytime := FROM_FOTNIGHTS ( 10.0 ) ; myspeed := FROM_METERS_PER_SECOND ( 100.0 ) ; mydistance = myspeed * mytime ; PRINTLN ( TO_FURLONGS ( mydistance ) ) ; and myint : INTEGER ; myint = 10 ; mydistance = myspeed * myint ; would not compile. You can see why the conversion package got so big... it had to defein ALL valid conversions. Sorry this was so long. Wish I could remember more of the details It was one of the most fun ADA jobs I worked on. Joe Simon WB2JQT