by Marcin =?UTF-8?Q?=E2=80=98Qrczak=E2=80=99?= Kowalczyk <qrczak@[EMAIL PROTECTED]
Dec 14, 2007 at 11:28 PM
Dnia 14-12-2007, Pt o godzinie 21:30 +0100, Joachim Durchholz pisze:
> The JVM isn't a good target for FPLs though. To eliminate tail calls you
> need to pack everything into a single function, but then functions are
> limited in size.
It can be done differently: manage the call stack manually, implement
a tail call as a regular call, and manage a counter of tail calls; when
the counter reaches some value, throw an exception to clean the stack
and restart the computation based on the manually managed stack.
This is of course horribly ugly, and slower than it needs to be.
http://docs.msdnaa.net/ark_new/Webfiles/WhitePapers/Babel01/bab12.pdf
..NET VM is theoretically better, as it provides tail call opcodes.
But only in theory, because in the Microsoft implementation tail calls
for x86 are horribly slow, much slower than regular calls.
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=98236
--
__("< Marcin Kowalczyk
\__/ qrczak@[EMAIL PROTECTED]
^^ http://qrnik.knm.org.pl/~qrczak/