3 ms·
Joe Armstrong - the creator of erlang would turn his cluster of 1000's of machines to change behaviour. The code is really 5 lines. My favorite Erlang prog
by bosky101 11y ago
Joe Armstrong - the creator of erlang would turn his cluster of 1000's of machines to change behaviour. The code is really 5 lines.
My favorite Erlang program
21 Nov 2013
The other day I got a mail from Dean Galvin from Rowan
University. Dean was doing an Erlang project so he asked
“What example program would best exemplify Erlang”.
...
The Universal Server
Normally servers do something. An HTTP server responds to HTTP requests
and FTP server responds to FTP request and so on. But what about a Universal
Server?
surely we can generalize the idea of a server and make a universal server that
which we can later tell to become a specific sever.
Here’s my universal server:
universal_server() ->
receive
{become, F} ->
F()
end.
...then I set up a gossip algorithm to flood the network with become messages.
Then I had an empty network that in a few seconds would become anything
I wanted it to do.
a process in erlang, is nothing but a tail-recursive function. the moment it stops being so - it dies. so here it morphes into F; which can be passed in.
more at http://joearms.github.io/2013/11/21/My-favorite-erlang-program.html http://joearms.github.io/2013/11/21/My-favorite-erlang-progr...