Friday, 6 August 2010

Unit system

Programming languages in general don't deal with the units of the floating point values (real per old Algol terminology), f.ex. when there's an assignment such as
  a := 10.5;
there's no information whether 10.5 is km/h, mph, pixels, Volt or megaGauss. In astronomy there's a need to distinguish between radians, degrees, hours. Furthermore degrees could be expressed in degrees (°) and decimal degrees, or degrees (°), minutes (') and seconds (").

For sternons, I'll try to add units to numbers. The concept is so rare that it's seldomly heard of in programming languages. I don't know whether it is a viable alternative to types – it might be too complex when fully implemented – but some very important projects that failed could have been well served by a unit control implementation.

Revision 55.

No comments: