[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: A plea for a new old language



At 7:17 PM -0400 5/14/03, Eric Kidd wrote:
>On Fri, 2003-05-09 at 10:54, Dan Sugalski wrote:
>>  The worries are different. The stuff Larry's rolling in is almost
>>  entirely optional--if you don't care about curried functions,
>>  multimethod dispatch, funky regex syntax, and suchlike things you can
>>  ignore it all. Requiring CPS for control transfer at the VM level
>>  makes it kinda hard for folks targeting the VM to avoid it, as not
>>  actually doing any control transfer sort of limits your options. :)
>
>I think continuations are actually *easier* to understand at the
>assembly/bytecode level than they are at the language level (assuming
>Scheme semantics).  Anybody who can handle a moderately complicated
>calling convention can probably handle "oh, functions take the return
>'address' as separate argument, and you can pass it around before
>calling it--and the runtime does the Right Thing<tm> with recursive
>functions".  This is much easier than understanding tail-call
>optimization with varargs, for example.

Yeah, that's what I've found so far. Either it makes sense, or folks 
are willing to take it on faith that it works out.

>CPS conversion is a pretty popular topic in good compiler texts, too,
>and anybody who's directly targeting a VM probably knows *something*
>about compiling.

FWIW, a quick scan of the indices of the compiler texts I have handy 
shows a remarkable lack of notice of continuations at all, (Only in 
two, and one of those deals with them very tangentally) and no notice 
of CPS. Dunno whether this is an inditement of the state of my 
personal library, or the state of index generation in books today. 
The index entry for continuations in SICP 2e is pretty poor, and I do 
personally have a bias towards non-continuation languages, so it may 
well be both.

>How much time does it take to explain typical control-flow constructs
>and calling conventions using CPS?  I guess this is the important
>question.

Basically none, so we're fine there.

>(who's not particularly enthused about the way call/cc interacts with
>dynamic-wind in Scheme)

I'm not sure what dynamic wind is, but I'm finding that mixing 
continuations with scope exit actions leads to much pain and headache.
-- 
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                       teddy bears get drunk