[racket] R5.3 and #lang web-server compilation

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Mon Aug 20 12:52:18 EDT 2012

The free variables of an expression e are those that occur in e
but have no binding in e. In a language such as Racket, a binding
is established via define and lambda [*]. So in 

 (lambda (x)
   (define y 2)
   (+ x y z))

you have one free variable: z. In 

 (lambda (x) 
   ((lambda (x) (+ x 1))
    (* x 10)))

you have x both as a free and a bound variable. The occurrence in 
line 3 is free and the ones in line 2 are binding and bound. 

A compiler must know the free variables of an expression because 
without the value of a free variable it cannot create code that 
determines the value of an expression. As you determine the free
variables in a compiler, you also compute a piece of code that 
knows how to retrieve a value. 

-- Matthias

On Aug 20, 2012, at 12:40 PM, Hendrik Boom wrote:

> On Sun, Aug 19, 2012 at 08:14:06AM -0600, Matthew Flatt wrote:
>> At Sat, 18 Aug 2012 17:29:05 -0400 (EDT), Galler wrote:
>>> Under 5.3, there's been a near order-of-magnitude improvement in 
>>> compilation time for the web-server language.
>>> [...]
>>> Could I ask what has changed?
>> I'm not certain, but it might have been the change in free-variable
>> calculation from a quadratic-time algorithm to a linear-time one (which
>> is commit 6fded4bac1 along with ee93e35260 in the git repo).
> I know what free variable are.  I don't know the specifics of what 'free 
> variable calculation' is.  Testing whether a partiular variable is free?  
> Determining the set  of free variables?
> And what, roughly speaking are these linear and quadratic-time 
> algorithms?
> -- hendrik
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4373 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20120820/ed06782e/attachment.p7s>

Posted on the users mailing list.