You can’t do exactly this if you’re not in control of all code.
With this, if a third-party library interns a string whose content is “Foo” they get a Handle. If you also intern a string whose content is “Foo”, you get the same Handle back.
Having this in the standard product likely will make all code doing what you propose migrate to use unique.
Also, the implementation likely (I haven’t checked this implementation) will move any interned objects out of the memory range(s) inspected when doing garbage collection. That makes garbage collection do a bit less work.
> It hardly seems worthy having a library over such a specific use case.
Seems much better to have it in the stdlib like they do right now than having to import a third party dependency. Especially as such a low level package will probably be used by _other_ external packages you would be using.
It hardly seems worthy having a library over such a specific use case.