[erlang-questions] Complex state machines for complex telnet applications

Thom Cherryhomes thom.cherryhomes@REDACTED
Sun Jan 22 21:56:12 CET 2017


Hello, everyone. This is my first post to the list.


I’m a long time swiss army knife of a software and hardware engineer who
has started to pick up Erlang, because I believe it and languages like it
to be the future of software development.

With that said, I am working on a personal project of mine that I have
wanted to complete, a 21st century version of a BBS system, and I believe
Erlang and OTP are a good language and toolkit to write it in.


Code is being dropped here: http://github.com/tschak909/nakbbs


I am experimenting with both Ranch and just using gen_tcp with my own
socket pools, but I do have some design questions.


The telnet ports need to present a definite series of states, broken up
into seperate pieces:


I have definite common events that can be stretched across multiple use
cases:


* Display

* Wait for line of input

* Wait for character input

* branch to another menu

* hang up


But there will also be definite sections of the system, which could be
thought of as states:


* Authentication

* Message Browser

* Message Editor

* Various Games


etc.


and I’m trying to think of an appropriate architectural pattern that will
avoid me basically having to cram every conceivable state as a sort of
hierarchy of tuples into a single gen_statem module. How can I approach
this in a nice abstract and extensible manner, that I could for example
push into a Behaviour and subsequently utilize for different terminal
types? It would be nice to split up the different parts of the system into
applications that would essentially be called from well defined APIs…


I’m just trying to figure this all out, and would love a semblence of
direction so I can do the proper research and deeply understand what I need
to learn.


-Thom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170122/dbb61f5e/attachment.htm>


More information about the erlang-questions mailing list