---
# System prepended metadata

title: Char type and/or improved handling

---

# Char type and/or improved handling

Things we can already do:

- Iterate code points or other code units
- Split a string into a list of strings of one code point each
- Merge lists of strings
- Awkwardly get a code point value as an int: `"a".codePoints.read()`

Things that we don't provide:

- Merging a list of code units back into a string
- Simple char literals
- Any char/code/rune type
- Code can say "if the *native character representation* is *x* do this else do that"

One example of trouble:

- Shaw finds that it's easier and/or runs faster to split strings into a list single-code-point strings than to use the string iterators, but this potentially creates lots of individually managed objects on some backends

## Proposals

### No special type

Minimum effort proposal:

- Let `'a'` be an int literal
- Provide builtin support to join a list of ints representing codes into a string
  - Also or alternatively, some way to feed code points from any source into a string builder

Maybe also:

- Maybe some efficient way to get a list of code points rather than an iterator if building from an iterator is inefficient and if lists are better sometimes

### Some char type

Would it help clarify things???

### Fancier things?

What else might be good?
