The problem with using symbols is that they are annoying to debug or display, since they're just integers pointing to magical strings.
With this change, we can use a new SymbolTable::the() method to grab a singleton instance of a SymbolTable using some "unsafe" Rust. This will allow us to impl Debug and Display for the new struct based Symbol and provide more accurate output.
Performance wise, I can't see any negative impacts from this change. If anything, my rudimentary benchmarks are ~2% faster.
I'm not saying that this new singleton API is the absolute best way to go, but it definitely helps out in a lot of cases such as testing, debugging and displaying symbols.
The problem with using symbols is that they are annoying to debug or display, since they're just integers pointing to magical strings.
With this change, we can use a new SymbolTable::the() method to grab a singleton instance of a SymbolTable using some "unsafe" Rust. This will allow us to impl Debug and Display for the new struct based Symbol and provide more accurate output.
Performance wise, I can't see any negative impacts from this change. If anything, my rudimentary benchmarks are ~2% faster.
I'm not saying that this new singleton API is the absolute best way to go, but it definitely helps out in a lot of cases such as testing, debugging and displaying symbols.