[racket] a small programming exercise

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Thu Oct 14 12:40:38 EDT 2010

On Thu, Oct 14, 2010 at 12:18 PM, Shriram Krishnamurthi <sk at cs.brown.edu> wrote:
> It would seem TR should not take much longer than regular Run.

There are a lot of things that make TR much slower than regular compilation.

1. `local-expand' makes everything slower.
2. TR necessarily involves multiple passes over the entire module.
3. TR requires loading 10s of thousands of lines of code that aren't
loaded for just `racket/base'.
4. Those lines of code do significant computation just to set up the
environments, for example (try timing typed-scheme/private/base-env).
5. TR maintains a lot of data, both for improved error reporting and
optimization as well as for typechecking.
6. TR involves complex algorithms (such as subtyping on polymorphic
recursive types).

Plus everything that happens in regular compilation happens too - no
time is saved, even by doing `local-expand'.
sam th
samth at ccs.neu.edu

Posted on the users mailing list.