String data type
David Gould
davidg@REDACTED
Fri Feb 16 23:23:55 CET 2001
On Fri, Feb 16, 2001 at 12:37:19PM +0100, Robert Virding wrote:
>
> The first question is of course what do you *mean* by a string
> datatype? What type of operations do you intend to do on these
> strings?
>
> Binaries provide efficient storage of bytes and with the new bit-syntax
> you also get quite a good interface to access binaries. There are some
> things to watch when building but otherwies it works well. However
> there are not many libraries to do the same type of operations on
> binary strings as for normal list strings.
I want to have the normal libraries or similar to work with binary strings.
That is, I want regexs (eg perlre), spit, join, getline, upcase, str, but
do not want to pay the size and time penalties for making lists out of
strings. I would really prefer to use Erlang for all those text munging,
and report building and scripty things that perl does so very well, but
when you need to rip apart hundreds of megabytes of text, the time and
space penalties of the list representation are too much.
On the topic of: "what else could Erlang have to be a better general purpose
tool?", it would be nice to have a mode or an interpreter start file or
whatever to make it possible to use Erlang from the shell as easily as perl
or pythong scripts. That is, an interpreter behaviour somewhere in between
the normal erl node and the SAE link everything yourself tool. That is, if I
have a foo.erl source, I want to be able to put "#!/usr/local/bin/erlang" at
the top, and then invoke it simply as "./foo.erl -opts somefiles" and have
the language take care of compiling and loading the other modules etc
as needed. Maybe this could be a -behavior(script) or something.
-dg
--
David Gould davidg@REDACTED 510 536 1443
If simplicity worked, the world would be overrun with insects.
More information about the erlang-questions
mailing list