[plt-scheme] Native code generation and immutable pairs

From: Greg Woodhouse (gregory.woodhouse at sbcglobal.net)
Date: Fri Mar 10 07:23:31 EST 2006

--- Jim Blandy <jimb at red-bean.com> wrote:
> (I'm probably being too terse here; I don't really believe that a
> language without mutable pairs is "unusable", or that C-competitive
> performance in every case is somehow requisite.  But in trying to
> think about where to take the language, I find it an unpleasant
> choice.)

I don't think you want to give up performance. I've just spent a week
with a product with Oracle, WebLogic and a web based application all
deployed on a single box. Even though I'm not interested in number
crunching per se, the performance issues were painful. I also wouldn't
want to write off "C-like" performance as unattainable, because if
people are going to use Scheme, they're going to need to be able to do
the same kinds of things they do other languages.

Having saId that, I'm just thinking out loud here: How hard is it to
detect pair mutation? Obviously, the presence of set-car! or set-cdr!
is a dead giveaway, but what else is there (assuming you have access,
say, to the source of append!)? Obviously, FFI intrtoduces a whole new
problem: There isn't much hope of detecting mutation in the compilation
phase there. Is it feasible to optimistically make pairs immutable and
fall back on mutable pairs if that assumption proves not to be a good one?

Gregory Woodhouse  <gregory.woodhouse at sbcglobal.net>

"It is foolish to answer a question that
you do not understand."
--G. Polya ("How to Solve It")

Posted on the users mailing list.