Subject: Re: why are tags and data packed together?
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 1999/11/16
Newsgroups: comp.lang.lisp
Message-ID: <80qlgv$r0t9@fido.engr.sgi.com>
Harley Davis <nospam_hdavis@nospam.museprime.com> wrote:
+---------------
| <david_morse@my-deja.com> wrote"
| > Why do modern lisp compiler implementations tend to pack data and tag
| > into a single 32 bit value?
| 
| John Rose's Scheme implementation "esh" actually did this by passing an
| extra type arg with all arguments passed around and stored.
+---------------

"Elk", as distributed[*],  does this, too.

David, you've gotten lots of good answers, but if you *really* want a
heavy dose of this stuff, be sure to read:

  Gudeman. "Representing Type Information in Dynamically Typed Languages"
  <URL:ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/pubs/typeinfo.ps.gz>

It goes into a large number of variations on how to "wrap" native machine
values into dynamically-typed values and vice-versa, including low-level
efficiency tradeoffs between them. E.g., Gudeman refers to the "esh"/"Elk"
method as "double wrappers", whereas SCM, for example, uses "multi-stage
tagging".


-Rob

[*] Just for fun (and as a basis for another project), I hacked up Elk-3.0
to *not* use double wrappers, but a more classic tagged-pointer scheme.
Didn't seem to affect runtime much, though it *definitely* lowered memory
consumption. Changes to garbage collection seemed to have much more impact...

-----
Rob Warnock, 8L-846		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		FAX: 650-933-0511
Mountain View, CA  94043	PP-ASEL-IA