A few questions about strings.
In .NET strings are UTF16 internally probably because of Windows historical reasons. You can output as UTF8 or whatever of course. They are also immutable for thread safety reasons and though they have value semantics they are heap objects and can be null. Strings have a char indexer and can be converted to a char[] and back, though in recent times that is usually done via [ReadOnly]Span, which gives you safe copy semantics, etc.
In Objo they are advertised as UTF8 but I am suspicious they are backed by .NET strings and so are UTF16 internally and just output as UTF8. So that means on average 2 bytes per char, even for the ASCII domain, in terms of memory consumption. This isn’t fatal of course, I live professionally in the C# world and am used to it.
I don’t know what REALstrings are and probably don’t want to know, lol.
But my paying work involves LOTS of detailed string manipulation on hot paths and I’ve evolved a whole ecosystem around making that as performant as possible. So to my specific questions:
Are Buoy strings in memory, internally, literally UTF8, that is, code points < 128 take exactly one byte in memory
Are they immutable
Do you or will you expose a char type and what relationship exactly will that have to Buoy strings. Can you at least read the char in position 7 of a string in some form other than another string instance of length 1?
What support do you or will you have for operating in the char or code point domain in preference to the allocation pressure of [sub]string concatenation, etc. when the extra effort makes sense because of hot paths? In other words would you have something like the .NET StringBuilder or some other form of mutable string manipulation. So if you want to convert a string to some char-oriented representation, then say trim it, upper case it, append some other string to it, then convert it back to an immutable string, can that be done at this time? Even if I have to roll it myself?
IIRC Buoy objects, including strings, are reference counted. I am less familiar with the performance implications of allocating a lot of strings in a reference counted vs garbage collected environment, aside from memory consumption. The garbage collector isn’t there to overwhelm, but you still need some kind of circular reference detector process I would assume and still have to deal with memory fragmentation issues. Would you regard my concerns as less relevant in a reference counting system? More? The same?
Thanks