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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,791ecb084fdaba75 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-05 07:14:56 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!EU.net!uknet!doc.ic.ac.uk!yama.mcc.ac.uk!cs.man.ac.uk!newshost!bevan From: bevan@cs.man.ac.uk (Stephen J Bevan) Newsgroups: comp.lang.ada Subject: Re: Types with physical dimension Date: 05 Oct 1994 10:35:09 GMT Organization: Department of Computer Science; University of Manchester Message-ID: References: <36tole$j5e@cyclope.enst.fr> NNTP-Posting-Host: lemur.cs.man.ac.uk In-reply-to: rosen@enst.fr's message of 5 Oct 1994 09:38:05 +0100 Date: 1994-10-05T10:35:09+00:00 List-Id: In article <36tole$j5e@cyclope.enst.fr> rosen@enst.fr (Jean-Pierre Rosen) writes: ... I saw this idea in a paper long ago. As far as I recall, it was by N. Cohen. Norm, are you listening? This sounds like the method discussed in [Hilfinger:acm:toplas:1988], I don't remember if Hilfinger referenced/acknowledged Norman though. For interested parties, I've also included some references to other work on adding dimensions to programming languages :- @article { Biedl:acm:sigplan:1977 , author= "Albrecht Biedl" , title= "An Extension of Programming Languages for Clerical Computation in Science and Engineering With Special Reference to PASCAL" , journal= acm:sigplan , volume= 12 , number= 4 , pages= "31--33" , month= apr , year= 1977 , checked= 19940516 , keywords= "Pascal, dimensional types" , sjb= "Proposes an extension to Pascal that allows dimensional information to be added to declarations." } @article { Karr:Lovemann:cacm:1978 , author= "Michael Kaar and Lovemann, III, David B." , title= "Incorporation of units into programming languages" , journal= cacm , volume= 21 , number= 5 , pages= "385--391" , month= may , year= 1978 , keywords= "dimensional types" , reffrom= Horning:pc:1978c , reffrom= Hilfinger:acm:toplas:1988 } @article { House:bcscj:1983 , author= "R. T. House" , title= "A proposal for an extended form of type checking of expressions" , journal= bcscj , volume= 26 , number= 4 , pages= "366--374" , month= nov , year= 1983 , cr= "8610-0116 (uncomplementary)" , cr= "8704-0276 (rebuttal+response)" , cr= "8705-0377 by Luca Cardelli - complementary" , keywords= "dimensional types" , sjb= "describes adding physical ``dimensions'' and ``units'' in a strongly typed language (Pascal in used)." , reffrom= Hilfinger:acm:toplas:1988 } @article { Gehani:spe:1985 , author= "N. H. Gehani" , title= "Ada's Derived Types and Units of Measure" , journal= spe , volume= 15 , year= 1985 , pages= "555--569" , keywords= "Ada, dimensional types" , reffrom= Dreiheller:Moerschbacher:Mohr:acm:sigplan:1986 , reffrom= Hilfinger:acm:toplas:1988 } @article { Manner:acm:sigplan:1986 , author= "R. M{\"a}nner" , title= "Strong Typing and Physical Units" , journal= acm:sigplan , volume= 21 , number= 3 , pages= "11--20" , month= mar , year= 1986 , keywords= "dimensional types" , reffrom= Dreiheller:Moerschbacher:Mohr:acm:sigplan:1986 } @article { Dreiheller:Moerschbacher:Mohr:acm:sigplan:1986 , author= "A. Dreiheller and M. Moerschbacher and B. Mohr" , title= "Programming Pascal with Physical Units" , journal= acm:sigplan , volume= 21 , number= 12 , pages= "114--123" , month= dec , year= 1986 , refs= 7 , checked= 19940617 , source= "Dept. Library" , keywords= "Pascal, dimensional types" , abstract= "In~\cite{Manner:acm:sigplan:1986} (SIGPLAN Notices 3/1986) M\"anner proposes an extension of Pascal permitting the use of physical units in programs. We discuss his issues in this paper and describe our own somewhat different approach. Our language extension PHYSCAL of Pascal not merely satisfies the requirements suggested by~\cite{Manner:acm:sigplan:1986}, but also supports predfined units (International Standard), thorough realisation of the concept of scale factors, input/output facilities for number with units. The new concepts are motivated, and the language description is given formally and by examples. Finally we discuss some details of the realised language implementation by a PHYSCAL-to-Pascal preprocessor in an UNIX environment." } @article { Jones:ddj:pp:1987 , author= "Do-While Jones" , title= "Dimensional Data Types" , journal= ddj:pp , volume= 12 , number= 127 , pages= "50--54" , month= may , year= 1987 , refs= 3 , checked= 19940513 , keywords= "Ada, dimensional types" , abstract= "Using dimensional units as data types can facilitate the writing of clearer, more easily maintained code. Do-While presents example programs in Ada." , xref= Ludquist:ddj:pp:1987 } @article { Hilfinger:acm:toplas:1988 , author= "Paul N. Hilfinger" , title= "An Ada Package for Dimensional Analysis" , journal= acm:toplas , volume= 10 , number= 2 , pages= "189--203" , month= apr , year= 1987 , refs= 8 , checked= 19940623 , source= "Dept. Library" , keywords= "dimensional analysis, language design, units, dimentional types" , abstract= "This paper illustrates the use of Ada's abstraction facilities -- notably, operator overloading and type parameterization -- to define an oft-requested feature: a way to attribute units of measure to variables and values. The definition given allows the programmer to specify units of measure for variables, constants, and parameters; checks uses of these entities for dimensional consistency; allows arithmetic between them, where legal; and provides scale conversions between commensurate units. It is not constrained to a particular system of measurement (such as the metric or English systems). Although the definition is in standard Ada and requires nothing special of the compiler, certain reasonable design choices in the compiler, discussed here at some length, can make its implementation particularly efficient." , sjb= "Proposes the use of a UNITS package which exports a QUANT type which encodes the various dimensions and which can be checked at runtime. Logically each variable/constant becomes a record with 5 integers representing the dimensions and a single float representing the scalar value. It is noted that With a naive compiler, this is very inefficient!" }