[Newbies] Re: Primitives and array computation
ncellier at ifrance.com
Thu Jul 10 20:59:22 UTC 2008
Frederic Dambreville a écrit :
>> Generally, no. It's also hard to do in a general Array, since each
>> Float is a full object, any arithmetic on it does unboxing and boxing
> The way I use it, this implies a strong limitation of squeak; each
> algorithm with intensive mathematical computation will need a
> dedicated primitive...
>> of a newly allocated Float object. To speed this up considerably you
>> would have to create primitive array that do not hold objects but.
> So, I understand that I need:
> - intermediate classes, for storing 'true' arrays,
> - translators for converting to/from standard squeak classes from/to
> these intermediate classes,
> - primitives for array computation on these classes
> or something like that.
> A lot of work...
> Are there people, which have already done a part of the job? Or are
> interested by such classes and primitives?
When you think of it, it's pretty well the case of Matlab:
Matlab interpreter is very inefficient.
(Don't you write a loop in matlab !).
And each arithmetic computation
a = b*c;
allocates a mxArray... like Smalltalk will allocate a Float...
However, Matlab has much of the needed array primitives.
Given that, the idea is to implement such array primitives in Smalltalk too.
I started to interface Blas and Lapack to Smalltalk, this is called
Smallapack (search with google).
Though i have a decently working version under Visualworks and Dolphin,
the Squeak one is unfortunately bleding edge (that means the tests do
not pass, worse, they can crash or block your image).
By now, i'm not working on it.
But if you want to use it as a starting point, i can provide some help.
More information about the Beginners