[erlang-questions] Erlangic-ness?

Liam Clarke ml.cyresse@REDACTED
Tue Sep 26 13:10:54 CEST 2006


Hi all,

Erlangic - the Erlang equivalent of Pythonic.

Don't think it'll take off though.

I've been writing an MSN client in Erlang as a learning project, and
I'm reasonably confident with the basic sequential language. It's the
sticking it together part that I can feel my noobness in.

What I've completed so far will authenticate me with the MSN
notification servers, now I just want to get the architecture right
before proceeding any further.

My current architecture involves interacting directly with an
authentication controller process which controls a socket process.

The socket process's code is http://paste.lisp.org/display/26798
The authentication controller process codes is
http://paste.lisp.org/display/26800

The authentication module also makes an HTTP POST request; I've
decided not to create another process for this currently as the
authentication process is sequential in nature. The code for the HTTP
request is http://paste.lisp.org/display/26801

I'm currently implementing error handling - I'm going to shift overall
control and user interaction into a supervisor process shortly. As
every stage of the process requires that the previous stage complete
successfully, I want the authentication controller and associated
socket process to die and return useful debugging data if failure
occurs.

I'm trying to keep the error logic separate from the socket process -
I hope to be able to use the same generic socket code with some slight
modifcations.

My ultimate aim is to have  the my various bit so modularised so that
swapping a GUI interface for console interaction or similar should not
change anything.

If it's possible, could someone please cast their eye over my code?
I'm wondering if there's any obvious gotchas, or bad design patterns
or just inefficiencies due to clumsy usage of Erlang.

I thank anyone who does in advance for their time - Erlang is a
different paradigm entirely, and I'm unsure as to good practise. I've
been looking at the OTP design principles and Mr Armstrong's thesis,
but I'm unsure as to how far I need to take it.

Should I be using stuff like gen_event and supervisor()?

Regards,

Liam Clarke



More information about the erlang-questions mailing list