On 11/7/06, Carlos Pita <address@hidden> wrote:
Hi all,
suppose I want to "broadcast" some arithmetic operation, say (+
1), to
every cell in a vector. Suppose that the vector is an homogeneous
vector
of doubles and that performance should be C like. That implies:
1) unchecked unboxed fixnum increment of the iteration index.
2) array access without bound checking.
3) unchecked unboxed flonum arithmetic over the array contents.
Is it possible to achieve this with chicken by means of some kind of
annotations / declarations?
Chicken does not support unboxed arithmetic. The garbage collector
and execution is too much intertwined, which means that GC can
happen at any point during execution. Threading unboxed data through
the execution path becomes very hard.
And if it's possible, would it be just locally unsafe or unsafe at
the
entire module level?
You can switch off most bounds checking by compiling in unsafe mode
(unsafe at the entire module level) and/or linking with the unsafe
version
of the libraries (unsafe for the whole application).
Or would my best bet be to stop worrying and learn to love plain
inlined
C?
As you probably know, I'm thinking for quite some time about an
embedded (in Chicken, that is) low-level Scheme dialect that can be
used for such things, but I'm lacking time and energy in the moment.
Basically, this should translate a simple dialect of Scheme into plain
inlined C.