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

From: Sam TH (samth at ccs.neu.edu)
Date: Sun Feb 25 22:34:10 EST 2007

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.

> 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.

-- 
sam th
samth at ccs.neu.edu


Posted on the users mailing list.