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

Re: dylan scientific/multimedia



    Date: Tue, 06 Oct 92 20:41:08 -0400
    From: Simon Spero <ses@sunsite.unc.edu>
    Unboxed vectors would be a big win for small datatypes. At the moment the
    only types for which this has been defined are char and unicode-char; a new
    subclass of vector which only allowed objects from a single class to be stored
    in it would be a big win.
    
They'd only be a win for classes which can be enumerated in a small
number of bits.  (Where small is less than or sometimes equal to
the size of a pointer).

A class of vector which can be parametized as to how many bits
are stored per entry, and to which you could add methods for
type coercion to/from a small positive integer to store, would
be good.  There would also be methods for un-coerced access, for
the inner loops of routines, etc.

If some amount of type info is stored in pointers, and you want to
encode something in pointer-size number of bits, you'll need to go to
subprimitive-level unboxed access methods, being suitably careful of
the GC.  This sort of painful thing would be useful in the guts of the
FFI, and for doing 32-bit graphics on 32-bit machines.  (This is
the same issue as unboxed floating-point, in different guise.)

Although ugly, I think this is an important issue.  So long as people
make machines where the word size is as small as the pointer size
is large, good FFI is going to require this sort of thing.  Making
it easy and efficient will go a long way toward acceptance by
C programmers.