[racket] serializability of ISL structures?

From: Norman Ramsey (nr at cs.tufts.edu)
Date: Sat Nov 16 16:19:26 EST 2013

 > > [Are ISL structures made with define-struct serializable?]
 > 
 > Kind of. If this is about Universe programming (so that students can send
 > messages back and forth), I have them write conversion functions:
 > 
 >  (define-struct hh (cakes henries))
 > 
 >  (define (hh->lists hh)
 >    (list (cakes->lists (hh-cakes hh)) (henries->lists (hh-henries hh))))

It's not actually about Universe programming.   It's about caching a
data structure that is expensive to produce and will be reused for
many queries.

I'm gathering from the responses that

  - Structures created with define-struct are not automatically
    serializable with `write`.

  - There is not (yet) a consensus on whether making them so would be
    a good idea.

  - S-expressions are serializable, where an S-expression is one of:

       + number
       + symbol
       + string
       + (listof S-expression)

I'm happy enough to have my students convert their data structures to
S-expressions, then read and write those.


Norman

Posted on the users mailing list.