hx2a is an "object-oriented spreadsheet" generic toolkit implemented in Java, C# and C++. It proposes a set of generic instruments to define class attributes which are constrained by an evaluation function to be enforced automatically and incrementally. As such, it belongs to the declarative programming family. Its originaly comes from the fact that it offers this facility within imperative programming languages such as C++ or Java, without any preprocessing of the code, and without run time interpretation of the evaluation function. The evaluation function is expressed using a compiled function, which exploits the entirety of the expressiveness of the host programming language. In particular, the type of the attributes is a regular type of the programming language, including complex datastructures which allow to experiment declarative rewriting. hx2a is inspired from Donald Knuth's attribute grammars.

hx2a allows to declare two types of class data: attributes and entries. Attributes are associated to an evaluation function which drives their value. Attributes cannot be updated directly. Entries are data which can be updated directly. They are not driven by an evaluation function. They trigger the recomputation of dependent attributes when updated. Both of them are regular data which can be declared in arbitrary user classes.

Attributes are lazily evaluated, meaning that they are recomputed only when requested. The package is incremental, because only the attributes which are affected by the entry updates which occured are reassigned. A minimal amount of them is recomputed at each reevaluation.

The package can be downloaded here:


hx2a - Java 1.6 implementation

hx2a - C# 2.0 implementation

hx2a - C++ implementation (not on line)

 

hx2a is copyrighted by Vincent Lextrait - 2006-2007 and free for research and educational purposes.
For further information vincent@lextrait.com