3 ms·
All Ruby code does this. Mathematics can still be performant because of tagged pointers. If the MSB is set, the value is a Ruby object. If it's not set, the val
by stouset 14y ago
All Ruby code does this. Mathematics can still be performant because of tagged pointers. If the MSB is set, the value is a Ruby object. If it's not set, the value should be considered a native data type.
- vinkelhake 14y agoPerhaps I should have been more specific. I know that there are languages that have this property. My question is if there are studies on the performance impact. Preferably in a language that is suitable for high-performance applications (like games).
- mcherm 14y agoThe python example is good here, because originally the Python language had separate types for unbounded-integer and machine-sized-int. This happened as part of the move from Python 2.x to Python 3.x, right along with changing strings from byte-arrays to unicode.[1] There has been lots of fuss and even pushback about the change to use unicode instead of byte arrays, but I have never heard anyone complain about semantics OR performance of the switch to a single integer type. [1] - http://www.python.org/dev/peps/pep-0237/ http://www.python.org/dev/peps/pep-0237/