[r6rs-discuss] an essay on language design
R. Kent Dybvig
dyb at cs.indiana.edu
Wed Jul 11 20:01:56 EDT 2007
> 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
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.
More information about the r6rs-discuss