Hello (Erlang) World!

Thomas.Herchenroeder@REDACTED Thomas.Herchenroeder@REDACTED
Sat Aug 14 15:46:40 CEST 2004


Hi,

My name is Thomas. I'm new to this list, albeit not enitrely new to
Erlang. I
want to give you some remarks on my Erlang experiences so far. Please
feel
free to comment on anything. Chances are that I've overlooked things
that are
obvious to others, typical 'newbie' mistakes. On the other hand, I know
the
newbie perspective can be interesting, since newbies haven't already
arranged
themselves with many things, as it naturally happens when they pass on
to the
more advanced states ;-).

I got interested in Erlang a couple of years ago. But since my day job
is with
system administration, I can only make progress in small pieces, playing
with
Erlang on my Windows notebook at home.

I love Erlang for its syntax (being an old-time Prolog fan) and the
built-in
concurrency and messaging, and I'm really impressed by the runtime
environment
and the available tools and applications. Big compliments to all the
developers.

But being not from the telco realm, my main programming interests are
with
TCP/IP-based client/servers and protocols (HTTP, FTP, LDAP, DNS, ...),
command
line filters and automation scripts, just the kind of stuff network
admins are
after ;-). While plain socket support is decent (gen_tcp), I realized
that there
are few protocol-specific modules ("bindings") in Erlang, maybe besides
HTTP,
FTP and IRC.

I was surprised how difficult it was to create a little application that
runs
from the command line. I created the typical

        -module(hello).
        -export([run/0]).
        
        run() ->
                io:format("Hello World~n",[]).

and after some looking around invoked it with

        bash> erlc hello.erl
        bash> erl -noshell -run hello run

which prints the message, but then the process hangs, and I have to use
^C to
end it. I tried to find better command line switches with 'erl --help'
but
unfortunately that doesn't work. I wish there would be an (appreciated)
-compile
flag that let me do the two lines in one, or even better does the
compilation on
the fly and in the background and only if necessary. Perl and Python can
do
that, why shouldn't Erlang?!

And I'm still worried about the hanging process. My next little project
would be
a simple version of 'grep' in Erlang, to be used as a filter like 

        bash> ls -al | erl -noshell -run grep run '.erl' |
<some_consumer>

but this only works properly if the erl process terminates. I have to
make my
way through Ports and think about standard streams in Erlang. And what
about
"hash-bang" support that lets me put the "erl -noshell -run grep run"
part into 
the file itself and then invoke it with "grep.erl '.erl'"?!

I realize Erlang was not invented with this kind of applications in
mind. But
I think it would be greate if Erlang could extend into other realms,
wouldn't
it?! And it maybe doesn't take much.

Speaking of modules I wish Erlang had something like a "CEAN", a
"Comprehensive
Erlang Archive Network", as it exists for Perl (and possibly not as a
network in
the first step). I find it hard to find suitable modules on the Web
looking into
erlang.org user contributions, the erlang-projects.org web site and the
Jungerl
archive. Jungerl is not even available for direct download if you dont
have a
cvs client (like me). 

Erlang modules are not organized in a hierarchy, but come in a flat name
space.
Maybe support for hierarchical module names in the language could help
here. But
a basic, well organized archive infrastructure would be just fine for
the
moment.  It's a shame that good modules dont get propagated (e.g.
http://www.erlang.org/ml-archive/erlang-questions/200408/msg00006.html),
or are
difficult to find.

I recently compiled my first Erlang on Linux (R9C-2). I stumbled over
the
'tgetent in -lcurses' problem that I found was addressed in
http://www.erlang.org/ml-archive/erlang-questions/200303/msg00166.html,
which
refers to R9B-0. Unfortunately, the configer bug still seems to exist,
and no
hint in the README.

Much of my work is with text-based applications, either as a network
protocol or
in files. Scanning text is an every-day task. I read somewhere that
Erlang is
not suitable for munging lots of text, since the internal string
representation
is expensive. Maybe a better internal treatment of strings could help
here. The
other ubiquitous tool for me are regular expressions, and the standard
regexp
module appears, well, a bit scarce. I know only of the 'grepexp' module
from
Jungerl that improves a little bit on that.

Concerning the mailing list: I dont know how your spam rate is doing,
but the
list owners might want to consider obscuring email addresses of posters
in the
mail archive, which is accessible over the Web, so email address
scanners run 
out of luck.

So much for today. I'm looking forward making my way deeper into Erlang.
Thanks for your interest.

=Thomas



More information about the erlang-questions mailing list