OBJECT-ORIENTED PROGRAMMING, SYSTEMS, LANGUAGES and APPLICATIONS
 
 
Program
 


Program (2mb PDF)

Explore
  Invited Speakers
  Onward!
  Panels
  Workshops
Discover
  Research Papers
  Student Research Comp.
  Posters
  Doctoral Symposium
  Educators' Symposium
  Wiki Symposium
  Dynamic Lang. Symp.
Understand
  Tutorials
  Essays
  Practitioner Reports
  Demonstrations
Create
  DesignFest
  Lightning Talks
  FlashBoF
  Instant Arts School Exp.
 
Other Events
 
Resort Map (364kb PDF)
 
Resort Map (JPG)

 

 
Basket
 

view, help

"Arithmetic with Measurements on Dynamically Typed Object Oriented Languages"

 

 
Page
 

Printer-friendly

 
 
  > Practitioner Reports > Language and Reality

 : Wednesday

Arithmetic with Measurements on Dynamically Typed Object Oriented Languages

Golden West Room
Wednesday, 11:30, 30 minutes

 


 
7·8·9·10·11·12·13·14·15·16·17·18·19·20·21

Hernan Wilkinson, Mercap Software Corp.
Maximo Prieto, Lifia, Universidad Nacional de La Plata
Luciano Romeo, Mercap Software Corp.

In physics, like in other sciences, formulas are specified using explicit measurements, that is, a number with its unit. The first step to determine the validity of a physics formula's evaluation is to verify that the unit of the result corresponds with the prospective unit. In software development, physics, financial and other sciences formulas are programmed using mathematical expressions based only on numbers, being the units of these numbers implicitly given by the semantics of the program or assumed by the programmer's knowledge. Consequently, it is common that errors result from operating with values expressed in different units, e.g., dividing a quantity of years by a quantity of months, without obtaining any type of indication or objection to this error from the system. In this report we discuss our experience designing and implementing a model that solves this problem reifying the concept of measurement, unit and their arithmetic. Our model relieves the programmer from the arduous task of verifying the validity of the arithmetic expressions regarding units, delegating that responsibility to the system, thereby diminishing the errors introduced by the incorrect use of values expressed in different units. We also show that having implemented this model with a dynamically typed language simplified its programming and increased its reusability.

 
.