[plt-scheme] Re: Porting DrScheme/MzScheme to Adobe Flex

From: David Van Horn (dvanhorn at ccs.neu.edu)
Date: Mon Oct 13 10:34:20 EDT 2008

kbohdan at mail.ru wrote:
> Thanks. Writing games is the most exciting way to activate student brains.
> Aren't you going to write real scheme compiler ? At least with call/cc.
> Some time ago I've tried to implement r5rs->javascript compiler, but
> lack of theory knowledges forced me to pause project and start studying 
> some theory.
>  AFAIK "call/cc" is incredibly useful for asynchronous communication 
> with web server via XMLHTTPRequest, so i decided not to ignore it in my 
> compiler.
> Will appreciate if you can give me any hints here.

There are standard textbook treatments of how to implement first-class 
control operators (PLAI, EOPL, etc).  Try writing a slimmed-down Scheme 
to Scheme compiler that emits code in CPS.  Adding call/cc will be a 
one-liner added to the initial environment.  And from there you can grow 
the compiler into an R5RS to JavaScript compiler in a straightforward 
and incremental way.


Posted on the users mailing list.