Just to add while I discussed  i18n lib support on mutable arrays ,its
worth stating that  nearly all calls will use string just a few lower libs
or optimised code would use these arrays. So it important the standard lib
uses string everywhere.

I think Java and C# have strings pretty correct and have methods to convert
to and from mutable arrays, i hear few complaints.  The main issues i'm
aware of are
1)  USC-2 /UTF-16 support as that was being implemented at the time require
too much copying.
2)  Char arrays work on USC-2 / UTF-16  which as discussed allows code
point indexes which works only in some  ( but common ) languages.
3)  Poor  IO performance but how much of this is 1) and how  much is GC (
eg card table) , array bounds checking  or lack of mutable values is hard
to determine.  The fact that even mutable char arrays perform poorly on IO
in these languages suggests its the first 3 though obviously immutable
string copying if required will hurt performance worse.

The good things worth noting is
- Since the standard lib is littered with strings , and the lib makes
strings easy ,  people predominantly use them . C++ and rust IMHO for
example fail with this . The standard lib will determine the success of
string or whether people resort to lots of array processing and  char[]
params for libs as the common case rather than the occasional optimization.
- Optimization in the GC for strings (Immutable with no sub objects so does
not need to be marked and the creation directly calls the allocator)


Regards,

Ben
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to