Sorry it's taken so long to reply. Part of the problem is that
`racket/serialize` isn't typed:
#lang typed/racket
> (require racket/serialize)
> serialize
Type Checker: missing type for identifier;
consider using `require/typed' to import it
identifier: serialize
from module: racket/serialize in: serialize
This and the fact that the array struct types are declared in Typed
Racket makes adding serialization tricky at best. Also, it would only
work in untyped Racket.
Generally, deserializing is hard to make type-safe, and nobody has taken
it up yet for Typed Racket. Occurrence typing should help, but would
require `deserialize` to take a predicate argument (like the second
argument to `list*->array`), which it currently doesn't do.
Neil ⊥
Sam
Sam
On Wed, Jul 23, 2014 at 11:45 AM, Matthias Felleisen
What you want is something that can tell that the untyped reference is
dead after value is passed to typed code, so that a first-order check
can be used. This would require something new from Racket in the form
of a revocable reference.
Sam
On Wed, Jul 23, 2014 at 11:52 AM, Matthias Felleisen
I think the Racket `serialize` API is likely to be higher-cost than
that, even without considering Typed Racket.
>> What you want is something that can tell that the untyped reference is
>> dead after value is passed to typed code, so that a first-order check
>> can be used. This would require something new from Racket in the form
>> of a revocable reference.
>
> Does this also hold for immutable arrays? In this case a first-order check should suffice in principle.
Yes, for immutable arrays represented as flat data (not functions) the
checks would not require wrappers.
Sam
Sam