Hello (Erlang) World!

Thomas.Herchenroeder <>
Sat Aug 14 15:46:40 CEST 2004


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
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
newbie perspective can be interesting, since newbies haven't already
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
Erlang on my Windows notebook at home.

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

But being not from the telco realm, my main programming interests are
TCP/IP-based client/servers and protocols (HTTP, FTP, LDAP, DNS, ...),
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
FTP and IRC.

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

        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'
unfortunately that doesn't work. I wish there would be an (appreciated)
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
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' |

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
"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,
it?! And it maybe doesn't take much.

Speaking of modules I wish Erlang had something like a "CEAN", a
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
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
Maybe support for hierarchical module names in the language could help
here. But
a basic, well organized archive infrastructure would be just fine for
moment.  It's a shame that good modules dont get propagated (e.g.
or are
difficult to find.

I recently compiled my first Erlang on Linux (R9C-2). I stumbled over
'tgetent in -lcurses' problem that I found was addressed in
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
is expensive. Maybe a better internal treatment of strings could help
here. The
other ubiquitous tool for me are regular expressions, and the standard
module appears, well, a bit scarce. I know only of the 'grepexp' module
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.


More information about the erlang-questions mailing list