Erlang demo app?
I'm in a group at work reading Seven Languages in Seven Weeks by Bruce A. Tate and we are having a presentation on one language each week. I'm partially responsible 开发者_如何转开发for Erlang in 2 weeks and am looking for a good demo app that would show off the strengths of Erlang. I plan to go through the programming exercises in the book, but am looking for that little, interesting app for the demo. I will need to be able to write it in just a few hours once I become more familiar with the language. Any suggestions are welcome.
I ran a neat demo at Dyncon in Stockholm last weekend: https://gist.github.com/854389
It's a "virus" that jumps between connected nodes (which the attendees start on their machines and connect to the presenter's already "infected" node).
It demos distribution very nicely. To complement, I started up an Erlang shell and spawned over a million idle processes (that waited in a receive loop), printing every thousand process number to the shell, until my laptop ran out of memory. Very nice effect. :-)
If you want you can take a look at eirc. It is more of an IRC library but it is a compliant OTP app. Easy to understand and to use and build on (example in the README file) so I think it would be good for a first project.
You can find it here: https://github.com/mazenharake/eirc
I ended up writing an answer to Project Euler's problem 22 in order to show some of the list functions, then I came up with a concurrency app on my own which was pretty well received. Thanks Adam and Mazen for the thoughts.
精彩评论