Strong typing and physical units

  • Authors:
  • R. Männer

  • Affiliations:
  • Physical Institute, University of Heidelberg, F.R. Germany

  • Venue:
  • ACM SIGPLAN Notices
  • Year:
  • 1986

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper proposes a syntactic extension of high level languages like PASCAL or ADA to allow the usage of physical quantities, i.e. numbers with units, instead of just numbers. It offers enhanced type checking for expressions and assignments during compilation time. Additionally, it allows problem oriented simple scaling of variables and local scale selection. Furthermore, it reduces the number of coding errors due to wrongly chosen scales. After a discussion of mutual relations between strong typing in programming languages and physical units, examples are shown to demonstrate the usefulness of the proposed extension. Finally a graph representation of the new syntactic elements is given.