[plt-scheme] Compiler optimizes Typed Scheme?!?

From: Paulo J. Matos (pocm at soton.ac.uk)
Date: Mon Feb 26 07:07:23 EST 2007

On 2/26/07, Sam TH <samth at ccs.neu.edu> wrote:
> On 2/25/07, Paulo J. Matos <pocm at soton.ac.uk> wrote:
> > Hello all,
> >
> > I've read about typed scheme which was recently (December) first
> > released. I'm curious about if the compiler is able to do any
> > optimizations given the type of the variables or if they are just run
> > time 'assertions' on the variables types.
> Typed Scheme is implemented using the MzScheme module/syntax system.
> Therefore, it performs static, ahead-of-time checks, not runtime
> assertions.  However, currently all types are macro-expanded away
> before compilation.

I'm not sure if 'all types are macro-expanded away before compilation'
implies that there is no runtime performance penalty. Is there?

> > If the compiler doesn't yet optimize the code given the variable
> > types, is PLT thinking about implementing this? I guess it would be
> > possible to gain something if one would just type every variable in a
> > program.
> The problem of using the knowledge that macros have about the code
> they generate to improve optimization is a general and long-standing
> one.  There isn't currently a mechanism in MzScheme to support the
> kinds of optimizations Typed Scheme might enable.  But it is
> definitely a potential area for future research.

That would certaintly be a great addition to MzScheme. :)

Thanks for the explanation.


Paulo Matos

> --
> sam th
> samth at ccs.neu.edu

Paulo Jorge Matos - pocm at soton.ac.uk
PhD Student @ ECS
University of Southampton, UK

Posted on the users mailing list.