[racket-dev] Typed versions of untyped collections

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Dec 17 14:42:07 EST 2012

20 minutes ago, Sam Tobin-Hochstadt wrote:
> On Mon, Dec 17, 2012 at 12:59 AM, Neil Toronto <neil.toronto at gmail.com> wrote:
> >
> > On 12/16/2012 06:41 PM, Eli Barzilay wrote:
> >>
> >> 10 minutes ago, Neil Toronto wrote:
> >>>
> >>> I think I'd rather have a convention in Typed Racket that (require foo)
> >>> imports `foo/typed' when it exists.
> >>
> >>
> >> +14.  I think it came up in the past, but I don't know why it wasn't
> >> done...
> 
> It hasn't been done because I don't think it's a good idea.

(Ah, that sounds familiar...)


> There are a couple reasons for this. First, I really don't want to
> add a search path to the module resolution algorithm.  Second,
> there's no actual good way to tell if a module is typed,
> esp. without loading the module first.

There's no need for that if you grab the "*/typed.rkt" namespace, or
with submodules (I'm guessing).


> That's in addition to the costs Matthias mentions.

I think that the costs that he talked about were the T->TR contracts,
which are there anyway if people use the same code for both.

BTW, a similar alternative would be a TR language that arranges for
the same code to be put in a typed and an untyped submodules, so you
can use both variants.  It should work well given TR's goal of being
as compatible with R as possible.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the dev mailing list.