On Jun 27, 2007, at 8:35 AM, Marc Feeley wrote:
On 25-Jun-07, at 4:27 PM, naruto canada wrote:
Does gambit-c have call/ec? Thanks.
Call/ec is not predefined. You can define it yourself like this:
(define call/ec call/cc)
Obviously, in this case the implementation of call/ec is not as fast as it could be. On the other hand, Gambit's implementation of continuations is one of the most efficient. For example, on the ctak benchmark which uses call/cc extensively, Gambit is about 2 orders of magnitude faster than MzScheme. It would be interesting to see how MzScheme fairs when call/cc is replaced by call/ec in that benchmark (I can't run the test because my usual work machine is out of order). See http://www.iro.umontreal.ca/~gambit/bench.html for other benchmark results (fibc also uses continuations extensively).
On a 1.66GHz Intel Core Duo Mac Mini, I just tried ctak and fibc on MzScheme v370 with call/cc and call/ec and I get these relative execution times:
Gambit MzScheme MzScheme call/cc call/cc call/ec ctak 1.0 113.6 7.1 fibc 1.0 56.1 5.5
So call/ec improves the MzScheme execution times by an order of magnitude. The resulting performance is still quite far from using plain call/cc with Gambit-C.
Marc