Live data from Hacker News

Float Self-Tagging

arxiv.org

51–52 of 52 posts

Re: Float Self-Tagging

#51
In TXR Lisp, on 64 bit targets, NaN boxing is used. Specifically, that variant whereby pointers represent themselves and a delta operation is needed to recover double precision float values. Is that the same as "NuN tagging"?

I like the "tagging" terminology better than "boxing". "NaN Boxing" specifically enables unboxed floats, so the name is stupid. Everyone seems to be using it though.

Re: Float Self-Tagging

#52

I imagine that in a "heavy numerical" part of the code one would ideally use identity-tagged floats, i.e., with no rotation applied. Instead, the (few) pointers that are used in this part would be stored in rotated state. But thinking about how to mesh this scheme together with other, "normal" (that is, pointer-heavy) part of the code makes me slightly nauseous.

> But thinking about how to mesh this scheme together with other, "normal" (that is, pointer-heavy) part of the code makes me slightly nauseous.

Haskell already solved this with kinds. Unboxed values are of kind # rather than the usual kind * of all other values, and you can lift a # to a * via the usual boxing operation.

https://wiki.haskell.org/Unboxed_type

Post reply on HN