Path: utzoo!attcan!uunet!mcsun!ukc!stl!pgh From: pgh@stl.stc.co.uk (P.G.Hamer) Newsgroups: comp.lang.misc Subject: Re: Type systems with dimensional units Message-ID: <3978@stl.stc.co.uk> Date: 28 Jan 91 10:00:51 GMT References: <1991Jan21.225221.5598@shell.shell.com> Sender: news@stl.stc.co.uk Reply-To: "P.G.Hamer" Organization: STC Technology Limited, London Road, Harlow, Essex, UK Lines: 32 In the referenced article robison@brazil (Arch D. Robison) writes: >I am looking for references on languages that incorporate ``units checking'' >into their type system. Tried to e-mail but it bounced. Sorry, no good reference - but I seem to remember an article in a very old ACM comms (or just possibly BCS) - late 60's or early 70's. I assume that you are going to allow mixed expressions (area = x * y), so I you will presumably want an intermediate representation that keeps powers of the fundamental dimensions of space time (length, time, mass, ...). As I remember my physics, it gets a bit dodgy in the area of electrical units. It also does not identify when dimensionless contants are missing. Superficially this seems OK, but it can cause problems in several areas. First, it dousn't spot things like missing multiples of pi in electrical formula (a fairly common mistake), as the need for them is a function of the measurement system chosen they seem sort of dimensional. Second, missing out 'cosmological' constants (eg Plank's constant). Third, things like revs (as in revs per second) and counts (as in counts per second) are normally considered dimensionless -- but should [usually?] balance in an equation. Fourth, some measurements don't have very useful dimensions (eg one measure of viscosity is reported in seconds!). Please post (or e-mail) any good references you find. As a general problem it seems quite difficult, although most problem domains would probably be well served by a fairly simple solution using a few fundamental dimensions. Regards, Peter