[plt-scheme] R6RS Interoperability

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Jun 27 09:26:32 EDT 2008

On Jun 27, 2008, at 2:35 AM, Mark Engelberg wrote:

> Since performance is a key goal of gradual typing,

Who says?

;; ---

In case people are interested, I can try to compile a rather  
extensive literature list on compiling w/ or w/o types for languages  
such as ML and friends. Just as a teaser; until 12 years ago (or so),  
compilers for polymorphic languages just stripped types away once  
they were done and used Scheme-like back-ends. Leroy started type- 
directed compilation closely followed by others (CMU etc). But a few  
years later, Leroy gave a rather skeptical talk at Types-in- 
Compilation, questioning whether much of it was worth the effort.

Why is this the case? Imagine a function like that:

	(Lambda ([t : Type]) (lambda ([x : t]) x))

What do you know about the arguments that flow into x? Until you know  
t, you know nothing. So how do you compile this? Perhaps you put the  
actual value into a pointer and just uniformly accept pointers. Easy  
compilation, easy run-time system. So then people tried to see  
whether the bug Lambda could be instantiated (cloned) so you have  
better memory usage and access in the little lambda. And I think  
we're stuck right there.

Stalin is a whole-program compiler, not an incremental compiler, not  
a JIT compiler, and not a modular compiler. Unless your whole program  
analyses run in linear time, compiling 300,000 lines of code just  
isn't realistic. For higher-order functions, reasonable analyses  
aren't linear.

This is not a small field, and this is not something where you can  
expect huge progress over the next year or so. Lots of people have  
tried and lots of man-years are in related projects.

At this moment, Typed Scheme imposes a small run-time overhead (due  
to the contracts between typed and untyped modules) and that's that.

-- Matthias

Posted on the users mailing list.