Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news4.ner.bbnplanet.net!news.ner.bbnplanet.net!news3.near.net!paperboy.wellfleet.com!news-feed-1.peachnet.edu!gatech!newsfeed.internetmci.com!news.kei.com!nntp.coast.net!col.hp.com!news.dtc.hp.com!hplntx!hplntx.hpl.hp.com!gjr
From: gjr@hplgr2.hpl.hp.com (Guillermo (Bill) J. Rozas)
Subject: Re: expressiveness and strong type system?
Sender: news@hpl.hp.com (HPLabs Usenet Login)
Message-ID: <GJR.96Mar27103140@hplgr2.hpl.hp.com>
In-Reply-To: blume@zayin.cs.princeton.edu's message of 25 Mar 1996 19:44:13 GMT
Date: Wed, 27 Mar 1996 18:31:40 GMT
Reply-To: gjr@hpl.hp.com
References: <OZ.96Mar14014447@nexus.yorku.ca> <hbaker-1403961017520001@10.0.2.15>
	<BLUME.96Mar14174151@zayin.cs.princeton.edu>
	<GJR.96Mar20105605@hplgr2.hpl.hp.com>
	<BLUME.96Mar20155909@zayin.cs.princeton.edu>
	<GJR.96Mar21130522@hplgr2.hpl.hp.com>
	<BLUME.96Mar21175659@zayin.cs.princeton.edu>
	<GJR.96Mar23140028@hplgr2.hpl.hp.com>
	<BLUME.96Mar23195442@zayin.cs.princeton.edu>
	<GJR.96Mar25093542@hplgr2.hpl.hp.com>
	<BLUME.96Mar25144413@zayin.cs.princeton.edu>
Nntp-Posting-Host: hplgr2.hpl.hp.com
Organization: Hewlett-Packard Laboratories, Palo Alto, CA
Lines: 46

In article <BLUME.96Mar25144413@zayin.cs.princeton.edu> blume@zayin.cs.princeton.edu (Matthias Blume) writes:

|      Really?  So what happens when I'm writing an object dumper/loader
|      library that any other program can use?
|
|   Andrew Appel just implemented such a beast for SML/NJ.  Granted, it is
|   probably not what you are looking for, because it is necessary to
|   write some extra code for each type one wants to "pickle".  On the
|   plus side this pickler is totally portable, and doesn't depend on the
|   internal representation the compiler chooses for a type.

Neat!  Where can I find more information about it?

I have some questions (which perhaps you or someone else can answer):

- I assume that code to load/unpickle such dumped objects must also be
provided.  Write-only data structures are not the most useful.

- Doesn't this fly in the fact of modularity?  In other words, if I
want to use a module (in the vague generic sense, not the ML specific
one) that someone has written, with internal "private" types, and I
also want to use the object dumper, must I not depend on the provider
of the module to have provided such code him/herself?  If s/he has not
provided such code, am I unable to use the dumper to dump objects that
contain the "opaque-to-me" internal data types of the module?

- Since ML does not have object identity for pairs, etc., is it doing
hash consing to prevent unfolding DAGs into trees?  Otherwise it will
make the dumped object (and presumably the re-loaded object) larger
than they would have been.

|
|   However, the best solution would be to *generate* the type-specific
|   code for the pickler automatically.  This is rather straight-forward
|   if you have types.

Interesting.  However, if this is done, aren't you violating the
opacity of your types?  The "violator" can merely dump the object,
muck around with the external representation, and reload it.

|
|   [Duh -- I did it again!  Somebody keep me away from this newsgroup,
|   please! :)]

Why?  I'm having fun, and I suspect that you are too.

