|
From: | Sunnan |
Subject: | Re: [Chicken-users] Chicken and Gambit |
Date: | Tue, 15 Mar 2005 14:58:38 +0100 |
User-agent: | Mozilla Thunderbird 1.0 (X11/20050111) |
Tony Garnock-Jones wrote:
You're right in that current compilers don't optimise as much as they could. But it doesn't have to be that way: if you're writing C-style Scheme code, it's possible to compile that to C that runs as fast as handwritten C. I don't know of a compiler that actually does this (Stalin?), but it's certainly possible :-) And on the other hand, if you're writing functional code, there are a whole bunch of optimizations that can end up outperforming equivalent hand-written C, even though C is the intermediate language being used by the Scheme compiler. For instance, the compiler can do a lot of the drudge-work of inlining and specialization before the C code is emitted, which is much harder to arrange at the C level. And an often-overlooked item is memory management: using garbage-collection is usually faster than using malloc/free for allocation-heavy programs.
Thank you very much for these comforting words.Another, perhaps related question: how about the overhead for function calls that C has? Is there a way around that, maybe compile to code that uses goto and weird stuff like that? (I'm afraid I'm coming of as even more ignorant that I really am, but I'm curious.)
[Prev in Thread] | Current Thread | [Next in Thread] |