UBF byte register question

Erik Pearson erik@REDACTED
Thu Apr 24 15:34:08 CEST 2003

I'm wondering what the scope and lifetime of a UBF byte register is 
supposed to be. The byte register allows the association of an 
arbitrary UBF value with a single byte (that byte being any byte that 
is not reserved by UBF.)

<background (or my attempt at such)>

The reason for the byte register is to allow more compact UBF messages, 
since you can first send several commonly used values which are 
associated with a specific byte. When that byte is seen later, the 
associated value replaces the byte.

The register is set by sending

value >B

where value is any UBF value, > means "store in", and B is any byte 
that is not reserved by UBF(A).


   "Universal Binary Format" >U
   U $

would be equivalent to

   "Universal Binary Format" $


   'person' >p
   "Brown" >b
   # {p "John" b} &
     {p "Patricia" b} &
     {p "James" b} & $

would be equivalent to

   # {'person' "John" "Brown"}  &
     {'person' "Patricia" "Brown"} &
     {'person' "James" "Brown"} & $


So I'm wondering long the byte register should live for, and who should 
see it.

The spec (http://www.sics.se/~joe/ubf/site/ubfa.html) doesn't specify, 
as far as I can tell.

My best guess is that the the byte registers are only valid for the 
single object following one or more byte register settings. The only 
unit of transaction at UBF(A) is the data object, which is terminated 
with a $ (dollar sign.). However, this would make the byte register 
useful only for longish lists which contain repeated elements.

I am tempted to suggest that the byte register could live for a longer 
span -- for the length of some sort of 'session' (network connection, 
etc.) However, such concepts don't live in the realm of UBF(A).

It would also be tempting to think of the byte register having a longer 
lifetime, allowing for a dynamic cache of frequently used values to 
persist between a client and server (adjusted by analyzing the 
frequency and size of objects being transmitted).

As to who should see a given byte register, if the span of the byte 
register is a single object (or session), then it would clearly be 
valid only for the current client. Since there is no concept of client 
at UBF(A), there is really no sense in making this distinction. 
However, if a byte register could persist for a longer period of time, 
it would make sense to address the issue of multiple sessions or 
clients accessing the same byte register.

Anyway, thanks for bearing with my seemingly endless UBF blitherings!

Erik Pearson
desk +1 510 527 5437
cell +1 510 517 3122

More information about the erlang-questions mailing list