freenode/#sbcl - IRC Chatlog
Search
20:35:57
Xof
I wish I had merged subclassable structures before we had about 19 different ways of stuffing things in object headers and widetags
20:58:45
Xof
the idea being to allow users to mess around with subclasses of package, random-state, pathname without having to do heroics to make those standard-classes
22:38:24
pfdietz
Ah, so there is the overhead of this dispatch. I guess not a problem if argument types were being checked anyway.
22:45:28
Xof
make the clhs-standardized class a structure class, make the sbcl-internal implementation also a structure class (so that we can get random numbers and intern symbols without clos being built)
22:52:50
aeth
I want the opposite feature. structures that cannot have inheritance in any way. (Apparently structures have some limited form of inheritance that no one uses.) Then, afaik, an implementation could allow :element-type some-structure-type in arrays, and CL has both arrays-of-structs and structs-of-arrays, making it good competition for Java/C#/D/etc.
22:54:20
aeth
Well, typed hash tables would still be a missing feature. (Typed lists are trivial to write with structs.)
22:55:13
pfdietz
The problem with inlining finalized structures in arrays is getting object identity right. Access of the array is not supposed to copy them.
22:56:52
pfdietz
The specialized arrays in CL implementations are typically either T or of some type on which EQ is not well defined.
22:58:04
aeth
It wouldn't copy. I think the main issue would be if an object obtained through an array reference is still alive while the array reference itself is no longer active.
22:59:49
pfdietz
So storing into the array overwrites the structure there? That would violate the usual semantics, making behavior differ from inspecialized arrays.
23:02:05
aeth
Arrays and hash tables containing things more specific than T are among the few things that I think would have to be solved at the implementation level rather than addable through a library, although I think typed hash tables could be written on top of typed arrays.
23:08:44
aeth
pfdietz: Would it be possible to make an array containing elements of the type some-structure to be essentially a union of some-structure and some-structure-pointer? If set directly, some-structure-pointer and not as efficient (but probably no worse than T arrays), and if set indirectly, efficient? So e.g. (setf (some-structure-foo (aref some-structures 42)) 14f0) vs. (setf (aref some-structures 42) some-structure)
23:10:24
pfdietz
The first is getting the objects laid out in memory nicely. A compacting collector should do that, mostly.
23:11:32
aeth
Well, one thing that I would want is preserved type information in my data structures. Type an element in a struct, type the array to be of that struct type. Now the compiler knows what type that thing is.
23:11:48
pfdietz
The second is allowing code accessing the array to make assumptions about the types of the elements. That could be done with THE or TRULY-THE wrappers.
0:06:21
corci
Project sbcl-master build #3374: FIXED in 1 hr 2 min: http://ci.cor-lab.de/job/sbcl-master/3374/