2 ms·
Tagged unions look simple and useful, but not very compact. As someone who has dabbled in scripting language interpreters, it be would nice to see built-in supp
by skybrian 5y ago
Tagged unions look simple and useful, but not very compact. As someone who has dabbled in scripting language interpreters, it be would nice to see built-in support for something like NaN-boxing if you're doing a union between pointer types, smaller integer types, and doubles. But I suppose you could it yourself like in C.
- turminal 5y agoThe issue with representing them more compactly is that we'd have to make the rules much more complex and we'd also have to depart from the C abi, so while this is something we might look into in the future it's not very likely to happen.