Erlang does have problems
Robert Virding
robert.virding@REDACTED
Wed Aug 30 22:00:43 CEST 2006
No, while binaries, or a string data type equivalent, are definitely
much more space efficient (a factor 2-8 depending on encoding) they are
probably much slower for processing strings. Especially for pulling them
apart and rebuilding them, and inserting or deleting bits which would
entail much copying. Of course you could make a more complex datatype
which keeps the characters in a linked sequence ... :-)
Strings as lists also has the benefit that you can more easily work on
16 or 32 bit unicode characters directly without worrying about
encoding. Then encode them when done. I would keep the statis strings as
binaries and dynamic ones as lists.
Robert
Joel Reymont wrote:
>
> On Aug 30, 2006, at 4:25 PM, Bob Ippolito wrote:
>
>> How is it less of a problem with lists? There still isn't any support
>> for text encodings in what ships with Erlang (that I've been able to
>> find, anyway).
>
>
> I (naively?) assumed that it's easier to process text encodings using
> lists than binaries. It should be the same, now that I think about it,
> just using much less space with binaries and maybe even faster.
>
> --
> http://wagerlabs.com/
More information about the erlang-questions
mailing list