Re: canonical data representation

Marc Snir (snir@watson.ibm.com)
Sun, 2 Mar 1997 16:02:17 -0400

My take is that a program that generates data that is later used by a
visualization package, is responsible for generating data of the "right
size": e.g. 32 bit integers or 64 bit floats, if that's what the
visualization package wants. The canonical representation will specify a
unique bit representation for a 32 bit integer (say, 2-complement, little
endian), so that users do not have to worry about data representation,
beyond the size of each datum. This leaves room for two possible
interfacing mechanisms:

1. Visualisation package specifies the format it expects for data; the
client program has to dump data in files in this format. Since the only
issue is whether to use int or long or long long, float or double, the
programming effort required from the user is quite small. Code is not
portable, but the system dependent part can be encapsulated in a few
datatype definitions.

2. Visualization package is interfaced by a client library. The library
provides one portable interface (say, accepts arguments of type float).
The data conversion is dealt with inside the library. The user code is
fully portable. The library code is not portable, but the system dependnet
part can be encapsulated in a few datatype definitions.

I suggest not to go beyond this level of portability since, in many
instances, users will not want 64 bit values to be transparently truncated
to 32 bit values.