libera/#sicl - IRC Chatlog
Search
14:30:28
pjb
We can add an infinite number of array classes depending on types. We can optimize for each of `(unsigned-byte ,(expt 2 (* 8 n))); we could even optimize storage for non 8 multiples powers of 2…
14:31:20
pjb
But only number and character arrays can be specialized like that. The other lisp objects being references, they couldn't be stored inside the array (without extensive global analysis of the program).
14:32:25
pjb
Now, "global" is relative. If we can analyse the data flow and ensure that data is not leaked outside of a given function, then we could easily allocate arrays of structures, or array of conses…
14:33:24
drmeister
beach: I agree with you. In the case of specialized arrays though - I had to implement that all myself.
14:33:55
beach
pjb: I agree, and I know of people who want stuff like that, but I am going to be very reluctant to adding such things.
14:35:08
pjb
You may reject it. But I think it could be a nice opportunity for optimization if an implementation to provided it. Notably an array of defstruct means that each slot of the structure stored in the array could be of different size.
14:36:16
pjb
Notably, those 5 optimized cases would be nice if we want to exchange those arrays or this kind of storage with external code (FFI, memory mapped, etc).
14:37:19
beach
Things are so easy to add to SICL, given its structure, so I don't see why things like that should be in the main repository.
15:20:41
beach
So what I (or someone) should do is to group together all the SICL code required for one particular array/vector type into a single file, and add instructions on how to add more such types.
15:49:49
pjb
shka: memory could be shared with other things than processes, eg. with device drivers. eg. a video buffer.