Open bennn opened 1 year ago
Note that (a) substructures could add mutable fields (and TR's types don't currently track prop:sealed
) and (b) functions are "mutable" in this sense.
Understood. — Not unwrapping eagerly imposes a bad performance overhead (6x). We should try.
For any-wrap/c
to avoid wrapping these, I don't see why TR's types not tracking prop:sealed
should be relevant... any-wrap/c
can use runtime reflection operations right?
The important thing would be making sure, at runtime, that a value known to be an instance of an immutable struct A
, isn't actually an instance of a mutable struct B
that inherits from A
.
The 2nd return value of struct-info
, skipped?
, should be able to determine that, so it should only avoid wrapping it if skipped?
is #false
.
When an immutable struct with immutable fields crosses an
Any
boundary, it shouldn't need a wrapper.Example program (from #1332 ):
The contract profile says 40% of the running time is contracts. But all the checks could happen outside the call to
contract-profile-thunk
.For this to work,
any-wrap.rkt
will need to search through struct fields and the types inside.(If
Pill
was aBoxof Integer
, then the wrapper would be important.)