[Haskell] Why functional programming matters

Stephan Friedrichs stephan.friedrichs at tu-bs.de
Wed Jan 23 15:43:22 EST 2008

Simon Peyton-Jones wrote:
> [...]
> 2. War stories from real life.  eg "In company X in 2004 they rewrote their application in Haskell/Caml with result Y".  Again, for my purpose I can't tell very long stories; but your message can give a bit more detail than one might actually give in a presentation.  The more concrete and specific, the better.  E.g. what, exactly, about using a functional language made it a win for you?

We [1] implemented an ad-hoc chat system in Haskell in the SEP [2] at 
the TU-Braunschweig.

The ad-hoc (there is no central server, every node has the same 
behaviour) protocol [3] (not of our making) is rather complicated, as 
each node on the network has to detect the neighbouring network topology 
in order to route messages to their destination:

A <-> B <-> C

Besides, it has to handle netsplit and -merge situations: Two separate 
networks might be connected by the spawning of a new node in between or 
split by the disappearance of the latter.

There are public and private IRC-like channels, the latter is encrypted 
by a symmetric cipher. Besides, there is an anonymous channel obscuring 
a message's origin.

On top of that we built a nice gtk2hs GUI.

The project homepage is http://sep07.mroot.net/index.html. I regret it's 
not in English :( - But the source code and documentation [4] are. You 
can build the documentation from the snapshot [5].

The interesting thing about the project is, that it provides a nice 
mixture  of IO (network), purely functional protocol handling and 
related data structures and a graphical user interface (GTK). Besides, 
it was implemented by 3 other groups (two using Java, one using C++) as 
well. Comparing the results, you see that the Haskell implementation is 
not only more stable and provides more features, it also has about 70% 
less code.

Let me know, if you're interested in details.

 > [...]

Hope this helps

[1] 4 students: 2 experienced Haskell users and two newbies
[2] a practical course where a non-trivial software project has to be
     planned, implemented and documented
[3] http://sep07.mroot.net/documentation/draft-strauss-p2p-chat-09.txt
[4] Complete repository available at: 
[5] http://sep07.mroot.net/snapshots/Barracuda-1.0.2.tar.bz2


Früher hieß es ja: Ich denke, also bin ich.
Heute weiß man: Es geht auch so.

  - Dieter Nuhr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/haskell/attachments/20080123/da3abfec/signature.bin

More information about the Haskell mailing list