[r6rs-discuss] an essay on language design

From: R. Kent Dybvig <dyb>
Date: Wed, 11 Jul 2007 20:01:56 -0400

> If you don't like the restriction, then remove it.

By piling yet another feature on?

> The procedural layer already provides accessors and mutators
> that are analogous in complexity and efficiency to vector-ref
> and vector-set! with offsets determined at closure creation
> time. As Mike and I were discussing, the difference between
> an offset determined at closure creation time and a constant
> offset is at most one load instruction. There will seldom be
> any difference at all, since implementations can special-case
> small offsets.

You ignore the additional cost involved in calling the record predicate to
enforce safety, which is again at least one additional memory reference
(and possibly more, depending on the representation of the hierarchy).
This reference can't be special cased. You also ignore additional costs
in complexity and/or efficiency in the allocation of records via the
record constructor.

Simple inlining can eliminate the closure creation and procedure calling
costs you say overwhelm these indirects. Even some interpreters already
perform such inlining and will not have to be extended to handle the
syntactic layer well, when the parent-rtd clause isn't used.

> True statements about the efficiency of the procedural layer
> would have a reassuring effect.

Agreed. The statements in R5.97RS do go overboard, but not as far as you
would have us believe.

Kent
Received on Wed Jul 11 2007 - 20:01:56 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC