[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: in defense of types





> -----Original Message-----
> From: owner-ll1-discuss@ai.mit.edu
> [mailto:owner-ll1-discuss@ai.mit.edu]On Behalf Of Lauri Alanko
> Sent: Sunday, June 02, 2002 4:19 AM
> To: ll1-discuss@ai.mit.edu
> Subject: Re: in defense of types
> 
>> This would be a bit like saying (letrec ((l (cons 1 l))) l) in scheme.
> Ocaml, btw, has a fairly new extension, which allows just this, as long
> as the recursive expression is a constructor invocation:
> 
> # let rec l = 1 :: l in l;;
> - : int list =
> [1; 1; 1; 1; 1; 1; 1; ....
> 
> This is nice, but not very useful, since recursive data structures
> typically need more complicated initialization, and then you can't use
> the letrec structure and have to resort to mutable data.
> 

Bruce Duba and I experimented with this extension in the early 90s. 
We design and implemented a prototype and had an undergraduate (I think
Steve Weeks) scale it to all of Chez Scheme at the time. The experiment
showed that the slow-down was high and the usefulness limited. 

We wrote this up as a paper for the ML workshop (with a typed model
and implementation) but it was rejected (as un-MLish if I recall this
at the time. [Xavier and I recently communicated on this when I found
out that OCAML has this extension now.])

-- Matthias