News for hackers. Stuff that matters.
Re:Bill Gates: “I never said '640K should be enough for anyb... by ken on Tuesday October 02, 2018 @11:40AM (#18122684)
NANboxing isn't the only strategy for type tagging. We've been using tagged pointers in 32-bit land for decades. I doubt the perf hit here is going to be significant.
Re:Bill Gates: “I never said '640K should be enough for anyb... by bzbarsky on Tuesday October 02, 2018 @03:02PM (#18124643)
The reason NaN-boxing is popular for JS is that the only numeric type in JS (per spec, though JITs can sometimes improve on this) is 64-bit IEEE float, and it sure is nice if your value format can represent those directly without requiring a separate heap allocation.

There are still things you could do, of course. For example, you could more or less NaN-box but rotate the bits so the tag is in the lowest bits instead of up in the exponent, then ensure all your pointers are sufficiently aligned. That would mean a perf hit on doubles to do the rotation to recover the double, but you might be right that this is not too bad in practice on modern hardware.