5 ms·
> Erlang fares well here because it stores each character as a 32-bit integer in a list Which is silly because if you make a list of 32 bit integers that have
by naz 17y ago
> Erlang fares well here because it stores each character as a 32-bit integer in a list
Which is silly because if you make a list of 32 bit integers that have ASCII equivalents then Erlang assumes it is a string.
- tlack 17y agoYeah, but still: it lets you operate on unicode "characters" pretty easily. With a ton of associated downsides (unclear string/list of integers dichotomy, wasted memory for ascii, etc)
- silentbicycle 17y agoThe main difference is the way it's displayed by default in the shell. Strings are handled with list operations, and Erlang is great for list operations.
- anonjon 17y agoErlang doesn't make any assumptions about what it is. To Erlang, it is a list of 32 bit integers. There is no difference between a list of integers and a list of characters. The shell will transform this list of 32 bit integers with ASCII equivalents into text for your convenience, but it doesn't do any sort of conversion or typing.