clasp icon indicating copy to clipboard operation
clasp copied to clipboard

Unboxed structure slots

Open Bike opened this issue 2 years ago • 0 comments

Currently structure objects use the same underlying representation as standard objects, the Instance_O with a Rack_O. This is essentially just a vector of boxed objects. It would be nice if structures (and, more exotically, standard objects) could have custom layouts with unboxed objects when :type specifications on lots make this possible.

To do this, work on the runtime and on the compiler is needed.

The compiler work is already mostly done as the compiler can handle unboxed values and send them around without boxing (though this does need improvement). With that in place it's possible to uses unboxed slots efficiently.

The runtime work has not really been started. It must be possible to register new object layouts and make them known to the garbage collector, so that the GC knows not to treat doubles as pointers, knows where the actual pointers in structure objects are, and knows how large thee custom structure objects are.

Additionally, the library definition of defstruct will need to integrate with said runtime facility. But that's easier, probably.

Bike avatar Apr 01 '23 00:04 Bike