[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Savannah-hackers] submission of Macks: safe Ada unit

From: fraser
Subject: [Savannah-hackers] submission of Macks: safe Ada unit handling
Date: Wed, 05 Jun 2002 13:48:24 -0400

A package was submitted to
This mail was sent to address@hidden, address@hidden

Fraser Wilson <address@hidden> described the package as follows:
License: gpl
Other License: 
Package: Macks: safe Ada unit handling
System name: macks
This package does NOT want to apply for inclusion in the GNU project

Macks is a physical units preprocessor.  Given a set of fundamental
units, and other units derived from them, Macks produces an Ada spec
and body which implements these relationships in a type-safe way.  For
example, telling Macks that velocity is distance divided by time
generates three distinct floating point types, one for each unit,
along with operators to convert between them.  You can divide a
distance by a time interval to get velocity of course, but you can
also take a velocity and multiply it by a distance and get the time
interval.  Operators for multiplication and division by scalars are
also generated.  Semantically invalid operations are caught by the Ada

Macks can also handle vectors of units, and supplies useful operations 
(addition, dot product, cross product) for them too.

There is no run-time penalty associated with using Macks.  All unit types are 
mapped to the underlying floating point types, and the operators to their low 
level equivalents.

Macks exists because there\'s no straightforward way to apply Ada\'s strong 
compile-time type checking to interrelated quantities without writing a large 
amount of tedious operator specification by hand.

Macks contains three other libraries of a more general nature. WL implements 
hash tables, dynamic arrays, etc.  GCS is a general lexical analyser and 
compiler building tool.  Source_Gen is a set of utility functions for 
generating source code.

Macks is available for download at

Other Software Required:
GNAT Ada compiler, or GCC 3.1

Other Comments:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]