[PRL] [plt-internal] Video of Clojure talk

Matthias Felleisen matthias at ccs.neu.edu
Fri Oct 3 08:45:29 EDT 2008



On Oct 2, 2008, at 7:29 PM, Joe Marshall wrote:

>             object evarg;
>             Control unev = this.rand;
>             Environment env = environment;
>             while (unev.EvalStep (out evarg, ref unev, ref env)) { };
>             if (evarg == Interpreter.UnwindStack) {
>                 ((UnwinderState) env).AddFrame (new Combination1Frame0
> (this, environment));
>                 answer = Interpreter.UnwindStack;
>                 environment = env;
>                 return false;
>             }


I feel like a total fool when I read this:

  -- I should have known:
     it's an old trick; Joe Warren "invented" it for Fortran as a  
junior working for Kennedy
     I use it in a hyper-general way for my "extensible denotational  
semantics" talk/paper in Sendai
     numerous other people have used it

  -- You could use this trick, btw, to implement a whole slew of  
features that aren't already available

  -- the idea of using by-reference results is something I wouldn't  
have thought of, mostly because my cost model is wrong
     (I tend to think of assignments as expensive constructs in OO  
and FP languages)

So congratulations, you made an academic idea quite practical if you  
get such performance improvements.

;; ---

We couldn't have possibly argued for TCO in our ICFP paper because we  
admitted the cost of setting exceptions and people know what it  
costs. They would have thought we're crazy to trade a little bit of  
space for so much time. (I know I know but that's how people think.)

Using the word "continuation" was the only way to get the paper out.

;; ---

Joe, you should write this up as part 2 of the paper.


> (A side note.  In order pass back the unwinder state that used to  
> be in the
> exception, I pass it back in the `Environment'.  It isn't an
> environment, though.
> How do I get this pass the type checker?  It's a bald-faced lie.  I  
> derive the
> unwinder from the Environment class, override every method to throw  
> an error,
> and add the methods to support unwinding.  So much for type safety  
> and static
> type checking.)


This is so so cute. Again, Dan demonstrated something like this in  
his early thinking about OO: Take a class Apple. Derive Orange.  
Override all methods to become organy methods.

Yes, type safety is a weak idea to start with (it's uniform for all  
programs in a programming language, what can you expect) but in OO it  
is nearly meaningless.

-- Matthias








More information about the PRL mailing list