[erlang-questions] [Newbie] [wxErlang] Request for comments

Ale peralta.alejandro@REDACTED
Wed Apr 13 16:19:06 CEST 2011


Hola Erlanguistas,

I'm working on small project to teach myself Erlang. It's a small IRC
client with a wxErlang GUI. (Which actually started as IRC robot, but
anyway). I've been trying to hide the IRC protocol behind an instance
of a gen_event behaviour.

I've noticed that Erlang strong is the backend, but I didn't have any
better ideas and I usually can only spend very few hours per week with
Erlang, so I decided to stick with it. Plus I wanted to try wxErlang,
which I find very interesting, the API really mirrors the C++ API.

The code: https://github.com/alep/Ditto

I have 4 modules:

- conn.erl: Hides socket and connection logic. You pass a function to
a process which handles the socket, when data arrives, the socket
calls the function with the data it received.

- ircmsg.erl: Bunch of functions to parse IRC messages, for example to
retrieve prefix, command and arguments from lines like
":Wiz!@some.host.net PRIVMSG #erlang : hello world!" (prefix =
Wiz!@some.host.net, command=PRIVMSG, arguments = ["#erlang", "hello
world"]

- dittoui.erl: wxErlang GUI, very simple and incomplete user
interface. After going into File -> Connect and giving host, port,
nick and user (example: chat.freenode.net, 6667, thewizardoferl,
JonErlanguista), it creates a socket (and a process which controls it
with conn:open(...)) then it starts gen_event, next it notifies
gen_event of the events {pass ...}, {nick "thewizardoferl"} and {user
"JonErlanguista"}.

- ircclient.erl: gen_event behaviour which tries to hide IRC protocol.
It has 4 states disconnected, nick, user, connected.

I was looking for any encouraging criticism, plain criticism is ok too
:-), or any comments to know if I just delete the repository or if I'm
on good track.

Thanks in advance.

Erlang is fun. :-)

Regards,
-- 
Ale.



More information about the erlang-questions mailing list