Re:Texas Instruments on Scheme (1984)
by ruricolist on Thursday June 01, 2017 @08:29PM
(#14466402)
I don't think the author was talking about the general case of continuations -- he was talking about the general case of unwind-protect in the presence of continuations -- what Schemers nowadays call dynamic-wind.
Re:Texas Instruments on Scheme (1984)
by Johnny_Brahms on Friday June 02, 2017 @02:21AM
(#14467886)
Some schemes now have delimited continuations [1], and with Dybvig behind the wheel of Chez scheme I wouldn't be surprised if they show up there as well.
It is a superior construct in every way. The performance and memory usage, even for the simplest usage, is way better, and because they are delimited they are easier to reason about.
1: guile, scheme48, racket's scheme lang (using rackets native delimited continuations together with their r6rs Lang)
Re:Texas Instruments on Scheme (1984)
by MycroftJones on Friday June 02, 2017 @03:23AM
(#14468114)
Thanks for the reference, I'll look into that. How does the performance and memory usage of deliminted continuations compare to implementing the control flow constructs directly?
Re:Texas Instruments on Scheme (1984)
by Johnny_Brahms on Saturday June 03, 2017 @02:14PM
(#14477624)
Which are you comparing to? They are quite specialised, and are probably expensive as far as control operators go, but delimited continuations beat undelimited continuations every day of the week.
I remember benchmarking the coroutine generator from srfi-125 (??), and already for the simplest case the delimited continuations in guile (compared to the undelimited ones in the reference implementation) were about 3x faster.
The TI comments about lexical and dynamic scoping are also interesting; makes me appreciate how newLisp dealt with it. Although newLisp is officially "dynamically" scoped, I recently realized that Lutz snuck Lexical scoping in there; the dynamic scoping is actually limited by the lexical scope. And by Lexical scope, I'm not talking about the context/module system, although that is a part of it. I mean real lexical scope.
If not for continuations, I wonder if Scheme would have taken off more than it has. Also it was interesting seeing that T and NIL hadn't become #true and #false yet.