Thanks @jaysoifer! I also wrote some blog posts covering some of the talk topics in a little more depth:
- Elixir and Unicode, Part 1: Unicode and UTF-8 Explained
- Elixir and Unicode, Part 2: Working with Unicode Strings
- Elixir and IO Lists, Part 1: Building Output Efficiently
- Elixir and IO Lists, Part 2: IO Lists in Phoenix
@kostonstyle The way I phrased this distinction was:
In Elixir, a “bitstring” is anything between << and >> markers, and it contains a contiguous series of bits in memory. If there happen to be 8 of those bits, or 16, or any other number divisible by 8, we call that bitstring a “binary” - a series of bytes. And if those bytes are valid UTF-8, we call that binary a “string”.
So a subset of bitstrings are binaries, and a subset of binaries are strings. Like this:
If you don’t understand what it means for something to be “UTF-8 encoded”, the first blog post should help.