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!news.glorb.com!newsgate.cistron.nl!xs4all!feeder.news-service.com!ecngs!feeder2.ecngs.de!ndsoftware.com!194.168.222.133.MISMATCH!news-out.ntli.net!newsrout1-gui.ntli.net!ntli.net!news.highwinds-media.com!newspeer1-win.ntli.net!newsfe6-win.ntli.net.POSTED!53ab2750!not-for-mail From: "Dr. Adrian Wrigley" Subject: Re: WG: SI Units - has Ada missed the boat? User-Agent: Pan/0.14.2.91 (As She Crawled Across the Table (Debian GNU/Linux)) Message-Id: Newsgroups: comp.lang.ada References: <46958287$0$8946$4c368faf@roadrunner.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Fri, 13 Jul 2007 22:20:32 GMT NNTP-Posting-Host: 82.21.99.109 X-Trace: newsfe6-win.ntli.net 1184365232 82.21.99.109 (Fri, 13 Jul 2007 23:20:32 BST) NNTP-Posting-Date: Fri, 13 Jul 2007 23:20:32 BST Organization: NTL Xref: g2news1.google.com comp.lang.ada:16472 Date: 2007-07-13T22:20:32+00:00 List-Id: On Wed, 11 Jul 2007 21:27:30 -0400, none wrote: > You can see why the conversion package got so big... it had to defein > ALL valid conversions. Interesting. I tried out something similar a while back, and the method was to add the overloaded functions only when they were needed. I found that there were rather few overloaded functions needed in practise. This is because expressions tend to be rather stereotypical - exotic combinations of dimensional expressions never arise. I think my solution used generic instantiations, in the end, cutting the amount of source. An interesting project which does include full units and dimensions support is Sun's Fortress: http://research.sun.com/projects/plrg/Fortress/overview.html This is very ambitious and complete in scope - at least for parallel, concurrent scientific codes. What do people here think of their efforts? I don't see Ada mentioned in their white papers, even although there's a lot of overlap in requirements. One interesting feature of Fortress is that "for" loops execute in any order (or none), by default. This gives the very fine grain parallelism opportunities I was talking about here a while a go. I think any general purpose language should come with proper physical types - I'm surprised that it's normally left out. (VHDL was the first language I used which had them) As regards Ada and units/dimensions, I think the way forward for most users is to put the units/physical types into a package and add overloadings by hand when needed. More intensive use warrants the use of generic packages. It's easy and the incremental effort is low. If you want a comprehensive approach, write an Ada preprocessor to extend the language with a new syntax for dimensional types. Use something like ASIS as a front end, and spit out standard Ada. One way would be to check dimensional consistency and then generate the necessary package(s) with the particular types and functions needed, adding "with" clauses where necessary. -- Dr. Adrian Wrigley, Cambridge, UK.