privat/nit — pull request #546 by R4PaSs (2014-07-03 19:08:06+00:00)
Title: Utf8 strings

This is more a discussion than a real PR. Yet, it can be integrated should anyone need UTF-8 in the near future.

This is what Strings might look like in Nit in the future, we'll need a internatonal encoding if we want to conquer the world.

There is still some major caveats to that implementation that will need to be discussed :
- `Char` : What to do with Char ? Do they stay as they are now, wrappers to C-Chars ? Or do they become an Interface, `C-Chars` will be `Bytes` instead and `NitChars` will be `UTF-8 chars`, composed of 1-4 bytes. As Char is quite primitive, I suspect this transition will cause a lot of blood to flow.
- String literals : For now, `FlatStrings` are simple `CStrings`, therefore they can be computed and stored as-is in generated C code, costing nothing at runtime to create. The same cannot be said for UTF-8 strings, since we need higher-level objects to use them efficiently. If someone has an idea of how to effectively compute them ahead of time, that would be great.
- What do we do with CStrings ? Do we remove them ? Or do we follow the example of Python or Haskell to propose both Plain-ASCII Strings (`bytestring` in both languages I think) and Unicode Strings ? I'm not especially in favor of this one because of the confusion it may induce.

Anyhow here's the first draft, tell me what you think of it.

Signed-off-by: Lucas Bajolet