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

From: Sam TH (samth at ccs.neu.edu)
Date: Mon Feb 26 08:49:22 EST 2007

On 2/26/07, Paulo J. Matos <pocm at soton.ac.uk> wrote:
> On 2/26/07, Sam TH <samth at ccs.neu.edu> wrote:
> > 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?

The only residue of the types are literal constants and syntax
properties.  My understanding of the MzScheme compiler is that these
are removed before runtime, so there should be no change in runtime
behavior for a Typed Scheme program.

A program that uses Typed Scheme as part of a larger project, using
the ability of Typed Scheme to interoperate with other PLT Scheme
code, will incur the runtime overhead of contracts at the boundary
between typed and untyped code.

sam th
samth at ccs.neu.edu

Posted on the users mailing list.