EDIT: Please note that now, an empty string will allocate one byte on the heap for the null terminator. This will degrade the performance of some programs, the tradeoff is more safety. This performance penalty will go away with SSO, as the null terminator will be on the stack, which I hope can be implemented soon-ish when https://github.com/modularml/mojo/issues/2637 is fixed
Related to https://github.com/modularml/mojo/issues/2687
Fix https://github.com/modularml/mojo/issues/2392
Also related to https://github.com/modularml/mojo/issues/2678
Description of the problem:
EDIT: Please note that now, an empty string will allocate one byte on the heap for the null terminator. This will degrade the performance of some programs, the tradeoff is more safety. This performance penalty will go away with SSO, as the null terminator will be on the stack, which I hope can be implemented soon-ish when https://github.com/modularml/mojo/issues/2637 is fixed