From: David Kastrup Date: 2006-11-19T20:05:05+09:00 Subject: Re: Ruby vs Java vs c++ "M. Edward (Ed) Borasky" writes: > David Kastrup wrote: >> "Martin DeMello" writes: >> >> >>> On 11/19/06, El Gato wrote: >>> >>>> However, it seems to me that you're looking for the expressiveness of >>>> Ruby and the speed of C++. Welcome to the club. Strangely enough, >>>> >>> I'm learning OCaml for just that reason :) Some of the Scheme >>> dialects get some impressive performance figures too, but I haven't >>> really looked into them as much. >> >> I have looked through several compilers. I have to say that one of >> the most appealing Scheme->C compiler ideas I have seen was to drop >> the distinction between heap and compiler stack: functions were called >> with an appropriate continuation data structure, and no function ever >> properly returned at the C level. Data was allocated using alloca. >> >> When the heap/stack combination overflowed, it was >> garbage-compacted in its entirety. All continuations without a >> pending reference to them consequently were removed from the stack. >> >> This basically made continuations rather easy to implement. >> Impressive. Chicken > I haven't dug into Scheme implementation benchmark shootouts > recently, but for now, my money is on Gambit, mostly because of the > "Termite" package implementation of Erlang-like lightweight > processes. Well, it would be my guess that in typical applications continuations are more important, and it looks from as though they are implemented in a manner that basically incurs O(n^2) copying overhead where the n is the number of call-with-continuation calls not yet garbage-collected. I find Chicken's approach to continuations more appealing, but of course performance hinges on more than just that detail. Stalin is also said to be a good Scheme compiler. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum