[plt-dev] overriding constructor style printing
On Fri, Mar 6, 2009 at 2:24 AM, Matthias Felleisen <matthias at ccs.neu.edu> wrote:
> On Mar 3, 2009, at 5:17 PM, Felix Klock's PLT scheme proxy wrote:
>
>> In general, the designer of an abstract data type wants to only provide
>> an abstract view of that type.
>
>
> Late to the game and it's a philosophical answer, too.
>
> Over years of Scheme programming I came to the conclusion that this desire
> is ideologically misguided for a language without types.
>
> Types -- in Reynolds's words -- are enforcing syntactic barriers of
> abstraction. In a world of types, it is therefore natural to wish to present
> an _abstract type_ as something the client side cannot see. (How about the
> server side, btw?) Because the barrier is only syntactic, a concrete view of
> the elements of an abstract type would actually allow us to fake them at
> run-time. (Example: abstype t = ... : if I print these things concretely as
> 1 2 3 I can use a 1 or a 2 as t and float it from a (badly typed part of the
> system) into the abstype region and possibly destroy invariants.)
>
> Untyped languages don't support abstract types. They support dynamic
> protection of invariants (see Robby and Wadler's and Jacob's paper).
I think Matthias means Jacob & Amal's paper (altho we are continuing
to work on this area):
http://ttic.uchicago.edu/~amal/papers/parpolyseal.pdf
Even if you're not interested in the technical details, the intro is
worth a read.
Robby