[Grace-core] Strings

Andrew P Black andrew.p.black at gmail.com
Tue Jan 27 13:38:57 PST 2015


Lex, 

There is a longer discussion of strings on the Grace language design Wiki, at 

https://projects.cecs.pdx.edu:8443/~black/NewOOL/index.cgi/wiki/WhatAreStrings

where you can contribute, if you wish.  But I see that you don't have a Wiki login ...  if you want one, send me (black at cs.pdx.edu) the output of 
	
	htpasswd -d -n <username>

and I'll make one.  (This also applies to anyone else who is reading here!)


On 27 Jan 2015, at 09:33 , Lex Spoon <lex at lexspoon.org> wrote:

> Nice thoughts, Michael.
> 
> In general, it's extremely useful to programmers to have a data structure holding a finite sequence of Unicode code points. That data structure is conventionally called a string. There are certainly also other text-related data structures that are useful to implement and provide.
> 
> For a PL that will compile to Java or JavaScript, it's probably best to match their string type. Otherwise it will be necessary to convert between the two types all over the place. It's hard to imagine a string library that is so much better that it's worth the complexity of wrappers and conversions that crop up when juggling two kinds of strings.
> 
> Go does not have that constraint, and they went with narrow, byte-based strings. That strikes me as a good choice. Java, JavaScript, and the Microsoft foundation libraries all use wide strings, but it hasn't worked out very well in practice.
> 
> I expect programmers will be happy using code points as the default level of abstraction. Whether you need to look at grapheme clusters depends on the problem, and you can always do that explicitly when you need to.
> 
> Lex 
> 
> 
> _______________________________________________
> Grace-core mailing list
> Grace-core at cecs.pdx.edu
> https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core




More information about the Grace-core mailing list