News for hackers. Stuff that matters.
Re:Smuggling Data in Pointers by regularfry on Monday November 14, 2011 @03:26AM (#3233327)
This is precisely how Ruby's object ids work. An object id is an 8-bit aligned pointer to the object's location in memory. The low 3 bits are used to identify booleans, fixnums, nil and symbols.

I'm sure this was borrowed from a lisp implementation.

Re:Smuggling Data in Pointers by arethuza on Monday November 14, 2011 @04:55AM (#3233491)
Lisp machines typically had direct hardware support for these tags - Symbolics machines used 36 bit words, 32 bits of data and 4 bits of tags:

http://en.wikipedia.org/wiki/Symbolics

Re:Smuggling Data in Pointers by dfox on Monday November 14, 2011 @07:18AM (#3233718)
Also, SPARC has direct hardware support for this (for the cases that are relevant for JITed code, ie. arithmetics). But sadly, on current implementations it is often somehow emulated and thus slow.
Re:Smuggling Data in Pointers by rayiner on Monday November 14, 2011 @11:44AM (#3234624)
It's because there isn't much point. Most Lisps use a tagging scheme like:

00 = Integer 01 = Pointer

With 00 as the integer tag, integer addition and subtraction can be done directly without masking off the tags. Multiplication and division need the tags masked, but are slow anyway. The tag can also be stripped off for free on any architecture that offers BASE + OFFSET addressing (just subtract 1 from the desired constant offset).

Re:Smuggling Data in Pointers by _delirium on Monday November 14, 2011 @07:34AM (#3233746)
Apparently inspired by Lisp as well; this old '91 Usenet post by a Lucid employee claims that SPARC added the tagged-arithmetic support specifically for Lucid Common Lisp: http://compilers.iecc.com/comparch/article/91-04-082