guile-user
[Top][All Lists]
Advanced

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

Re: Uniform vectors, user survey


From: Mikael Djurfeldt
Subject: Re: Uniform vectors, user survey
Date: Sun, 24 Oct 2004 18:04:33 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Marius Vollmer <address@hidden> writes:

> I want to unify our two implementations of uniform vectors, and make
> them more useful.

Sounds like an important improvement.

> I guess uniform vectors would be mainly useful for interfacing to
> external code that deals with large arrays.  Like the GNU Scientific
> Library, say, or maybe things like data compression, image
> manipulation, binary file formats in general, etc.
>
> Instead of using uniform vectors, one can always define a new smob
> type that can wrap the large external array.  But maybe uniform
> vectors would be preferable in some cases, if only you could convince
> Guile to handle the external memory right (like you can with smobs).
>
> I have close to zero experience with using uniform vectors myself, so
> I appreciate your input.  Do you use uniform vectors?  What for?  Did
> you try but couldn't make them work for you?  What do you wish would
> be different about them?  Etc.

I use arrays as the basic representation of matrices in my matrix
library (guile-matrix).  uniform-vector-read/write! is an important
tool for dealing with binary file formats.

While smobs are useful in one of the scenarios which Guile targets
(application extension language), smobs are not useful as a basis for
data structures when developing code in Scheme (like in the scripting
language scenario).

Vectors are useful as a building block for data structures on the
Scheme side.  Generic vectors are not always a good alternative, for
example when working with large bodies of numerical or binary data.

Also, uniform vectors can sometimes be an important "generic" data
structure suitable for representation of arguments and results to
application extensions.  If we have a Guile library M which can do
some computation on every element of a collection of numbers, and
another library S which can compute statistics on collections of
numbers, we don't reach quite the same level of "cross-fertilization"
of these libraries if M collections are represented as M-smobs and S
collections as S-smobs.  What I'm saying is that the need to
efficiently represent a list of numbers is sufficiently common to
warrant a generic number list data structure such as the uniform
vector.

M




reply via email to

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